@azure/notification-hubs 1.1.2-alpha.20240320.1 → 1.2.0-alpha.20240326.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/utils/constants.ts","../src/auth/hmacSha256.ts","../src/auth/sasTokenCredential.ts","../src/auth/connectionStringUtils.ts","../src/api/clientContext.ts","../src/utils/utils.ts","../src/serializers/notificationOutcomeSerializer.ts","../src/utils/xmlUtils.ts","../src/api/internal/_client.ts","../src/serializers/notificationHubJobSerializer.ts","../src/utils/tracing.ts","../src/api/getNotificationHubJob.ts","../src/api/submitNotificationHubJob.ts","../src/api/beginSubmitNotificationHubJob.ts","../src/api/cancelScheduledNotification.ts","../src/api/createOrUpdateInstallation.ts","../src/serializers/registrationSerializer.ts","../src/api/internal/_createOrUpdateRegistrationDescription.ts","../src/api/createOrUpdateRegistration.ts","../src/api/createRegistrationId.ts","../src/api/createRegistration.ts","../src/api/deleteInstallation.ts","../src/api/deleteRegistration.ts","../src/api/getFeedbackContainerUrl.ts","../src/api/getInstallation.ts","../src/serializers/notificationDetailsSerializer.ts","../src/api/getNotificationOutcomeDetails.ts","../src/api/getRegistration.ts","../src/api/listNotificationHubJobs.ts","../src/api/internal/_listRegistrations.ts","../src/api/listRegistrationsByChannel.ts","../src/api/listRegistrationsByTag.ts","../src/api/listRegistrations.ts","../src/api/scheduleNotification.ts","../src/utils/optionUtils.ts","../src/utils/notificationUtils.ts","../src/api/sendNotification.ts","../src/api/updateInstallation.ts","../src/api/updateRegistration.ts","../src/notificationHubsClient.ts","../src/models/installation.ts","../src/models/notification.ts","../src/models/notificationBodyBuilder.ts","../src/models/registration.ts","../src/models/tagExpressionBuilder.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.1.2\";\n\nexport const JSON_CONTENT_TYPE = \"application/json;charset=utf-8\";\nexport const XML_CONTENT_TYPE = \"application/xml\";\nexport const STREAM_CONTENT_TYPE = \"application/octet-stream\";\n\nexport const WNS_TYPE_NAME = \"X-WNS-Type\";\nexport const WNS_RAW = \"wns/raw\";\nexport const WNS_BADGE = \"wns/badge\";\nexport const WNS_TITLE = \"wns/tile\";\nexport const WNS_TOAST = \"wns/toast\";\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createHmac } from \"crypto\";\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const hmac = createHmac(\"sha256\", key).update(toSign).digest(\"base64\");\n return encodeURIComponent(hmac);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccessToken, TokenCredential } from \"@azure/core-auth\";\nimport { signString } from \"./hmacSha256.js\";\n\n/**\n * Represents a named key credential.\n */\nexport interface NamedKeyCredential {\n /**\n * The Shared Access Signature key name.\n */\n sharedAccessKeyName: string;\n\n /**\n * The Shared Access Signature key value.\n */\n sharedAccessKey: string;\n}\n\n/**\n * A TokenProvider that generates a Sas token:\n * `SharedAccessSignature sr=<resource>&sig=<signature>&se=<expiry>&skn=<keyname>`\n *\n * @internal\n */\nexport class SasTokenCredential implements TokenCredential {\n /**\n * The SASCredential containing the key name and secret key value.\n */\n private _credential: NamedKeyCredential;\n\n /**\n * Initializes a new instance of SasTokenProvider\n * @param credential - The source `NamedKeyCredential` or `SASCredential`.\n */\n constructor(credential: NamedKeyCredential) {\n this._credential = credential;\n }\n\n /**\n * Gets the sas token for the specified audience\n * @param scopes - The scope for which the token is desired.\n */\n async getToken(scopes: string | string[]): Promise<AccessToken | null> {\n const audience = Array.isArray(scopes) ? scopes[0] : scopes;\n return createToken(\n this._credential.sharedAccessKeyName,\n this._credential.sharedAccessKey,\n Math.floor(Date.now() / 1000) + 3600,\n audience,\n );\n }\n}\n\n/**\n * Creates the sas token based on the provided information.\n * @param keyName - The shared access key name.\n * @param key - The shared access key.\n * @param expiry - The time period in unix time after which the token will expire.\n * @param audience - The audience for which the token is desired.\n * @internal\n */\nasync function createToken(\n keyName: string,\n key: string,\n expiry: number,\n audience: string,\n): Promise<AccessToken> {\n audience = encodeURIComponent(audience.toLowerCase());\n keyName = encodeURIComponent(keyName);\n const stringToSign = audience + \"\\n\" + expiry;\n const sig = await signString(key, stringToSign);\n\n return {\n token: `SharedAccessSignature sr=${audience}&sig=${sig}&se=${expiry}&skn=${keyName}`,\n expiresOnTimestamp: expiry,\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { SasTokenCredential } from \"./sasTokenCredential.js\";\n\n/**\n * Defines an object with possible properties defined in T.\n */\nexport type ParsedOutput<T> = { [P in keyof T]: T[P] };\n\n/**\n * Parses the connection string and returns an object of type T.\n *\n * Connection strings have the following syntax:\n *\n * ConnectionString ::= `Part { \";\" Part } [ \";\" ] [ WhiteSpace ]`\n * Part ::= [ PartLiteral [ \"=\" PartLiteral ] ]\n * PartLiteral ::= [ WhiteSpace ] Literal [ WhiteSpace ]\n * Literal ::= ? any sequence of characters except ; or = or WhiteSpace ?\n * WhiteSpace ::= ? all whitespace characters including `\\r` and `\\n` ?\n *\n * @param connectionString - The connection string to be parsed.\n * @returns ParsedOutput<T>.\n */\nfunction parseConnectionString<T>(connectionString: string): ParsedOutput<T> {\n const output: { [k: string]: string } = {};\n const parts = connectionString.trim().split(\";\");\n\n for (let part of parts) {\n part = part.trim();\n\n if (part === \"\") {\n // parts can be empty\n continue;\n }\n\n const splitIndex = part.indexOf(\"=\");\n if (splitIndex === -1) {\n throw new Error(\n \"Connection string malformed: each part of the connection string must have an `=` assignment.\",\n );\n }\n\n const key = part.substring(0, splitIndex).trim();\n if (key === \"\") {\n throw new Error(\"Connection string malformed: missing key for assignment\");\n }\n\n const value = part.substring(splitIndex + 1).trim();\n\n output[key] = value;\n }\n\n return output as any;\n}\n\n/**\n * The set of properties that comprise a Notification Hubs connection string.\n */\nexport interface NotificationHubsConnectionStringProperties {\n /**\n * The value for \"Endpoint\" in the connection string.\n */\n endpoint: string;\n /**\n * The value for \"SharedAccessKey\" in the connection string. This along with the \"SharedAccessKeyName\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKey: string;\n /**\n * The value for \"SharedAccessKeyName\" in the connection string. This along with the \"SharedAccessKey\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKeyName: string;\n}\n\n/**\n * Creates a SasTokenCredential from a shared access key and shared access key name.\n * @param sharedAccessKey - The shared access key value.\n * @param sharedAccessKeyName - The shared access key name.\n * @returns A SasTokenCredential with the given shared access token information.\n */\nexport function createTokenCredentialFromConnection(\n sharedAccessKey: string,\n sharedAccessKeyName: string,\n): SasTokenCredential {\n return new SasTokenCredential({ sharedAccessKey, sharedAccessKeyName });\n}\n\n/**\n * Parses given connection string into the different properties applicable to Azure Service Bus.\n * The properties are useful to then construct a ServiceBusClient.\n * @param connectionString - The connection string associated with the Shared Access Policy created\n * for the Service Bus namespace, queue or topic.\n */\nexport function parseNotificationHubsConnectionString(\n connectionString: string,\n): NotificationHubsConnectionStringProperties {\n const parsedResult = parseConnectionString<{\n Endpoint: string;\n SharedAccessKey?: string;\n SharedAccessKeyName?: string;\n }>(connectionString);\n if (!parsedResult.Endpoint) {\n throw new Error(\"Connection string should have an Endpoint key.\");\n }\n\n if (parsedResult.SharedAccessKey && !parsedResult.SharedAccessKeyName) {\n throw new Error(\"Connection string with SharedAccessKey should have SharedAccessKeyName.\");\n } else if (!parsedResult.SharedAccessKey && parsedResult.SharedAccessKeyName) {\n throw new Error(\n \"Connection string with SharedAccessKeyName should have SharedAccessKey as well.\",\n );\n }\n\n const output: NotificationHubsConnectionStringProperties = {\n endpoint: parsedResult.Endpoint,\n sharedAccessKey: parsedResult.SharedAccessKey!,\n sharedAccessKeyName: parsedResult.SharedAccessKeyName!,\n };\n\n return output;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as constants from \"../utils/constants.js\";\nimport {\n HttpClient,\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n RestError,\n createDefaultHttpClient,\n createHttpHeaders,\n} from \"@azure/core-rest-pipeline\";\nimport {\n createTokenCredentialFromConnection,\n parseNotificationHubsConnectionString,\n} from \"../auth/connectionStringUtils.js\";\nimport { NotificationHubsClientOptions } from \"../models/options.js\";\nimport { SasTokenCredential } from \"../auth/sasTokenCredential.js\";\nimport { Client, getClient } from \"@azure-rest/core-client\";\n\nconst API_VERSION = \"2020-06\";\n\n/**\n * Represents the Notification Hubs SDK client context.\n */\nexport interface NotificationHubsClientContext {\n /**\n * @internal\n */\n sendRequest(request: PipelineRequest): Promise<PipelineResponse>;\n\n /**\n * @internal\n */\n createHeaders(operationName: string, rawHeaders?: Record<string, string>): Promise<HttpHeaders>;\n\n /**\n * @internal\n */\n requestUrl(): URL;\n}\n\n/**\n * Creates a NotificationHubClient from the Access Policy connection string and hub name.\n * @param connectionString - The Access Policy connection string for the notification hub.\n * @param hubName - The notification hub name.\n * @returns A NotificationHubsClientContext initialized from the connection string and hub name.\n */\nexport function createClientContext(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n): NotificationHubsClientContext {\n return new NotificationHubsServiceClient(connectionString, hubName, options);\n}\n\nclass NotificationHubsServiceClient implements NotificationHubsClientContext {\n sasTokenCredential: SasTokenCredential;\n baseUrl: string;\n hubName: string;\n client: Client;\n httpClient: HttpClient;\n\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this.hubName = hubName;\n\n const parsedConnection = parseNotificationHubsConnectionString(connectionString);\n // Node doesn't allow change in protocol but browsers do, so doing a string replace\n this.baseUrl = parsedConnection.endpoint.replace(\"sb://\", \"https://\");\n this.sasTokenCredential = createTokenCredentialFromConnection(\n parsedConnection.sharedAccessKey,\n parsedConnection.sharedAccessKeyName,\n );\n\n const packageDetails = `azsdk-js-notificationhubs/${constants.SDK_VERSION}`;\n const userAgentPrefix = options.userAgentOptions?.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n this.httpClient = options?.httpClient ?? createDefaultHttpClient();\n this.client = getClient(this.baseUrl, {\n userAgentOptions: {\n userAgentPrefix,\n },\n ...options,\n });\n }\n\n async createHeaders(\n operationName: string,\n rawHeaders?: Record<string, string>,\n ): Promise<HttpHeaders> {\n const authorization = await this.sasTokenCredential.getToken(this.baseUrl);\n if (!authorization) {\n throw new RestError(\"Failed to get the authorization header\", { statusCode: 401 });\n }\n\n const headers = createHttpHeaders(rawHeaders);\n headers.set(\"Authorization\", authorization.token);\n headers.set(\"x-ms-version\", API_VERSION);\n headers.set(\n \"x-ms-azsdk-telemetry\",\n `class=NotificationHubsServiceClient;method=${operationName}`,\n );\n\n return headers;\n }\n\n sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n return this.client.pipeline.sendRequest(this.httpClient, request);\n }\n\n requestUrl(): URL {\n const url = new URL(this.baseUrl);\n url.pathname = this.hubName;\n url.searchParams.set(\"api-version\", API_VERSION);\n\n return url;\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Helper TypeGuard that checks if something is defined or not.\n * @param thing - Anything\n * @internal\n */\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return typeof thing !== \"undefined\" && thing !== null;\n}\n\n/**\n * Helper TypeGuard that checks if something is a string or not.\n * @param thing - Anything\n * @internal\n */\nexport function isString(thing: unknown): thing is string {\n return typeof thing === \"string\" || thing instanceof String;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given string,\n * or throws error if undefined.\n */\nexport function getString(value: unknown, nameOfProperty: string): string {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a string value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given input,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getStringOrUndefined(value: any): string | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n return value.toString();\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or throws error if undefined.\n */\nexport function getInteger(value: unknown, nameOfProperty: string): number {\n const result = getIntegerOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getIntegerOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseInt(value.toString());\n return isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or throws error if undefined.\n */\nexport function getFloat(value: unknown, nameOfProperty: string): number {\n const result = getFloatOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getFloatOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseFloat(value.toString());\n return Number.isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type.\n */\nexport function getDate(value: string, nameOfProperty: string): Date {\n const result = getDateOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a Date value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getDateOrUndefined(value: any): Date | undefined {\n const stringValue = getStringOrUndefined(value);\n if (stringValue === undefined) {\n return undefined;\n }\n const result = new Date(stringValue.toString());\n return Number.isNaN(+result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to parse tags from a comma separated string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTagsOrUndefined(value?: any): string[] | undefined {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n return undefined;\n }\n return result.split(\",\");\n}\n\nexport type NullableRecord = Record<string, string | undefined>;\nexport type NonNullableRecord = Record<string, NonNullable<NullableRecord[string]>>;\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationHubsMessageResponse,\n RegistrationResult,\n} from \"../models/notificationDetails.js\";\nimport { getInteger, getString, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\nexport async function parseNotificationOutcome(\n bodyText: string,\n): Promise<NotificationHubsMessageResponse> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const outcome = xml.NotificationOutcome;\n\n return {\n successCount: getInteger(outcome.Success, \"Success\"),\n failureCount: getInteger(outcome.Failure, \"Failure\"),\n results: parseRegistrationResults(outcome.Results.RegistrationResult),\n state: \"DetailedStateAvailable\",\n };\n}\n\nfunction parseRegistrationResults(results?: Record<string, any>): RegistrationResult[] {\n const registrationResults: RegistrationResult[] = [];\n\n if (!isDefined(results)) {\n return registrationResults;\n }\n\n const resultsArray = Array.isArray(results) ? results : [results];\n\n for (const result of resultsArray) {\n registrationResults.push({\n applicationPlatform: getString(result.ApplicationPlatform, \"ApplicationPlatform\"),\n registrationId: getString(result.RegistrationId, \"RegistrationId\"),\n outcome: getString(result.Outcome, \"Outcome\"),\n pnsHandle: getString(result.PnsHandle, \"PnsHandle\"),\n });\n }\n\n return registrationResults;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { isDefined } from \"./utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * Marker for atom metadata.\n *\n * @internal\n */\nexport const XML_METADATA_MARKER = \"$\";\n\n/**\n * Marker for atom value.\n *\n * @internal\n */\nexport const XML_VALUE_MARKER = \"_\";\n\n/**\n * @internal\n * Helps in differentiating JSON like objects from other kinds of objects.\n */\nconst EMPTY_JSON_OBJECT_CONSTRUCTOR = {}.constructor;\n\n/**\n * @internal\n * Returns `true` if given input is a JSON like object.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isJSONLikeObject(value: any): boolean {\n // `value.constructor === {}.constructor` differentiates among the \"object\"s,\n // would filter the JSON objects and won't match any array or other kinds of objects\n\n // -------------------------------------------------------------------------------\n // Few examples | typeof obj ===\"object\" | obj.constructor==={}.constructor\n // -------------------------------------------------------------------------------\n // {abc:1} | true | true\n // [\"a\",\"b\"] | true | false\n // [{\"a\":1},{\"b\":2}] | true | false\n // new Date() | true | false\n // 123 | false | false\n // -------------------------------------------------------------------------------\n return typeof value === \"object\" && value.constructor === EMPTY_JSON_OBJECT_CONSTRUCTOR;\n}\n\n/**\n * @internal\n * The key-value pairs having undefined/null as the values would lead to the empty tags in the serialized XML request.\n * Empty tags in the request body is problematic because of the following reasons.\n * - ATOM based management operations throw a \"Bad Request\" error if empty tags are included in the XML request body at top level.\n * - At the inner levels, Service assigns the empty strings as values to the empty tags instead of throwing an error.\n *\n * This method recursively removes the key-value pairs with undefined/null as the values from the request object that is to be serialized.\n *\n */\nexport function sanitizeSerializableObject(resource: { [key: string]: any }): void {\n Object.keys(resource).forEach(function (property) {\n if (!isDefined(resource[property])) {\n delete resource[property];\n } else if (isJSONLikeObject(resource[property])) {\n sanitizeSerializableObject(resource[property]);\n }\n });\n}\n\n/**\n * @internal\n * Serializes input information to construct the Atom XML request\n * @param resourceName - Name of the resource to be serialized like `QueueDescription`\n * @param resource - The entity details\n * @returns An object to be serialized into a string.\n */\nexport function serializeToAtomXmlRequest(\n resourceName: string,\n resource: unknown,\n): Record<string, unknown> {\n const content: any = {};\n\n content[resourceName] = Object.assign({}, resource);\n sanitizeSerializableObject(content[resourceName]);\n\n content[resourceName][XML_METADATA_MARKER] = {\n xmlns: \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\",\n \"xmlns:i\": \"http://www.w3.org/2001/XMLSchema-instance\",\n };\n\n content[XML_METADATA_MARKER] = { type: \"application/xml\" };\n const requestDetails: Record<string, unknown> = {\n updated: new Date().toISOString(),\n content: content,\n };\n requestDetails[XML_METADATA_MARKER] = {\n xmlns: \"http://www.w3.org/2005/Atom\",\n };\n return requestDetails;\n}\n\n/**\n * @internal\n * Parses the XML message from a Notification Hubs response\n * @param bodyText - The HTTP response body.\n * @returns The notification details if any from the XML.\n */\nexport async function parseXMLError(bodyText: string): Promise<string | undefined> {\n let result: string | undefined;\n const xmlError = await parseXML(bodyText, { includeRoot: true });\n const detail = xmlError[\"Error\"][\"Detail\"];\n if (isDefined(detail)) {\n return detail;\n }\n\n return result;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n HttpHeaders,\n HttpMethods,\n PipelineRequest,\n PipelineResponse,\n RestError,\n createPipelineRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"../../models/notificationDetails.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { isDefined } from \"../../utils/utils.js\";\nimport { parseNotificationOutcome } from \"../../serializers/notificationOutcomeSerializer.js\";\nimport { parseXMLError } from \"../../utils/xmlUtils.js\";\n\nexport function createRequest(\n endpoint: URL,\n method: HttpMethods,\n headers: HttpHeaders,\n options: OperationOptions,\n): PipelineRequest {\n return createPipelineRequest({\n ...options.tracingOptions,\n ...options.requestOptions,\n url: endpoint.toString(),\n abortSignal: options.abortSignal,\n method,\n headers,\n });\n}\n\n/**\n * Parses the HTTP response and creates a NotificationHubsResponse with header information from the operation.\n * @param response - The HTTP response used to populate the result.\n * @returns A NotificationHubsResponse with header information from the operation.\n */\nexport function parseNotificationResponse(response: PipelineResponse): NotificationHubsResponse {\n const correlationId = response.headers.get(\"x-ms-correlation-request-id\");\n const trackingId = response.headers.get(\"TrackingId\");\n const location = response.headers.get(\"Location\");\n\n return {\n correlationId,\n trackingId,\n location,\n };\n}\n\n/**\n * Parses the HTTP response and creates a NotificationHubsMessageResponse with results from the notification.\n * @param response - The HTTP response used to populate the result.\n * @returns A NotificationHubsMessageResponse with results from the notification.\n */\nexport async function parseNotificationSendResponse(\n response: PipelineResponse,\n): Promise<NotificationHubsMessageResponse> {\n const result = parseNotificationResponse(response);\n let notificationId: string | undefined;\n if (result.location) {\n const locationUrl = new URL(result.location);\n notificationId = locationUrl.pathname.split(\"/\")[3];\n }\n\n const requestUrl = new URL(response.request.url);\n const isTestSend = requestUrl.searchParams.has(\"test\");\n const isDirectSend = requestUrl.searchParams.has(\"direct\");\n\n // Only broadcast/tag based sends are supported for test send\n const responseBody = response.bodyAsText;\n if (isTestSend && !isDirectSend && isDefined(responseBody)) {\n const outcome = await parseNotificationOutcome(responseBody);\n return {\n ...result,\n ...outcome,\n notificationId,\n };\n } else {\n return createDefaultResponse(result, notificationId);\n }\n}\n\nfunction createDefaultResponse(\n response: NotificationHubsResponse,\n notificationId?: string,\n): NotificationHubsMessageResponse {\n return {\n ...response,\n notificationId,\n successCount: 0,\n failureCount: 0,\n results: [],\n state: \"Enqueued\",\n };\n}\n\n/**\n * Sends a request through the client context.\n * @param context - The client context to use.\n * @param request - The HTTP request to send.\n * @param successStatusCode - A status code or list of status codes to check for success.\n * @returns The HTTP Response.\n */\nexport async function sendRequest(\n context: NotificationHubsClientContext,\n request: PipelineRequest,\n successStatusCode: number | number[],\n): Promise<PipelineResponse> {\n const statuses: number[] = Array.isArray(successStatusCode)\n ? successStatusCode\n : [successStatusCode];\n\n const response = await context.sendRequest(request);\n\n if (!statuses.some((statusCode) => statusCode === response.status)) {\n const responseBody = response.bodyAsText;\n let details: string | undefined;\n if (isDefined(responseBody)) {\n try {\n details = await parseXMLError(responseBody);\n } catch (err) {\n // eslint-disable no-empty\n }\n }\n\n let errorMessage: string | undefined;\n if (isDefined(details)) {\n errorMessage = `operations failed with: ${details}`;\n } else {\n errorMessage = `operation failed with status ${response.status}`;\n }\n\n throw new RestError(errorMessage, {\n statusCode: response.status,\n response,\n });\n }\n\n return response;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationHubJob,\n NotificationHubJobStatus,\n NotificationHubJobType,\n} from \"../models/notificationHubJob.js\";\nimport {\n getDateOrUndefined,\n getFloatOrUndefined,\n getString,\n getStringOrUndefined,\n isDefined,\n} from \"../utils/utils.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { serializeToAtomXmlRequest } from \"../utils/xmlUtils.js\";\n\n/**\n * @internal\n * Serializes a NotificationHubJob into an Atom XML entry.\n * @param entry - The NotificationHubJob to turn into an Atom XML entry.\n * @returns An Atom XML entry containing the notification hub job.\n */\nexport function serializeNotificationHubJobEntry(entry: NotificationHubJob): string {\n const job: Record<string, any> = {\n Type: entry.type,\n OutputContainerUri: { __cdata: entry.outputContainerUrl },\n ImportFileUri: isDefined(entry.importFileUrl) ? { __cdata: entry.importFileUrl } : undefined,\n };\n\n const requestObject = serializeToAtomXmlRequest(\"NotificationHubJob\", job);\n\n return stringifyXML(requestObject, { rootName: \"entry\", cdataPropName: \"__cdata\" });\n}\n\n/**\n * Parses an Atom XML of an notification hub job entry.\n * @param bodyText - The incoming Atom XML entry to parse into a notification hub job.\n * @returns A parsed NotificationHubJob.\n */\nexport async function parseNotificationHubJobEntry(bodyText: string): Promise<NotificationHubJob> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const content = xml.entry.content.NotificationHubJob;\n return createNotificationHubJob(content);\n}\n\n/**\n * Parses an Atom XML feed of notification hub jobs.\n * @param bodyText - The incoming Atom XML feed to parse into notification hub jobs.\n * @returns A list of notification hub jobs.\n */\nexport async function parseNotificationHubJobFeed(bodyText: string): Promise<NotificationHubJob[]> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const results: NotificationHubJob[] = [];\n\n if (!isDefined(xml.feed.entry)) {\n return results;\n }\n\n const entries = Array.isArray(xml.feed.entry) ? xml.feed.entry : [xml.feed.entry];\n\n for (const item of entries) {\n results.push(createNotificationHubJob(item.content.NotificationHubJob));\n }\n\n return results;\n}\n\nfunction createInputOutputProperties(content: Record<string, any>): Record<string, string> {\n const props: Record<string, string> = {};\n\n const keyValues = content[\"d3p1:KeyValueOfstringstring\"];\n const keyValueArray = Array.isArray(keyValues) ? keyValues : [keyValues];\n for (const item of keyValueArray) {\n props[item[\"d3p1:Key\"]] = item[\"d3p1:Value\"];\n }\n\n return props;\n}\n\nfunction createNotificationHubJob(content: Record<string, any>): NotificationHubJob {\n let outputProperties: Record<string, string> | undefined;\n if (isDefined(content[\"OutputProperties\"])) {\n outputProperties = createInputOutputProperties(content[\"OutputProperties\"]);\n }\n\n let inputProperties: Record<string, string> | undefined;\n if (isDefined(content[\"InputProperties\"])) {\n inputProperties = createInputOutputProperties(content[\"InputProperties\"]);\n }\n\n return {\n jobId: getStringOrUndefined(content[\"JobId\"]),\n type: getString(content[\"Type\"], \"type\") as NotificationHubJobType,\n status: getStringOrUndefined(content[\"Status\"]) as NotificationHubJobStatus,\n progress: getFloatOrUndefined(content[\"Progress\"]),\n outputContainerUrl: getString(content[\"OutputContainerUri\"], \"outputContainerUrl\"),\n importFileUrl: getStringOrUndefined(content[\"ImportFileUri\"]),\n failure: getStringOrUndefined(content[\"Failure\"]),\n createdAt: getDateOrUndefined(content[\"CreatedAt\"]),\n updatedAt: getDateOrUndefined(content[\"UpdatedAt\"]),\n inputProperties,\n outputProperties,\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { SDK_VERSION } from \"./constants.js\";\nimport { createTracingClient } from \"@azure/core-tracing\";\n\n/**\n * A tracing client to handle spans.\n * @internal\n */\nexport const tracingClient = createTracingClient({\n namespace: \"Microsoft.NotificationHubs\",\n packageName: \"@azure/notification-hubs\",\n packageVersion: SDK_VERSION,\n});\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { parseNotificationHubJobEntry } from \"../serializers/notificationHubJobSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getNotificationHubJob\";\n\n/**\n * Gets a Notification Hub Job by the ID.\n * @param context - The Notification Hubs client.\n * @param jobId - The Notification Hub Job ID.\n * @param options - The operation options.\n * @returns The Notification Hub Job with the matching ID.\n */\nexport function getNotificationHubJob(\n context: NotificationHubsClientContext,\n jobId: string,\n options: OperationOptions = {},\n): Promise<NotificationHubJob> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/jobs/${jobId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationHubJobEntry(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport {\n parseNotificationHubJobEntry,\n serializeNotificationHubJobEntry,\n} from \"../serializers/notificationHubJobSerializer.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"submitNotificationHubJob\";\n\n/**\n * Submits a Notification Hub Job.\n * Note: this is available to Standard SKU namespace and above.\n * @param context - The Notification Hubs client.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\nexport function submitNotificationHubJob(\n context: NotificationHubsClientContext,\n job: NotificationHubJob,\n options: OperationOptions = {},\n): Promise<NotificationHubJob> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/jobs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = serializeNotificationHubJobEntry(job);\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationHubJobEntry(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { CancelOnProgress, OperationState, SimplePollerLike } from \"@azure/core-lro\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PolledOperationOptions } from \"../models/options.js\";\nimport { delay } from \"@azure/core-util\";\nimport { getNotificationHubJob } from \"./getNotificationHubJob.js\";\nimport { submitNotificationHubJob } from \"./submitNotificationHubJob.js\";\n\n/**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param context - The Notification Hubs client.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\nexport async function beginSubmitNotificationHubJob(\n context: NotificationHubsClientContext,\n notificationHubJob: NotificationHubJob,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<NotificationHubJobPoller> {\n let submittedJob = await submitNotificationHubJob(\n context,\n notificationHubJob,\n polledOperationOptions,\n );\n\n type Handler = (state: OperationState<NotificationHubJob>) => void;\n\n const state: OperationState<NotificationHubJob> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<NotificationHubJob> | undefined;\n let cancelJob: (() => void) | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: SimplePollerLike<OperationState<NotificationHubJob>, NotificationHubJob> = {\n async poll(options?: { abortSignal?: AbortSignalLike }): Promise<void> {\n submittedJob = await getNotificationHubJob(context, submittedJob.jobId!, options);\n if (submittedJob.status === \"Running\" || submittedJob.status === \"Started\") {\n state.status = \"running\";\n }\n\n if (submittedJob.status === \"Completed\") {\n state.status = \"succeeded\";\n state.result = submittedJob;\n }\n\n if (submittedJob.status === \"Failed\") {\n state.status = \"failed\";\n state.error = new Error(submittedJob.failure);\n }\n\n await processProgressCallbacks();\n\n if (state.status === \"canceled\") {\n throw new Error(\"Operation was canceled\");\n }\n if (state.status === \"failed\") {\n throw state.error;\n }\n },\n\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<NotificationHubJob> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone()) {\n await poller.poll({ abortSignal });\n while (!poller.isDone()) {\n await delay(currentPollIntervalInMs, { abortSignal });\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n return poller.getResult() as NotificationHubJob;\n case \"canceled\":\n throw new Error(\"Operation was canceled\");\n case \"failed\":\n throw state.error;\n case \"notStarted\":\n case \"running\":\n throw new Error(`Polling completed without succeeding or failing`);\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(callback: (state: OperationState<NotificationHubJob>) => void): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n stopPolling(): void {\n abortController.abort();\n cancelJob?.();\n },\n\n isStopped(): boolean {\n return resultPromise === undefined;\n },\n\n getOperationState(): OperationState<NotificationHubJob> {\n return state;\n },\n\n getResult(): NotificationHubJob | undefined {\n return state.result;\n },\n\n toString() {\n return JSON.stringify({ state });\n },\n };\n\n return poller;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"cancelScheduledNotification\";\n\n/**\n * Cancels the scheduled notification with the given notification ID.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param notificationId - The notification ID from the scheduled notification.\n * @param options - The operation options.\n * @returns A notification hub response with correlation ID and tracking ID.\n */\nexport function cancelScheduledNotification(\n context: NotificationHubsClientContext,\n notificationId: string,\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/schedulednotifications/${notificationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { Installation } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createOrUpdateInstallation\";\n\n/**\n * Creates or overwrites an installation to a Notification Hub.\n * @param context - The Notification Hubs client.\n * @param installation - The installation to create or overwrite.\n * @param options - Configuration options for the create or update installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function createOrUpdateInstallation(\n context: NotificationHubsClientContext,\n installation: Installation,\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installation.installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"PUT\", headers, updatedOptions);\n request.body = JSON.stringify(installation);\n\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AdmRegistrationDescription,\n AdmTemplateRegistrationDescription,\n AppleRegistrationDescription,\n AppleTemplateRegistrationDescription,\n BaiduRegistrationDescription,\n BaiduTemplateRegistrationDescription,\n BrowserRegistrationDescription,\n BrowserTemplateRegistrationDescription,\n GcmRegistrationDescription,\n GcmTemplateRegistrationDescription,\n FcmV1RegistrationDescription,\n FcmV1TemplateRegistrationDescription,\n MpnsRegistrationDescription,\n MpnsTemplateRegistrationDescription,\n RegistrationDescription,\n RegistrationDescriptionCommon,\n TemplateRegistrationDescription,\n XiaomiRegistrationDescription,\n XiaomiTemplateRegistrationDescription,\n WindowsRegistrationDescription,\n WindowsTemplateRegistrationDescription,\n} from \"../models/registration.js\";\nimport {\n getDateOrUndefined,\n getString,\n getStringOrUndefined,\n getTagsOrUndefined,\n isDefined,\n} from \"../utils/utils.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { serializeToAtomXmlRequest } from \"../utils/xmlUtils.js\";\n\n/**\n * Represents a registration description parser from the incoming XML.\n */\nexport interface RegistrationDescriptionParser {\n /**\n * @internal\n * Creates a registration type from the incoming entry.\n */\n parseRegistrationEntry: (bodyText: string) => Promise<RegistrationDescription>;\n /**\n * @internal\n * Creates a list of registrations from an incoming ATOM XML Feed.\n */\n parseRegistrationFeed: (bodyText: string) => Promise<RegistrationDescription[]>;\n /**\n * @internal\n * Creates an Amazon Device Messaging (ADM) registration description from the incoming parsed XML.\n */\n createAdmRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => AdmRegistrationDescription;\n /**\n * @internal\n * Creates an Amazon Device Messaging (ADM) template registration description from the incoming parsed XML.\n */\n createAdmTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => AdmTemplateRegistrationDescription;\n /**\n * @internal\n * Creates an Apple Platform Notification Services (APNs) registration description from the incoming parsed XML.\n */\n createAppleRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => AppleRegistrationDescription;\n /**\n * @internal\n * Creates an Apple Platform Notification Services (APNs) template registration description from the incoming parsed XML.\n */\n createAppleTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => AppleTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Baidu registration description from the incoming parsed XML.\n */\n createBaiduRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => BaiduRegistrationDescription;\n /**\n * @internal\n * Creates a Baidu template registration description from the incoming parsed XML.\n */\n createBaiduTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => BaiduTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Web Push registration description from the incoming parsed XML.\n */\n createBrowserRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => BrowserRegistrationDescription;\n /**\n * @internal\n * Creates a Web Push template registration description from the incoming parsed XML.\n */\n createBrowserTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => BrowserTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Firebase V1 Cloud Messaging (FCM) registration description from the incoming parsed XML.\n */\n createFcmV1RegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => FcmV1RegistrationDescription;\n /**\n * @internal\n * Creates a Firebase V1 Cloud Messaging (FCM) template registration description from the incoming parsed XML.\n */\n createFcmV1TemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => FcmV1TemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Google Cloud Messaging (GCM) registration description from the incoming parsed XML.\n */\n createGcmRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => GcmRegistrationDescription;\n /**\n * @internal\n * Creates a Google Cloud Messaging (GCM) template registration description from the incoming parsed XML.\n */\n createGcmTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => GcmTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Microsoft Phone Notification Services (MPNS) registration description from the incoming parsed XML.\n */\n createMpnsRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => MpnsRegistrationDescription;\n /**\n * @internal\n * Creates a Microsoft Phone Notification Services (MPNS) template registration description from the incoming parsed XML.\n */\n createMpnsTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => MpnsTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Xiaomi registration description from the incoming parsed XML.\n */\n createXiaomiRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => XiaomiRegistrationDescription;\n /**\n * @internal\n * Creates a Xiaomi template registration description from the incoming parsed XML.\n */\n createXiaomiTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => XiaomiTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Windows Notification Services (WNS) registration description from the incoming parsed XML.\n */\n createWindowsRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => WindowsRegistrationDescription;\n /**\n * @internal\n * Creates a Windows Notification Services (WNS) template registration description from the incoming parsed XML.\n */\n createWindowsTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => WindowsTemplateRegistrationDescription;\n}\n\nexport const registrationDescriptionParser: RegistrationDescriptionParser = {\n /**\n * @internal\n * Creates a registration type from the incoming entry.\n */\n async parseRegistrationEntry(bodyText: string): Promise<RegistrationDescription> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n delete xml.entry.content[\"$\"];\n const keyName = Object.keys(xml.entry.content)[0];\n const content = xml.entry.content[keyName];\n const methodName = `create${keyName}`;\n\n const method = this[methodName as keyof RegistrationDescriptionParser] as any;\n if (!methodName) {\n throw new RestError(`${keyName} is not a supported registration type`, { statusCode: 500 });\n }\n\n return method.call(this, content) as RegistrationDescription;\n },\n\n /**\n * @internal\n * Creates a list of registrations from an incoming ATOM XML Feed.\n */\n async parseRegistrationFeed(bodyText: string): Promise<RegistrationDescription[]> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const results: RegistrationDescription[] = [];\n if (!isDefined(xml.feed.entry)) {\n return results;\n }\n\n const entries = Array.isArray(xml.feed.entry) ? xml.feed.entry : [xml.feed.entry];\n\n for (const entry of entries) {\n delete entry.content[\"$\"];\n\n const keyName = Object.keys(entry.content)[0];\n const methodName = `create${keyName}`;\n const content = entry.content[keyName];\n const method = this[methodName as keyof RegistrationDescriptionParser] as any;\n if (!methodName) {\n throw new RestError(`${keyName} is not a supported registration type`, { statusCode: 500 });\n }\n\n results.push(method.call(this, content) as RegistrationDescription);\n }\n\n return results;\n },\n\n /**\n * @internal\n * Creates an ADM registration description from incoming XML property bag.\n */\n createAdmRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): AdmRegistrationDescription {\n return {\n admRegistrationId: getString(\n rawRegistrationDescription[\"AdmRegistrationId\"],\n \"admRegistrationId\",\n ),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Adm\",\n };\n },\n\n /**\n * @internal\n * Creates an ADM template registration description from incoming XML property bag.\n */\n createAdmTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): AdmTemplateRegistrationDescription {\n return {\n ...this.createAdmRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"AdmTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates an Apple registration description from incoming XML property bag.\n */\n createAppleRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): AppleRegistrationDescription {\n return {\n deviceToken: getString(rawRegistrationDescription[\"DeviceToken\"], \"deviceToken\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Apple\",\n };\n },\n\n /**\n * @internal\n * Creates an Apple template registration description from incoming XML property bag.\n */\n createAppleTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): AppleTemplateRegistrationDescription {\n return {\n priority: getStringOrUndefined(rawRegistrationDescription[\"Priority\"]) as \"10\" | \"5\",\n apnsHeaders: getHeadersOrUndefined(rawRegistrationDescription[\"ApnsHeaders\"]?.[\"ApnsHeader\"]),\n ...this.createAppleRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"AppleTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Baidu registration description from incoming XML property bag.\n */\n createBaiduRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): BaiduRegistrationDescription {\n return {\n baiduChannelId: getString(rawRegistrationDescription[\"BaiduChannelId\"], \"baiduChannelId\"),\n baiduUserId: getString(rawRegistrationDescription[\"BaiduUserId\"], \"baiduUserId\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Baidu\",\n };\n },\n\n /**\n * @internal\n * Creates a Baidu template registration description from incoming XML property bag.\n */\n createBaiduTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): BaiduTemplateRegistrationDescription {\n return {\n ...this.createBaiduRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"BaiduTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Browser registration description from incoming XML property bag.\n */\n createBrowserRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): BrowserRegistrationDescription {\n return {\n endpoint: getString(rawRegistrationDescription[\"Endpoint\"], \"endpoint\"),\n p256dh: getString(rawRegistrationDescription[\"P256DH\"], \"p256dh\"),\n auth: getString(rawRegistrationDescription[\"Auth\"], \"auth\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Browser\",\n };\n },\n\n /**\n * @internal\n * Creates a Browser template registration description from incoming XML property bag.\n */\n createBrowserTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): BrowserTemplateRegistrationDescription {\n return {\n ...this.createBrowserRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"BrowserTemplate\",\n };\n },\n /**\n * @internal\n * Creates an GCM registration description from incoming XML property bag.\n */\n createFcmV1RegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): FcmV1RegistrationDescription {\n return {\n fcmV1RegistrationId: getString(\n rawRegistrationDescription[\"FcmV1RegistrationId\"],\n \"fcmV1RegistrationId\",\n ),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"FcmV1\",\n };\n },\n\n /**\n * @internal\n * Creates an FCM template registration description from incoming XML property bag.\n */\n createFcmV1TemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): FcmV1TemplateRegistrationDescription {\n return {\n ...this.createFcmV1RegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"FcmV1Template\",\n };\n },\n\n /**\n * @internal\n * Creates an GCM registration description from incoming XML property bag.\n */\n createGcmRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): GcmRegistrationDescription {\n return {\n gcmRegistrationId: getString(\n rawRegistrationDescription[\"GcmRegistrationId\"],\n \"gcmRegistrationId\",\n ),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Gcm\",\n };\n },\n\n /**\n * @internal\n * Creates an FCM template registration description from incoming XML property bag.\n */\n createGcmTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): GcmTemplateRegistrationDescription {\n return {\n ...this.createGcmRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"GcmTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Windows Phone registration description from incoming XML property bag.\n */\n createMpnsRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): MpnsRegistrationDescription {\n return {\n channelUri: getString(rawRegistrationDescription[\"ChannelUri\"], \"channelUri\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Mpns\",\n };\n },\n\n /**\n * @internal\n * Creates a Windows Phone template registration description from incoming XML property bag.\n */\n createMpnsTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): MpnsTemplateRegistrationDescription {\n return {\n mpnsHeaders: getHeadersOrUndefined(rawRegistrationDescription[\"MpnsHeaders\"]?.[\"MpnsHeader\"]),\n ...this.createWindowsRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"MpnsTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Xiaomi registration description from incoming XML property bag.\n */\n createXiaomiRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): XiaomiRegistrationDescription {\n return {\n xiaomiRegistrationId: getString(\n rawRegistrationDescription[\"XiaomiRegistrationId\"],\n \"xiaomiRegistrationId\",\n ),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Xiaomi\",\n };\n },\n\n /**\n * @internal\n * Creates a Xiaomi template registration description from incoming XML property bag.\n */\n createXiaomiTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): XiaomiTemplateRegistrationDescription {\n return {\n ...this.createXiaomiRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"XiaomiTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Windows registration description from incoming XML property bag.\n */\n createWindowsRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): WindowsRegistrationDescription {\n return {\n channelUri: getString(rawRegistrationDescription[\"ChannelUri\"], \"channelUri\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Windows\",\n };\n },\n\n /**\n * @internal\n * Creates a Windows template registration description from incoming XML property bag.\n */\n createWindowsTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): WindowsTemplateRegistrationDescription {\n return {\n wnsHeaders: getHeadersOrUndefined(rawRegistrationDescription[\"WnsHeaders\"]?.[\"WnsHeader\"]),\n ...this.createWindowsRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"WindowsTemplate\",\n };\n },\n};\n\nfunction getHeadersOrUndefined(\n value?: { Header: string; Value: string }[],\n): Record<string, string> | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n\n const headerObj: Record<string, string> = {};\n for (const { Header, Value } of value) {\n headerObj[Header] = Value;\n }\n\n return headerObj;\n}\n\nfunction createRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n): Omit<RegistrationDescriptionCommon, \"kind\"> {\n let pushVariables: Record<string, string> | undefined;\n const unparsed = getStringOrUndefined(rawRegistrationDescription[\"PushVariables\"]);\n if (unparsed) {\n pushVariables = JSON.parse(unparsed) as Record<string, string>;\n }\n\n return {\n registrationId: getStringOrUndefined(rawRegistrationDescription[\"RegistrationId\"]),\n expirationTime: getDateOrUndefined(rawRegistrationDescription[\"ExpirationTime\"]),\n etag: getStringOrUndefined(rawRegistrationDescription[\"ETag\"]),\n tags: getTagsOrUndefined(rawRegistrationDescription[\"Tags\"]),\n pushVariables: pushVariables,\n };\n}\n\nfunction createTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n): TemplateRegistrationDescription {\n return {\n bodyTemplate: getString(rawRegistrationDescription[\"BodyTemplate\"], \"bodyTemplate\"),\n templateName: getStringOrUndefined(rawRegistrationDescription[\"TemplateName\"]),\n ...createRegistrationDescription(rawRegistrationDescription),\n };\n}\n\n/**\n * @internal\n * Represents a serializer for all registration descriptions.\n */\nexport interface RegistrationDescriptionSerializer {\n /**\n * @internal\n * Serializes a registration description into an ATOM XML string.\n */\n serializeRegistrationDescription(description: RegistrationDescription): string;\n /**\n * @internal\n * Serializes an Amazon Device Messaging (ADM) registration description into an XML object for serialization.\n */\n serializeAdmRegistrationDescription(\n description: Omit<AdmRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes an Amazon Device Messaging (ADM) template registration description into an XML object for serialization.\n */\n serializeAdmTemplateRegistrationDescription(\n description: Omit<AdmTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes an Apple registration description into an XML object for serialization.\n */\n serializeAppleRegistrationDescription(\n description: Omit<AppleRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes an Apple template registration description into an XML object for serialization.\n */\n serializeAppleTemplateRegistrationDescription(\n description: Omit<AppleRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Baidu registration description into an XML object for serialization.\n */\n serializeBaiduRegistrationDescription(\n description: Omit<BaiduRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Baidu template registration description into an XML object for serialization.\n */\n serializeBaiduTemplateRegistrationDescription(\n description: Omit<BaiduTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Web Push registration description into an XML object for serialization.\n */\n serializeBrowserRegistrationDescription(\n description: Omit<BrowserRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Web Push template registration description into an XML object for serialization.\n */\n serializeBrowserTemplateRegistrationDescription(\n description: Omit<BrowserTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Google Cloud Messaging (GCM) registration description into an XML object for serialization.\n */\n serializeFcmV1RegistrationDescription(\n description: Omit<FcmV1RegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Google Cloud Messaging (GCM) template registration description into an XML object for serialization.\n */\n serializeFcmV1TemplateRegistrationDescription(\n description: Omit<FcmV1TemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Google Cloud Messaging (GCM) registration description into an XML object for serialization.\n */\n serializeGcmRegistrationDescription(\n description: Omit<GcmRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Google Cloud Messaging (GCM) template registration description into an XML object for serialization.\n */\n serializeGcmTemplateRegistrationDescription(\n description: Omit<GcmTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Windows Phone registration description into an XML object for serialization.\n */\n serializeMpnsRegistrationDescription(\n description: Omit<MpnsRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Windows Phone template registration description into an XML object for serialization.\n */\n serializeMpnsTemplateRegistrationDescription(\n description: Omit<MpnsTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Xiaomi registration description into an XML object for serialization.\n */\n serializeXiaomiRegistrationDescription(\n description: Omit<XiaomiRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Xiaomi template registration description into an XML object for serialization.\n */\n serializeXiaomiTemplateRegistrationDescription(\n description: Omit<XiaomiTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Windows Notification Services (WNS) registration description into an XML object for serialization.\n */\n serializeWindowsRegistrationDescription(\n description: Omit<WindowsRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Windows Notification Services (WNS) template registration description into an XML object for serialization.\n */\n serializeWindowsTemplateRegistrationDescription(\n description: Omit<WindowsTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n}\n\n/**\n * Represents a RegistrationDescription serializer.\n */\nexport const registrationDescriptionSerializer: RegistrationDescriptionSerializer = {\n serializeRegistrationDescription(description: RegistrationDescription): string {\n const rootName = `${description.kind}RegistrationDescription`;\n const methodName = `serialize${rootName}`;\n\n const method = this[methodName as keyof RegistrationDescriptionSerializer].bind(this) as (\n description: RegistrationDescription,\n ) => Record<string, any>;\n if (!isDefined(method)) {\n throw new RestError(`Undefined platform ${description.kind}`, { statusCode: 400 });\n }\n\n const registration = method(description) as Record<string, any>;\n const requestObject = serializeToAtomXmlRequest(rootName, registration);\n\n return stringifyXML(requestObject, { rootName: \"entry\" });\n },\n\n /**\n * @internal\n * Serializes an existing ADM registration description to an object for serialization.\n */\n serializeAdmRegistrationDescription(\n description: Omit<AdmRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n AdmRegistrationId: getString(description.admRegistrationId, \"admRegistrationId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing ADM template registration description to an object for serialization.\n */\n serializeAdmTemplateRegistrationDescription(\n description: Omit<AdmTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeAdmRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Apple registration description to an object for serialization.\n */\n serializeAppleRegistrationDescription(\n description: Omit<AppleRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n DeviceToken: getString(description.deviceToken, \"deviceToken\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Apple template registration description to an object for serialization.\n */\n serializeAppleTemplateRegistrationDescription(\n description: AppleTemplateRegistrationDescription,\n ): Record<string, any> {\n let apnsHeaders: Record<string, any> | undefined;\n if (description.apnsHeaders) {\n apnsHeaders = {\n ApnsHeader: [],\n };\n\n for (const header of Object.keys(description.apnsHeaders)) {\n apnsHeaders[\"ApnsHeader\"].push({\n Header: header,\n Value: description.apnsHeaders[header],\n });\n }\n }\n\n return {\n ...this.serializeAppleRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n Expiry: getStringOrUndefined(description.expiry),\n ApnsHeaders: apnsHeaders,\n };\n },\n\n /**\n * @internal\n * Serializes an existing Baidu registration description to an object for serialization.\n */\n serializeBaiduRegistrationDescription(\n description: Omit<BaiduRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n BaiduChannelId: getString(description.baiduChannelId, \"baiduChannelId\"),\n BaiduUserId: getString(description.baiduUserId, \"baiduUserId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Baidu template registration description to an object for serialization.\n */\n serializeBaiduTemplateRegistrationDescription(\n description: Omit<BaiduTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeBaiduRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Browser registration description to an object for serialization.\n */\n serializeBrowserRegistrationDescription(\n description: Omit<BrowserRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n Endpoint: description.endpoint,\n Auth: description.auth,\n P256DH: description.p256dh,\n };\n },\n\n /**\n * @internal\n * Serializes an existing Browser template registration description to an object for serialization.\n */\n serializeBrowserTemplateRegistrationDescription(\n description: Omit<BrowserTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeBrowserRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing FCM V1 registration description to an object for serialization.\n */\n serializeFcmV1RegistrationDescription(\n description: Omit<FcmV1RegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n FcmV1RegistrationId: getString(description.fcmV1RegistrationId, \"fcmRegistrationId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing FCM V1 template registration description to an object for serialization.\n */\n serializeFcmV1TemplateRegistrationDescription(\n description: Omit<FcmV1TemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeFcmV1RegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing GCM registration description to an object for serialization.\n */\n serializeGcmRegistrationDescription(\n description: Omit<GcmRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n GcmRegistrationId: getString(description.gcmRegistrationId, \"gcmRegistrationId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing GCM template registration description to an object for serialization.\n */\n serializeGcmTemplateRegistrationDescription(\n description: Omit<GcmTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeGcmRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * @deprecated Windows Phone is no longer supported.\n * Serializes an existing MPNS registration description to an object for serialization.\n */\n serializeMpnsRegistrationDescription(\n description: Omit<MpnsRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n ChannelUri: description.channelUri,\n };\n },\n\n /**\n * @internal\n * @deprecated Windows Phone is no longer supported.\n * Serializes an existing MPNS template registration description to an object for serialization.\n */\n serializeMpnsTemplateRegistrationDescription(\n description: Omit<MpnsTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n let mpnsHeaders: Record<string, any> | undefined;\n if (description.mpnsHeaders) {\n mpnsHeaders = {\n MpnsHeader: [],\n };\n\n for (const header of Object.keys(description.mpnsHeaders)) {\n mpnsHeaders[\"MpnsHeader\"].push({\n Header: header,\n Value: description.mpnsHeaders[header],\n });\n }\n }\n\n return {\n ...this.serializeMpnsRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n MpnsHeaders: mpnsHeaders,\n };\n },\n\n /**\n * @internal\n * Serializes an existing Xiaomi registration description to an object for serialization.\n */\n serializeXiaomiRegistrationDescription(\n description: Omit<XiaomiRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n XiaomiRegistrationId: getString(description.xiaomiRegistrationId, \"xiaomiRegistrationId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Xiaomi template registration description to an object for serialization.\n */\n serializeXiaomiTemplateRegistrationDescription(\n description: Omit<XiaomiTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeXiaomiRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Windows registration description to an object for serialization.\n */\n serializeWindowsRegistrationDescription(\n description: Omit<WindowsRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n ChannelUri: description.channelUri,\n };\n },\n\n /**\n * @internal\n * Serializes an existing Windows template registration description to an object for serialization.\n */\n serializeWindowsTemplateRegistrationDescription(\n description: Omit<WindowsTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n let wnsHeaders: Record<string, any> | undefined;\n if (description.wnsHeaders) {\n wnsHeaders = {\n WnsHeader: [],\n };\n\n for (const header of Object.keys(description.wnsHeaders)) {\n wnsHeaders[\"WnsHeader\"].push({\n Header: header,\n Value: description.wnsHeaders[header],\n });\n }\n }\n\n return {\n ...this.serializeWindowsRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n WnsHeaders: wnsHeaders,\n };\n },\n};\n\nfunction serializeRegistrationDescription(\n description: Omit<RegistrationDescriptionCommon, \"kind\">,\n): Record<string, any> {\n let tags: string | undefined;\n if (description.tags) {\n tags = description.tags.join(\",\");\n }\n\n let pushVariables: string | undefined;\n if (description.pushVariables) {\n pushVariables = JSON.stringify(description.pushVariables);\n }\n\n return {\n RegistrationId: getStringOrUndefined(description.registrationId),\n Tags: tags,\n PushVariables: pushVariables,\n };\n}\n\nfunction serializeTemplateRegistrationDescription(\n description: TemplateRegistrationDescription,\n): Record<string, any> {\n return {\n BodyTemplate: { __cdata: description.bodyTemplate },\n TemplateName: getStringOrUndefined(description.templateName),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./_client.js\";\nimport {\n registrationDescriptionParser,\n registrationDescriptionSerializer,\n} from \"../../serializers/registrationSerializer.js\";\nimport { HttpMethods } from \"@azure/core-rest-pipeline\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../../models/registration.js\";\nimport { isDefined } from \"../../utils/utils.js\";\n\n/**\n * @internal\n */\nexport async function createOrUpdateRegistrationDescription(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n operationName: \"create\" | \"createOrUpdate\" | \"update\",\n options: OperationOptions,\n): Promise<RegistrationDescription> {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrations\";\n let httpMethod: HttpMethods = \"POST\";\n\n if (operationName === \"createOrUpdate\" || operationName === \"update\") {\n endpoint.pathname += `/${registration.registrationId}`;\n httpMethod = \"PUT\";\n }\n\n const etag = registration.etag;\n\n // Clear out readonly properties\n registration.registrationId = undefined;\n registration.etag = undefined;\n\n const headers = await context.createHeaders(`${operationName}Registration`);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n if (operationName === \"update\") {\n headers.set(\"If-Match\", isDefined(etag) ? `\"${etag}\"` : \"*\");\n }\n\n const request = createRequest(endpoint, httpMethod, headers, options);\n request.body = registrationDescriptionSerializer.serializeRegistrationDescription(registration);\n const response = await sendRequest(context, request, [200, 201]);\n\n return registrationDescriptionParser.parseRegistrationEntry(response.bodyAsText!);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createOrUpdateRegistration\";\n\n/**\n * Creates or updates a registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\nexport function createOrUpdateRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n return createOrUpdateRegistrationDescription(\n context,\n registration,\n \"createOrUpdate\",\n updatedOptions,\n );\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createRegistrationId\";\n\n/**\n * Creates a new registration ID.\n * @param context - The Notification Hubs client.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\nexport function createRegistrationId(\n context: NotificationHubsClientContext,\n options: OperationOptions = {},\n): Promise<string> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrationIDs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n const response = await sendRequest(context, request, 201);\n\n // In the form: https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/<registrationId>\n const locationHeader = response.headers.get(\"Location\");\n if (!locationHeader || !locationHeader.startsWith(\"https://\")) {\n throw new RestError(`Location header ${locationHeader} is an invalid URL`, {\n statusCode: 500,\n request,\n response,\n });\n }\n const locationUrl = new URL(locationHeader!);\n const registrationId = locationUrl.pathname.split(\"/\")[3];\n\n return registrationId;\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createRegistration\";\n\n/**\n * Creates a new registration. This method generates a registration ID,\n * which you can subsequently use to retrieve, update, and delete this registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\nexport function createRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n if (registration.registrationId) {\n throw new RestError(\"registrationId must not be set during a create operation\", {\n statusCode: 400,\n });\n }\n\n return createOrUpdateRegistrationDescription(context, registration, \"create\", updatedOptions);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"deleteInstallation\";\n\n/**\n * Deletes an installation from a Notification Hub.\n * @param context - The Notification Hubs client.\n * @param installationId - The installation ID of the installation to delete.\n * @param options - Configuration options for the installation delete operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function deleteInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n const response = await sendRequest(context, request, 204);\n\n return parseNotificationResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { EntityOperationOptions } from \"../models/options.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { isDefined } from \"../utils/utils.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"deleteRegistration\";\n\n/**\n * Deletes a registration with the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The registration ID of the registration to delete.\n * @param options - The options for delete operations including the ETag\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function deleteRegistration(\n context: NotificationHubsClientContext,\n registrationId: string,\n options: EntityOperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/registrations/${registrationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n headers.set(\"If-Match\", isDefined(options.etag) ? `\"${options.etag}\"` : \"*\");\n\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getFeedbackContainerUrl\";\n\n/**\n * Retrieves an Azure Storage container URL. The container has feedback data for the notification hub.\n * The caller can then use the Azure Storage Services SDK to retrieve the contents of the container.\n * @param context - The Notification Hubs client.\n * @param options - The options for getting the push notification feedback container URL.\n * @returns The URL of the Azure Storage Container containing the feedback data.\n */\nexport function getFeedbackContainerUrl(\n context: NotificationHubsClientContext,\n options: OperationOptions = {},\n): Promise<string> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/feedbackcontainer\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return response.bodyAsText!;\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { Installation } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getInstallation\";\n\n/**\n * Gets an Azure Notification Hub installation by the installation ID.\n * @param context - The Notification Hubs client.\n * @param installationId - The ID of the installation to get.\n * @param options - Configuration options for the get installation operation.\n * @returns The installation that matches the installation ID.\n */\nexport function getInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n options: OperationOptions = {},\n): Promise<Installation> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return JSON.parse(response.bodyAsText!) as Installation;\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n fcmOutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationDetails } from \"../models/notificationDetails.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { parseNotificationDetails } from \"../serializers/notificationDetailsSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getNotificationOutcomeDetails\";\n\n/**\n * Retrieves the results of a send operation. This can retrieve intermediate results if the send is being processed\n * or final results if the Send* has completed. This API can only be called for Standard SKU and above.\n * @param context - The Notification Hubs client.\n * @param notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\nexport function getNotificationOutcomeDetails(\n context: NotificationHubsClientContext,\n notificationId: string,\n options: OperationOptions = {},\n): Promise<NotificationDetails> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/messages/${notificationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationDetails(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getRegistration\";\n\n/**\n * Gets a registration by the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The ID of the registration to get.\n * @param options - The options for getting a registration by ID.\n * @returns A RegistrationDescription that has the given registration ID.\n */\nexport function getRegistration(\n context: NotificationHubsClientContext,\n registrationId: string,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/registrations/${registrationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return registrationDescriptionParser.parseRegistrationEntry(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { parseNotificationHubJobFeed } from \"../serializers/notificationHubJobSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listNotificationHubJobs\";\n\n/**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param context - The Notification Hubs client.xs\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\nexport function listNotificationHubJobs(\n context: NotificationHubsClientContext,\n options: OperationOptions = {},\n): Promise<NotificationHubJob[]> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/jobs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationHubJobFeed(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./_client.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { RegistrationDescription } from \"../../models/registration.js\";\nimport { RegistrationQueryOptions } from \"../../models/options.js\";\nimport { RegistrationQueryResponse } from \"../../models/response.js\";\nimport { registrationDescriptionParser } from \"../../serializers/registrationSerializer.js\";\n\nexport async function* listRegistrationsAll(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationPagingPage(context, options)) {\n yield* page;\n }\n}\n\nexport async function* listRegistrationPagingPage(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrations(context, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrations(context, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrations(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n continuationToken?: string,\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrations\";\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (options.filter !== undefined) {\n endpoint.searchParams.set(\"$filter\", options.filter);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(\"listRegistrations\");\n const request = createRequest(endpoint, \"GET\", headers, options);\n const response = await sendRequest(context, request, 200);\n\n const registrations = await registrationDescriptionParser.parseRegistrationFeed(\n response.bodyAsText!,\n );\n const nextToken = response.headers.get(\"x-ms-continuationtoken\");\n return {\n registrations,\n continuationToken: nextToken,\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RegistrationDescription, RegistrationChannel } from \"../models/registration.js\";\nimport { listRegistrationPagingPage, listRegistrationsAll } from \"./internal/_listRegistrations.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param context - The Notification Hubs client.\n * @param channel - The Registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\nexport function listRegistrationsByChannel(\n context: NotificationHubsClientContext,\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const newOptions = {\n ...options,\n filter: getFilterByChannel(channel),\n };\n const { span, updatedOptions } = tracingClient.startSpan(\n \"NotificationHubsClientContext.listRegistrationsByDevice\",\n newOptions,\n );\n try {\n const iter = listRegistrationsAll(context, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationPagingPage(context, updatedOptions);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n\nfunction getFilterByChannel(device: RegistrationChannel): string {\n switch (device.kind) {\n case \"adm\":\n return `AdmRegistrationId eq '${device.admRegistrationId}'`;\n case \"apple\":\n return `DeviceToken eq '${device.deviceToken.toLocaleUpperCase()}'`;\n case \"baidu\":\n return `BaiduChannelId eq ${device.baiduChannelId}' and BaiduUserId eq '${device.baiduUserId}'`;\n case \"browser\":\n return `Endpoint eq '${encodeURIComponent(device.endpoint)}' and P256DH eq '${\n device.p256dh\n }' and Auth eq '${device.auth}'`;\n case \"gcm\":\n return `GcmRegistrationId eq '${device.gcmRegistrationId}'`;\n case \"windows\":\n return `ChannelUri eq '${encodeURIComponent(device.channelUri)}'`;\n default:\n throw new RestError(`Device type is unsupported`, {\n statusCode: 400,\n });\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { RegistrationQueryResponse } from \"../models/response.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listRegistrationsByTag\";\n\n/**\n * Lists all registrations with the matching tag.\n * @param context - The Notification Hubs client.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\nexport function listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const { span, updatedOptions } = tracingClient.startSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n );\n try {\n const iter = listRegistrationsByTagAll(context, tag, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationsByTagPagingPage(context, tag, options);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n\nasync function* listRegistrationsByTagAll(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationsByTagPagingPage(context, tag, options)) {\n yield* page;\n }\n}\n\nasync function* listRegistrationsByTagPagingPage(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrationsByTag(context, tag, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrationsByTag(context, tag, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n continuationToken?: string,\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/tags/${tag}/registrations`;\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, options);\n const response = await sendRequest(context, request, 200);\n\n const registrations = await registrationDescriptionParser.parseRegistrationFeed(\n response.bodyAsText!,\n );\n const nextToken = response.headers.get(\"x-ms-continuationtoken\");\n return {\n registrations,\n continuationToken: nextToken,\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\nimport { listRegistrationPagingPage, listRegistrationsAll } from \"./internal/_listRegistrations.js\";\n\n/**\n * Gets all registrations for the notification hub with the given query options.\n * @param context - The Notification Hubs client.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\nexport function listRegistrations(\n context: NotificationHubsClientContext,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"NotificationHubsClientContext.listRegistrations\",\n options,\n );\n try {\n const iter = listRegistrationsAll(context, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationPagingPage(context, updatedOptions);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport { NonNullableRecord } from \"../utils/utils.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { ScheduleNotificationOptions } from \"../models/options.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleNotification(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions = {},\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.scheduleNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/schedulednotifications/\";\n\n const headers = await context.createHeaders(\n \"scheduleNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-ScheduleTime\", scheduledTime.toISOString());\n headers.set(\"Content-Type\", notification.contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n if (options.tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = notification.body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DirectSendNotificationOptions, SendNotificationOptions } from \"../models/options.js\";\nimport { objectHasProperty } from \"@azure/core-util\";\n\n/**\n * Determines whether the options are of type SendNotificationOptions.\n * @param options - The options to test if SendNotificationOptions.\n * @returns true if SendNotificationOptions otherwise false.\n */\nexport function isSendNotificationOptions(options: unknown): options is SendNotificationOptions {\n return (\n objectHasProperty(options, \"tagExpression\") || objectHasProperty(options, \"enableTestSend\")\n );\n}\n\n/**\n * Determines whether the options are of type DirectSendNotificationOptions.\n * @param options - The options to test if DirectSendNotificationOptions.\n * @returns true if DirectSendNotificationOptions otherwise false.\n */\nexport function isDirectSendNotificationOptions(\n options: unknown,\n): options is DirectSendNotificationOptions {\n return objectHasProperty(options, \"deviceHandle\");\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Notification } from \"../models/notification.js\";\n\n/**\n * @internal\n */\nexport function createMultipartDirectNotification(\n boundaryName: string,\n notification: Notification,\n deviceHandles: string[],\n): string {\n return (\n `--${boundaryName}\\r\\n` +\n `Content-type: ${notification.contentType}\\r\\n` +\n \"Content-Disposition: inline; name=notification\\r\\n\\r\\n\" +\n notification.body +\n \"\\r\\n\" +\n `--${boundaryName}\\r\\n` +\n \"Content-type: application/json\\r\\n\" +\n \"Content-Disposition: inline; name=devices\\r\\n\\r\\n\" +\n JSON.stringify(deviceHandles) +\n \"\\r\\n\" +\n `--${boundaryName}--`\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DirectSendNotificationOptions, SendNotificationOptions } from \"../models/options.js\";\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport {\n isDirectSendNotificationOptions,\n isSendNotificationOptions,\n} from \"../utils/optionUtils.js\";\nimport { BrowserPushChannel } from \"../models/installation.js\";\nimport { NonNullableRecord } from \"../utils/utils.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { createMultipartDirectNotification } from \"../utils/notificationUtils.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param context - The Notification Hubs client.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendNotification(\n context: NotificationHubsClientContext,\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions = { enableTestSend: false },\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.sendNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/messages/\";\n\n // Check if batch direct send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.pathname += \"$batch\";\n }\n\n // Check for test send\n if (isSendNotificationOptions(options) && options.enableTestSend) {\n endpoint.searchParams.append(\"test\", \"true\");\n }\n\n const headers = await context.createHeaders(\n \"sendNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n let body = notification.body;\n let contentType: string = notification.contentType;\n\n // Check for direct batch send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n const boundary = `nh-boundary-${randomUUID()}`;\n contentType = `multipart/mixed; boundary = \"${boundary}\"`;\n body = createMultipartDirectNotification(boundary, notification, options.deviceHandle);\n } else if (isDirectSendNotificationOptions(options)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n\n if (notification.platform === \"browser\") {\n const browserHandle = options.deviceHandle as BrowserPushChannel;\n headers.set(\"ServiceBusNotification-DeviceHandle\", browserHandle.endpoint);\n headers.set(\"Auth\", browserHandle.auth);\n headers.set(\"P256DH\", browserHandle.p256dh);\n } else {\n headers.set(\"ServiceBusNotification-DeviceHandle\", options.deviceHandle as string);\n }\n } else if (isSendNotificationOptions(options)) {\n if (options.tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n }\n\n headers.set(\"Content-Type\", contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { JsonPatch } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"updateInstallation\";\n\n/**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param context - The Notification Hubs client.\n * @param installationId - The ID of the installation to update.\n * @param installationPatches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function updateInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n installationPatches: JsonPatch[],\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"PATCH\", headers, updatedOptions);\n request.body = JSON.stringify(installationPatches);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"updateRegistration\";\n\n/**\n * Updates an existing registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\nexport function updateRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n if (!registration.etag) {\n throw new RestError(\"ETag is required for registration update\", { statusCode: 400 });\n }\n return createOrUpdateRegistrationDescription(context, registration, \"update\", updatedOptions);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DirectSendNotificationOptions,\n EntityOperationOptions,\n NotificationHubsClientOptions,\n PolledOperationOptions,\n RegistrationQueryLimitOptions,\n ScheduleNotificationOptions,\n SendNotificationOptions,\n} from \"./models/options.js\";\nimport { Installation, JsonPatch } from \"./models/installation.js\";\nimport {\n NotificationDetails,\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"./models/notificationDetails.js\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"./models/notificationHubJob.js\";\nimport { NotificationHubsClientContext, createClientContext } from \"./api/clientContext.js\";\nimport { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport { Notification } from \"./models/notification.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { beginSubmitNotificationHubJob as beginSubmitNotificationHubJobMethod } from \"./api/beginSubmitNotificationHubJob.js\";\nimport { cancelScheduledNotification as cancelScheduledNotificationMethod } from \"./api/cancelScheduledNotification.js\";\nimport { createOrUpdateInstallation as createOrUpdateInstallationMethod } from \"./api/createOrUpdateInstallation.js\";\nimport { createOrUpdateRegistration as createOrUpdateRegistrationMethod } from \"./api/createOrUpdateRegistration.js\";\nimport { createRegistrationId as createRegistrationIdMethod } from \"./api/createRegistrationId.js\";\nimport { createRegistration as createRegistrationMethod } from \"./api/createRegistration.js\";\nimport { deleteInstallation as deleteInstallationMethod } from \"./api/deleteInstallation.js\";\nimport { deleteRegistration } from \"./api/deleteRegistration.js\";\nimport { getFeedbackContainerUrl as getFeedbackContainerUrlMethod } from \"./api/getFeedbackContainerUrl.js\";\nimport { getInstallation as getInstallationMethod } from \"./api/getInstallation.js\";\nimport { getNotificationHubJob as getNotificationHubJobMethod } from \"./api/getNotificationHubJob.js\";\nimport { getNotificationOutcomeDetails as getNotificationOutcomeDetailsMethod } from \"./api/getNotificationOutcomeDetails.js\";\nimport { getRegistration as getRegistrationMethod } from \"./api/getRegistration.js\";\nimport { listNotificationHubJobs as listNotificationHubJobsMethod } from \"./api/listNotificationHubJobs.js\";\nimport { listRegistrationsByChannel as listRegistrationsByChannelMethod } from \"./api/listRegistrationsByChannel.js\";\nimport { listRegistrationsByTag as listRegistrationsByTagMethod } from \"./api/listRegistrationsByTag.js\";\nimport { listRegistrations as listRegistrationsMethod } from \"./api/listRegistrations.js\";\nimport { scheduleNotification as scheduleNotificationMethod } from \"./api/scheduleNotification.js\";\nimport { sendNotification as sendNotificationMethod } from \"./api/sendNotification.js\";\nimport { submitNotificationHubJob as submitNotificationHubJobMethod } from \"./api/submitNotificationHubJob.js\";\nimport { updateInstallation as updateInstallationMethod } from \"./api/updateInstallation.js\";\nimport { updateRegistration as updateRegistrationMethod } from \"./api/updateRegistration.js\";\n\n/**\n * This represents a client for Azure Notification Hubs to manage installations and send\n * messages to devices.\n */\nexport class NotificationHubsClient {\n private _client: NotificationHubsClientContext;\n\n /**\n * Creates a new instance of the NotificationClient with a connection string, hub name and options.\n * @param connectionString - The Notification Hub Access Policy connection string.\n * @param hubName - The name of the Azure Notification Hub.\n * @param options - Options for configuring the Azure Notification Hubs client.\n */\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this._client = createClientContext(connectionString, hubName, options);\n }\n\n /**\n * Creates or overwrites an installation to a Notification Hub.\n * @param installation - The installation to create or overwrite.\n * @param options - Configuration options for the create or update installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n createOrUpdateInstallation(\n installation: Installation,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return createOrUpdateInstallationMethod(this._client, installation, options);\n }\n\n /**\n * Deletes an installation from a Notification Hub.\n * @param installationId - The installation ID of the installation to delete.\n * @param options - Configuration options for the installation delete operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n deleteInstallation(\n installationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Gets an Azure Notification Hub installation by the installation ID.\n * @param installationId - The ID of the installation to get.\n * @param options - Configuration options for the get installation operation.\n * @returns The installation that matches the installation ID.\n */\n getInstallation(installationId: string, options: OperationOptions = {}): Promise<Installation> {\n return getInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param installationId - The ID of the installation to update.\n * @param patches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n updateInstallation(\n installationId: string,\n patches: JsonPatch[],\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return updateInstallationMethod(this._client, installationId, patches, options);\n }\n\n /**\n * Creates a new registration ID.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\n createRegistrationId(options: OperationOptions = {}): Promise<string> {\n return createRegistrationIdMethod(this._client, options);\n }\n\n /**\n * Creates a new registration. This method generates a registration ID,\n * which you can subsequently use to retrieve, update, and delete this registration.\n * @param registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\n createRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Creates or updates a registration.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\n createOrUpdateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createOrUpdateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Updates an existing registration.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\n updateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return updateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Deletes a registration with the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The registration ID of the registration to delete.\n * @param options - The options for delete operations including the ETag\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n deleteRegistration(\n registrationId: string,\n options: EntityOperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteRegistration(this._client, registrationId, options);\n }\n\n /**\n * Gets a registration by the given registration ID.\n * @param registrationId - The ID of the registration to get.\n * @param options - The options for getting a registration by ID.\n * @returns A RegistrationDescription that has the given registration ID.\n */\n getRegistration(\n registrationId: string,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return getRegistrationMethod(this._client, registrationId, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given query options.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrations(\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsMethod(this._client, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param channel - The registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrationsByChannel(\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByChannelMethod(this._client, channel, options);\n }\n\n /**\n * Lists all registrations with the matching tag.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\n listRegistrationsByTag(\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByTagMethod(this._client, tag, options);\n }\n\n /**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendNotification(\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions = { enableTestSend: false },\n ): Promise<NotificationHubsMessageResponse> {\n return sendNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleNotification(\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Cancels the scheduled notification with the given notification ID.\n * @param notificationId - The notification ID from the scheduled notification.\n * @param options - The operation options.\n * @returns A notification hub response with correlation ID and tracking ID.\n */\n cancelScheduledNotification(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return cancelScheduledNotificationMethod(this._client, notificationId, options);\n }\n\n /**\n * Retrieves an Azure Storage container URL. The container has feedback data for the notification hub.\n * The caller can then use the Azure Storage Services SDK to retrieve the contents of the container.\n * @param options - The options for getting the push notification feedback container URL.\n * @returns The URL of the Azure Storage Container containing the feedback data.\n */\n getFeedbackContainerUrl(options: OperationOptions = {}): Promise<string> {\n return getFeedbackContainerUrlMethod(this._client, options);\n }\n\n /**\n * Retrieves the results of a send operation. This can retrieve intermediate results if the send is being processed\n * or final results if the Send* has completed. This API can only be called for Standard SKU and above.\n * @param notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\n getNotificationOutcomeDetails(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationDetails> {\n return getNotificationOutcomeDetailsMethod(this._client, notificationId, options);\n }\n\n /**\n * Gets a Notification Hub Job by the ID.\n * @param jobId - The Notification Hub Job ID.\n * @param options - The operation options.\n * @returns The Notification Hub Job with the matching ID.\n */\n getNotificationHubJob(\n jobId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return getNotificationHubJobMethod(this._client, jobId, options);\n }\n\n /**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\n beginSubmitNotificationHubJob(\n notificationHubJob: NotificationHubJob,\n options: PolledOperationOptions = {},\n ): Promise<NotificationHubJobPoller> {\n return beginSubmitNotificationHubJobMethod(this._client, notificationHubJob, options);\n }\n\n /**\n * Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\n submitNotificationHubJob(\n job: NotificationHubJob,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return submitNotificationHubJobMethod(this._client, job, options);\n }\n\n /**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\n listNotificationHubJobs(options: OperationOptions = {}): Promise<NotificationHubJob[]> {\n return listNotificationHubJobsMethod(this._client, options);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as Constants from \"../utils/constants.js\";\nimport {\n AdmNativeMessage,\n AppleNativeMessage,\n FirebaseLegacyNativeMessage,\n FirebaseV1NativeMessage,\n} from \"./notificationBodyBuilder.js\";\nimport { AppleHeaders, WindowsHeaders } from \"./notificationHeaderBuilder.js\";\n\nfunction isString(value: unknown): value is string {\n return typeof value === \"string\" || value instanceof String;\n}\n\n/**\n * Represents a notification that can be sent to a device.\n */\nexport interface NotificationCommon {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Represents a JSON notification hub.\n */\nexport interface JsonNotification extends NotificationCommon {\n /**\n * The content type for the push notification.\n */\n contentType: \"application/json;charset=utf-8\";\n}\n\n/**\n * Represents an Apple APNs push notification.\n */\nexport interface AppleNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"apple\";\n}\n\n/**\n * Represents an Apple notification that can be sent to a device.\n */\nexport interface AppleNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AppleNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: AppleHeaders;\n}\n\n/**\n * Creates a notification to send to an Apple device.\n * @param notification - A partial message used to create a message for Apple.\n * @returns A newly created Apple.\n */\nexport function createAppleNotification(notification: AppleNotificationParams): AppleNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"apple\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) push notification.\n */\nexport interface AdmNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"adm\";\n}\n\n/**\n * Represents an ADM notification that can be sent to a device.\n */\nexport interface AdmNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AdmNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to an Amazon Device Messaging device.\n * @param notification - A partial message used to create a message for Amazon Device Messaging.\n * @returns A newly created Amazon Device Messaging.\n */\nexport function createAdmNotification(notification: AdmNotificationParams): AdmNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"adm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Baidu push notification.\n */\nexport interface BaiduNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a notification to send to a Baidu registered device.\n * @param notification - A partial message used to create a message for Baidu.\n * @returns A newly created Baidu.\n */\nexport function createBaiduNotification(notification: NotificationCommon): BaiduNotification {\n return {\n ...notification,\n platform: \"baidu\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Browser push notification.\n */\nexport interface BrowserNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a notification to send to a browser.\n * @param notification - A partial message used to create a message for a browser.\n * @returns A newly created Web Push browser.\n */\nexport function createBrowserNotification(notification: NotificationCommon): BrowserNotification {\n return {\n ...notification,\n platform: \"browser\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Firebase legacy HTTP push notification.\n */\nexport interface FcmLegacyNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"gcm\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmLegacyNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseLegacyNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmLegacyNotification(\n notification: FcmLegacyNotificationParams,\n): FcmLegacyNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"gcm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Firebase V1 API notification that can be sent to a device.\n */\nexport interface FcmV1Notification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmV1NotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseV1NativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string | undefined>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmV1Notification(notification: FcmV1NotificationParams): FcmV1Notification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"fcmv1\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Xiaomi push notification.\n */\nexport interface XiaomiNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a notification to send to Xiaomi.\n * @param notification - A partial message used to create a message for Xiaomi.\n * @returns A newly created Xiaomi notification.\n */\nexport function createXiaomiNotification(notification: NotificationCommon): XiaomiNotification {\n return {\n ...notification,\n platform: \"xiaomi\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a template based push notification.\n */\nexport interface TemplateNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"template\";\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase.\n */\nexport function createTemplateNotification(notification: NotificationCommon): TemplateNotification {\n return {\n ...notification,\n platform: \"template\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents the possible WNS content-types.\n */\nexport type WindowsContentType = \"application/xml\" | \"application/octet-stream\";\n\n/**\n * Represents a Windows Notification Services (WNS) push notification.\n */\nexport interface WindowsNotification extends NotificationCommon {\n /**\n * The platform for the push notification.\n */\n platform: \"windows\";\n\n /**\n * The content type for the push notification.\n */\n contentType: WindowsContentType;\n}\n\n/**\n * Represents a WNS notification that can be sent to a device.\n */\nexport interface WnsNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: WindowsHeaders;\n}\n\n/**\n * Creates a notification to send to WNS.\n * @param notification - The WNS notification to send.\n * @returns A newly created WNS message.\n */\nexport function createWindowsNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n if (notification?.headers && notification.headers[\"X-WNS-Type\"]) {\n const wnsType = notification.headers[\"X-WNS-Type\"];\n switch (wnsType) {\n case Constants.WNS_TOAST:\n return createWindowsToastNotification(notification);\n case Constants.WNS_TITLE:\n return createWindowsTileNotification(notification);\n case Constants.WNS_BADGE:\n return createWindowsBadgeNotification(notification);\n case Constants.WNS_RAW:\n return createWindowsRawNotification(notification);\n default:\n throw new Error(`Invalid WNS type: ${wnsType}`);\n }\n } else {\n throw new Error(`Missing WNS type in headers`);\n }\n}\n\n/**\n * Creates a badge message to send to WNS.\n * @param notification - A partial message used to create a badge message for WNS.\n * @returns A newly created WNS badge.\n */\nexport function createWindowsBadgeNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_BADGE;\n }\n\n return result;\n}\n\n/**\n * Creates a tile message to send to WNS.\n * @param notification - A partial message used to create a tile message for WNS.\n * @returns A newly created WNS tile.\n */\nexport function createWindowsTileNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TITLE;\n }\n\n return result;\n}\n\n/**\n * Creates a toast message to send to WNS.\n * @param notification - A partial message used to create a toast message for WNS.\n * @returns A newly created WNS toast.\n */\nexport function createWindowsToastNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TOAST;\n }\n\n return result;\n}\n\n/**\n * Creates a notification to send to WNS in wns/raw format..\n * @param notification - A partial message used to create a message for WNS in XML format.\n * @returns A newly created WNS message using XML.\n */\nexport function createWindowsRawNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.STREAM_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_RAW;\n }\n\n return result;\n}\n\n/**\n * Represents the possible push notification messages types.\n */\nexport type Notification =\n | AppleNotification\n | AdmNotification\n | BaiduNotification\n | BrowserNotification\n | FcmLegacyNotification\n | FcmV1Notification\n | XiaomiNotification\n | WindowsNotification\n | TemplateNotification;\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { stringifyXML } from \"@azure/core-xml\";\n\n/**\n * Represents what is in the APNs alert body.\n */\nexport interface AppleAlert {\n /**\n * The title of the notification. Apple Watch displays this string in the short look notification\n * interface. Specify a string that’s quickly understood by the user.\n */\n title?: string;\n\n /**\n * Additional information that explains the purpose of the notification.\n */\n subtitle?: string;\n\n /**\n * The content of the alert message.\n */\n body?: string;\n\n /**\n * The name of the launch image file to display. If the user chooses to launch your app,\n * the contents of the specified image or storyboard file are displayed instead of your app’s normal launch image.\n */\n \"launch-image\"?: string;\n\n /**\n * The key for a localized title string. Specify this key instead of the title key to retrieve\n * the title from your app’s Localizable.strings files. The value must contain the name of a key in your strings file.\n */\n \"title-loc-key\"?: string;\n\n /**\n * An array of strings containing replacement values for variables in your title string.\n * Each %\\@ character in the string specified by the title-loc-key is replaced by a value\n * from this array. The first item in the array replaces the first instance\n * of the %\\@ character in the string, the second item replaces the second instance, and so on.\n */\n \"title-loc-args\"?: string[];\n\n /**\n * The key for a localized subtitle string. Use this key, instead of the subtitle key, to\n * retrieve the subtitle from your app’s Localizable.strings file.\n * The value must contain the name of a key in your strings file.\n */\n \"subtitle-loc-key\"?: string;\n\n /**\n * An array of strings containing replacement values for variables in your title string.\n * Each %\\@ character in the string specified by subtitle-loc-key is replaced by a value\n * from this array. The first item in the array replaces the first instance of the\n * %\\@ character in the string, the second item replaces the second instance, and so on.\n */\n \"subtitle-loc-args\"?: string[];\n\n /**\n * The key for a localized message string. Use this key, instead of the body key, to\n * retrieve the message text from your app’s Localizable.strings file. The value must contain\n * the name of a key in your strings file.\n */\n \"loc-key\"?: string;\n\n /**\n * An array of strings containing replacement values for variables in your message text.\n * Each %\\@ character in the string specified by loc-key is replaced by a value from\n * this array. The first item in the array replaces the first instance of the %\\@ character\n * in the string, the second item replaces the second instance, and so on.\n */\n \"loc-args\"?: string[];\n}\n\n/**\n * Represents an APNs critical sound\n */\nexport interface AppleCriticalSound {\n /**\n * The critical alert flag. Set to 1 to enable the critical alert.\n */\n critical: number;\n\n /**\n * The name of a sound file in your app’s main bundle or in the Library/Sounds folder\n * of your app’s container directory. Specify the string “default” to play the system sound.\n */\n name: string;\n\n /**\n * The volume for the critical alert’s sound. Set this to a value between 0 (silent) and 1 (full volume).\n */\n volume: number;\n}\n\n/**\n * Represents a native APNs message.\n */\nexport interface AppleNativeMessage extends Record<string, any> {\n /**\n * The Apple specific push notification information.\n */\n aps?: AppleApsNativeMessage;\n}\n\n/**\n * Represents a native APNs APS message.\n */\nexport interface AppleApsNativeMessage extends Record<string, any> {\n /**\n * The information for displaying an alert.\n */\n alert?: string | AppleAlert;\n\n /**\n * The number to display in a badge on your app’s icon.\n */\n badge?: number;\n\n /**\n * The name of a sound file in your app’s main bundle or in the Library/Sounds\n * folder of your app’s container directory. Specify the string “default” to\n * play the system sound. Use this key for regular notifications.\n * For critical alerts, use the sound dictionary instead.\n */\n sound?: string | AppleCriticalSound;\n\n /**\n * An app-specific identifier for grouping related notifications.\n */\n \"thread-id\"?: string;\n\n /**\n * The notification’s type.\n */\n category?: string;\n\n /**\n * The background notification flag. To perform a silent background update,\n * specify the value 1 and don’t include the alert, badge, or sound keys in your payload.\n */\n \"content-available\"?: number;\n\n /**\n * The notification service app extension flag. If the value is 1, the system passes\n * the notification to your notification service app extension before delivery.\n */\n \"mutable-content\"?: number;\n\n /**\n * The identifier of the window brought forward.\n */\n \"target-content-id\"?: string;\n\n /**\n * The importance and delivery timing of a notification.\n */\n \"interruption-level\"?: \"passive\" | \"active\" | \"time-sensitive\" | \"critical\";\n\n /**\n * The relevance score, a number between 0 and 1, that the system uses to sort the\n * notifications from your app. The highest score gets featured in the notification summary.\n */\n \"relevance-score\"?: number;\n\n /**\n * The criteria the system evaluates to determine if it displays the notification in the current Focus.\n */\n \"filter-criteria\"?: string;\n\n /**\n * The UNIX timestamp that represents the date at which a Live Activity becomes stale, or out of date.\n */\n \"stale-date\"?: number;\n\n /**\n * The updated or final content for a Live Activity.\n */\n \"content-state\"?: Record<string, any>;\n\n /**\n * The UNIX timestamp that marks the time when you send the remote notification that updates or ends a Live Activity.\n */\n timestamp?: number;\n\n /**\n * The string that describes whether you update or end an ongoing Live Activity with the remote push notification. To update the Live Activity, use update. To end the Live Activity, use end.\n */\n events?: string;\n\n /**\n * The UNIX timestamp that represents the date at which the system ends a Live Activity and removes it from the Dynamic Island and the Lock Screen.\n */\n \"dismissal-date\"?: number;\n}\n\n/**\n * Creates an APNs native message to send to Notification Hubs.\n * @param nativeMessage - The Apple native message properties to set.\n * @param additionalProperties - Additional properties for Apple messages.\n * @returns An AppleNotification to send to Notification Hubs.\n */\nexport function createAppleNotificationBody(nativeMessage: AppleNativeMessage): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Represents the targets, options, and payload for HTTP JSON messages for the Firebase Legacy HTTP interface.\n */\nexport interface FirebaseLegacyNativeMessage {\n /**\n * The recipient of a message.\n */\n to?: string;\n\n /**\n * The recipient of a multicast message, a message sent to more than one registration token.\n */\n registration_ids?: string[];\n\n /**\n * A logical expression of conditions that determine the message target.\n */\n condition?: string;\n\n /**\n * Used to identify a group of messages.\n */\n collapse_key?: string;\n\n /**\n * The priority of the message.\n */\n priority?: \"normal\" | \"high\";\n\n /**\n * The background notification flag. To perform a silent background update,\n * specify the value 1 and don’t include the alert, badge, or sound keys in your payload.\n */\n content_available?: boolean;\n\n /**\n * The notification service app extension flag. If the value is 1, the system passes\n * the notification to your notification service app extension before delivery.\n */\n mutable_content?: number;\n\n /**\n * Specifies how long (in seconds) the message should be kept in FCM storage if the device is offline\n */\n time_to_live?: number;\n\n /**\n * The package name of the application where the registration tokens must match in order to receive the message.\n */\n restricted_package_name?: string;\n\n /**\n * When set to true, allows developers to test a request without actually sending a message.\n */\n dry_run?: boolean;\n\n /**\n * Custom key-value pairs of the message's payload.\n */\n data?: Record<string, any>;\n\n /**\n * The predefined, user-visible key-value pairs of the notification payload.\n */\n notification?:\n | FirebaseLegacyAppleNativePayload\n | FirebaseLegacyAndroidNativePayload\n | FirebaseLegacyWebNativePayload;\n}\n\n/**\n * Represents an APNs native payload for the Firebase Legacy HTTP interface.\n */\nexport interface FirebaseLegacyAppleNativePayload {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The sound to play when the device receives the notification.\n */\n sound?: string;\n\n /**\n * The value of the badge on the home screen app icon.\n */\n badge?: string;\n\n /**\n * The action associated with a user click on the notification which corresponds to the APNs category.\n */\n click_action?: string;\n\n /**\n * The notification's subtitle.\n */\n subtitle?: string;\n\n /**\n * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.\n */\n body_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.\n */\n body_loc_args?: string[];\n\n /**\n * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.\n */\n title_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.\n */\n title_loc_args?: string[];\n}\n\n/**\n * Represents an Android native payload for the Firebase Legacy HTTP interface.\n */\nexport interface FirebaseLegacyAndroidNativePayload {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The notification's channel ID.\n */\n android_channel_id?: string;\n\n /**\n * The notification's icon.\n */\n icon?: string;\n\n /**\n * The sound to play when the device receives the notification.\n */\n sound?: string;\n\n /**\n * Identifier used to replace existing notifications in the notification drawer.\n */\n tag?: string;\n\n /**\n * The notification's icon color, expressed in #rrggbb format.\n */\n color?: string;\n\n /**\n * The action associated with a user click on the notification.\n */\n click_action?: string;\n\n /**\n * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.\n */\n body_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.\n */\n body_loc_args?: string[];\n\n /**\n * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.\n */\n title_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.\n */\n title_loc_args?: string[];\n}\n\n/**\n * Represents an Web Push native payload for the Firebase Legacy HTTP interface.\n */\nexport interface FirebaseLegacyWebNativePayload {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The URL to use for the notification's icon.\n */\n icon?: string;\n\n /**\n * The action associated with a user click on the notification.\n */\n click_action?: string;\n}\n\n/**\n * Creates a FcmLegacyNotification from a native Firebase payload.\n * @param nativeMessage - The native message payload to send to Notification Hubs.\n * @returns The JSON body to send to Notification Hubs.\n */\nexport function createFirebaseLegacyNotificationBody(\n nativeMessage: FirebaseLegacyNativeMessage,\n): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Represents the targets, options, and payload for HTTP JSON messages for the Firebase V1 interface.\n */\nexport interface FirebaseV1NativeMessage {\n /**\n * Custom key-value pairs of the message's payload.\n */\n data?: Record<string, any>;\n\n /**\n * The predefined, user-visible key-value pairs of the notification payload.\n */\n notification?: FirebaseV1NativeNotification;\n\n /**\n * Android specific options for messages sent through FCM connection server.\n */\n android?: FirebaseV1AndroidConfig;\n\n /**\n * Webpush protocol options.\n */\n webpush?: FirebaseV1WebPushConfig;\n\n /**\n * APNs specific options.\n */\n apns?: FirebaseV1ApnsConfig;\n\n /**\n * FCM options.\n */\n fcm_options?: FirebaseV1FcmOptions;\n\n /**\n * Registration token to send a message to.\n */\n token?: string;\n\n /**\n * Topic name to send a message to, e.g. \"weather\".\n */\n topic?: string;\n\n /**\n * Condition to send a message to, e.g. \"'foo' in topics && 'bar' in topics\".\n */\n condition?: string;\n}\n\n/**\n * Represents a native FCM V1 notification message payload.\n */\nexport interface FirebaseV1NativeNotification {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * Contains the URL of an image that is going to be downloaded on the device and displayed in a notification.\n */\n image?: string;\n}\n\n/**\n * Android specific options for messages sent through FCM connection server.\n */\nexport interface FirebaseV1AndroidConfig {\n /**\n * An identifier of a group of messages that can be collapsed, so that only the last message gets sent when delivery can be resumed.\n */\n collapse_key?: string;\n\n /**\n * Message priority. Can take \"normal\" and \"high\" values.\n */\n priority?: \"normal\" | \"high\";\n\n /**\n * How long (in seconds) the message should be kept in FCM storage if the device is offline.\n */\n ttl?: string;\n\n /**\n * Package name of the application where the registration token must match in order to receive the message.\n */\n restricted_package_name?: string;\n\n /**\n * Custom key-value pairs of the message's payload.\n */\n data?: Record<string, any>;\n\n /**\n * Notification to send to android devices.\n */\n notification?: FirebaseV1AndroidNotification;\n\n /**\n * Options for features provided by the FCM SDK for Android.\n */\n fcm_options?: FirebaseV1AndroidFcmOptions;\n\n /**\n * If set to true, messages will be allowed to be delivered to the app while the device is in direct boot mode.\n */\n direct_boot_ok?: boolean;\n}\n\n/**\n * Notification to send to android devices.\n */\nexport interface FirebaseV1AndroidNotification {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The notification's icon.\n */\n icon?: string;\n\n /**\n * The notification's icon color, expressed in #rrggbb format.\n */\n color?: string;\n\n /**\n * The sound to play when the device receives the notification.\n */\n sound?: string;\n\n /**\n * Identifier used to replace existing notifications in the notification drawer.\n */\n tag?: string;\n\n /**\n * The action associated with a user click on the notification.\n */\n click_action?: string;\n\n /**\n * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.\n */\n body_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.\n */\n body_loc_args?: string[];\n\n /**\n * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.\n */\n title_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.\n */\n title_loc_args?: string[];\n\n /**\n * The notification's channel id (new in Android O).\n */\n channel_id?: string;\n\n /**\n * Sets the \"ticker\" text, which is sent to accessibility services.\n */\n ticker?: string;\n\n /**\n * When set to false or unset, the notification is automatically dismissed when the user clicks it in the panel.\n */\n sticky?: boolean;\n\n /**\n * Set the time that the event in the notification occurred.\n */\n event_time?: string;\n\n /**\n * Set whether or not this notification is relevant only to the current device.\n */\n local_only?: boolean;\n\n /**\n * Set the relative priority for this notification.\n */\n notification_priority?: number;\n\n /**\n * If set to true, use the Android framework's default sound for the notification.\n */\n default_sound?: boolean;\n\n /**\n * If set to true, use the Android framework's default vibrate pattern for the notification.\n */\n default_vibrate_timings?: boolean;\n\n /**\n * If set to true, use the Android framework's default light settings for the notification.\n */\n default_light_settings?: boolean;\n\n /**\n * Set the vibration pattern to use.\n */\n vibrate_timings?: string[];\n\n /**\n * Set the Notification.visibility of the notification.\n */\n visibility?: number;\n\n /**\n * Sets the number of items this notification represents.\n */\n notification_count?: number;\n\n /**\n * Settings to control the notification's LED blinking rate and color if LED is available on the device.\n */\n light_settings?: {\n color: {\n red: number;\n green: number;\n blue: number;\n alpha: number;\n };\n light_on_duration: string;\n light_off_duration: string;\n };\n\n /**\n * Contains the URL of an image that is going to be displayed in a notification.\n */\n image?: string;\n}\n\n/**\n * Options for features provided by the FCM SDK for Android.\n */\nexport interface FirebaseV1AndroidFcmOptions {\n /**\n * The label associated with the message's analytics data.\n */\n analytics_label?: string;\n}\n\nexport interface FirebaseV1WebPushConfig {\n /**\n * A collection of WebPush protocol options.\n */\n headers?: Record<string, string>;\n\n /**\n * A collection of WebPush protocol options.\n */\n data?: Record<string, string>;\n\n /**\n * Web Notification options as a JSON object.\n */\n notification?: FirebaseV1WebPushNotification;\n\n /**\n * A collection of WebPush protocol options.\n */\n fcm_options?: FirebaseV1WebPushFcmOptions;\n}\n\n/**\n * Represents a Web Push notification payload.\n */\nexport interface FirebaseV1WebPushNotification {\n /**\n * An array of actions to display in the notification.\n */\n actions?: {\n action?: string;\n title?: string;\n icon?: string;\n }[];\n\n /**\n * Defines a title for the notification.\n */\n title?: string;\n\n /**\n * The body string of the notification\n */\n body?: string;\n\n /**\n * A string containing the URL of an icon to be displayed in the notification.\n */\n icon?: string;\n\n /**\n * A string containing the URL of an image to represent the notification when there is not enough space to display the notification itself such as for example, the Android Notification Bar.\n */\n badge?: string;\n\n /**\n * The notification's data.\n */\n data?: Record<string, any>;\n\n /**\n * The direction in which to display the notification.\n */\n dir?: \"auto\" | \"ltr\" | \"rtl\";\n\n /**\n * A string containing the URL of an image to be displayed in the notification.\n */\n image?: string;\n\n /**\n * The notification's language.\n */\n lang?: string;\n\n /**\n * A boolean value specifying whether the user should be notified after a new notification replaces an old one.\n */\n renotify?: boolean;\n\n /**\n * Indicates that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.\n */\n requireInteraction?: boolean;\n\n /**\n * A boolean value specifying whether the notification is silent\n */\n silent?: boolean;\n\n /**\n * A string representing an identifying tag for the notification.\n */\n tag?: string;\n\n /**\n * A number representing the time at which a notification is created or applicable\n */\n timestamp?: number;\n\n /**\n * A vibration pattern for the device's vibration hardware to emit with the notification.\n */\n vibrate?: number[];\n}\n\n/**\n * Options for features provided by the FCM SDK for Web.\n */\nexport interface FirebaseV1WebPushFcmOptions {\n /**\n * The link to open when the user clicks on the notification.\n */\n link?: string;\n\n /**\n * Label associated with the message's analytics data.\n */\n analytics_label?: string;\n}\n\n/**\n * Apple Push Notification Service specific options.\n */\nexport interface FirebaseV1ApnsConfig {\n /**\n * A collection of APNs headers.\n */\n headers?: Record<string, string>;\n\n /**\n * A collection of APNs headers.\n */\n payload?: AppleNativeMessage;\n\n /**\n * A collection of APNs headers.\n */\n fcm_options?: FirebaseV1ApnsFcmOptions;\n}\n\n/**\n * Options for features provided by the FCM SDK for iOS.\n */\nexport interface FirebaseV1ApnsFcmOptions {\n /**\n * Label associated with the message's analytics data.\n */\n analytics_label?: string;\n\n /**\n * Contains the URL of an image that is going to be displayed in a notification.\n */\n image?: string;\n}\n\nexport interface FirebaseV1FcmOptions {\n /**\n * Label associated with the message's analytics data.\n */\n analytics_label?: string;\n}\n\n/**\n * Creates a FcmV1Notification from a native Firebase payload.\n * @param nativeMessage - The native message payload to send to Notification Hubs.\n * @returns The JSON body to send to Notification Hubs.\n */\nexport function createFirebaseV1NotificationBody(nativeMessage: FirebaseV1NativeMessage): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Describes ADM notification messages.\n */\nexport interface AdmNativeNotification {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The notification's icon.\n */\n icon?: string;\n\n /**\n * The notification's icon color, expressed in #rrggbb format.\n */\n color?: string;\n\n /**\n * The sound to play when the device receives the notification. Supports \"default\" or the filename of a sound resource bundled in the app.\n */\n sound?: string;\n\n /**\n * Identifier used to replace existing notifications in the notification drawer.\n */\n tag?: string;\n\n /**\n * The action associated with a user click on the notification.\n */\n click_action?: string;\n\n /**\n * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.\n */\n body_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.\n */\n body_loc_args?: string[];\n\n /**\n * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.\n */\n title_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.\n */\n title_loc_args?: string[];\n\n /**\n * The notification's channel id.\n */\n channel_id?: string;\n\n /**\n * Sets the \"ticker\" text, which is sent to accessibility services.\n */\n ticker?: string;\n\n /**\n * When set to false or unset, the notification is automatically dismissed when the user clicks it in the panel.\n */\n sticky?: boolean;\n\n /**\n * Set the time that the event in the notification occurred. Must be a timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: \"2014-10-02T15:01:23.045123456Z\".\n */\n event_time?: string;\n\n /**\n * Set whether or not this notification is relevant only to the current device.\n */\n local_only?: boolean;\n\n /**\n * Set the relative priority for this notification.\n */\n notification_priority?: number;\n\n /**\n * If set to true, use the Android framework's default sound for the notification.\n */\n default_sound?: boolean;\n\n /**\n * Set the Notification.visibility of the notification.\n */\n visibility?: number;\n\n /**\n * Sets the number of items this notification represents.\n */\n notification_count?: number;\n\n /**\n * Contains the URL of an image that is going to be displayed in a notification.\n */\n image?: string;\n}\n\n/**\n * Represents a native ADM notification message payload.\n */\nexport interface AdmNativeMessage {\n /**\n * The notification payload to send with the message.\n */\n notification?: AdmNativeNotification;\n\n /**\n * The payload data to send with the message.\n */\n data?: Record<string, string>;\n\n /**\n * The priority of the msssage.\n */\n priority?: \"normal\" | \"high\";\n\n /**\n * This is an arbitrary string used to indicate that multiple messages are logically the same\n * and that ADM is allowed to drop previously enqueued messages in favor of this new one.\n */\n consolidationKey?: string;\n\n /**\n * The number of seconds that ADM should retain the message if the device is offline.\n */\n expiresAfter?: number;\n\n /**\n * This is a base-64-encoded MD5 checksum of the data parameter.\n */\n md5?: string;\n}\n\n/**\n * Creates a AdmNotification from a native ADM payload.\n * @param nativeMessage - The native message payload to send to Notification Hubs.\n * @returns The AdmNotification to send to Notification Hubs.\n */\nexport function createAdmNotificationBody(nativeMessage: AdmNativeMessage): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Represents the Baidu Apple native payload.\n */\nexport interface BaiduAppleNativePayload {\n /**\n * The alert string.\n */\n alert?: string;\n\n /**\n * The APNs sound to play.\n */\n sound?: string;\n\n /**\n * The APNs badge count.\n */\n badge?: number;\n}\n\n/**\n * Baidu Native Format:\n * https://stackoverflow.com/questions/42591815/customize-baidu-push-json-payload\n * http://www.tuicool.com/articles/ZnmANn\n */\nexport interface BaiduNativeMessage extends Record<string, any> {\n /**\n * Notification title for Android.\n */\n title?: string;\n\n /**\n * Baidu Notification description for Android.\n */\n description?: string;\n\n /**\n * Baidu Notification builder ID.\n */\n notification_builder_id?: number;\n\n /**\n * Baidu Notification Android basic style.\n */\n notification_basic_style?: number;\n\n /**\n * Baidu Android open type.\n */\n open_type?: number;\n\n /**\n * Baidu Android net support option.\n */\n net_support?: number;\n\n /**\n * Baidu Android user confirm.\n */\n user_confirm?: number;\n\n /**\n * Baidu Android URL.\n */\n url?: string;\n\n /**\n * Baidu Android package content.\n */\n pkg_content?: string;\n\n /**\n * Baidu Android package version.\n */\n pkg_version?: string;\n\n /**\n * Baidu Android custom content dictionary.\n */\n custom_content?: Record<string, any>;\n\n /**\n * Baidu APNs support.\n */\n aps?: BaiduAppleNativePayload;\n}\n\n/**\n * Creates a BaiduNotification from a native Baidu payload.\n * @param nativeMessage - The native message payload to send to Notification Hubs.\n * @returns The JSON body to send to Notification Hubs.\n */\nexport function createBaiduNotificationBody(nativeMessage: BaiduNativeMessage): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Represents the types of Windows Badge Glyphs\n */\nexport type WindowsBadgeGlyphType =\n | \"none\"\n | \"activity\"\n | \"alarm\"\n | \"alert\"\n | \"attention\"\n | \"available\"\n | \"away\"\n | \"busy\"\n | \"error\"\n | \"newMessage\"\n | \"paused\"\n | \"playing\"\n | \"unavailable\";\n\n/**\n * Represents the Windows Badge Message\n */\nexport interface WindowsBadgeNativeMessage {\n /**\n * Either a numeric value or a string value that specifies a predefined badge glyph.\n */\n value: WindowsBadgeGlyphType | number;\n}\n\n/**\n * Builds a WindowsNotification from a Windows Badge.\n * @param nativeMessage - The Windows Badge Message to build.\n * @returns The WNS XML created with the badge information.\n */\nexport function createWindowsBadgeNotificationBody(\n nativeMessage: WindowsBadgeNativeMessage,\n): string {\n const badge = {\n $: { value: nativeMessage.value },\n };\n\n return stringifyXML(badge, { rootName: \"badge\" });\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the types of registration descriptions.\n */\nexport type RegistrationType =\n | \"Adm\"\n | \"AdmTemplate\"\n | \"Apple\"\n | \"AppleTemplate\"\n | \"Baidu\"\n | \"BaiduTemplate\"\n | \"Browser\"\n | \"BrowserTemplate\"\n | \"Gcm\"\n | \"GcmTemplate\"\n | \"FcmV1\"\n | \"FcmV1Template\"\n | \"Mpns\"\n | \"MpnsTemplate\"\n | \"Xiaomi\"\n | \"XiaomiTemplate\"\n | \"Windows\"\n | \"WindowsTemplate\";\n\n/**\n * Represents a registration description.\n */\nexport interface RegistrationDescriptionCommon {\n /**\n * The registration ID.\n */\n registrationId?: string;\n\n /**\n * The expiration time of the registration.\n */\n expirationTime?: Date;\n\n /**\n * The ETag associated with this description.\n */\n etag?: string;\n\n /**\n * The tags associated with the registration.\n */\n tags?: string[];\n\n /**\n * A dictionary of push variables associated with property bag.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents the description of a template registration.\n */\nexport interface TemplateRegistrationDescription {\n /**\n * The body template.\n */\n bodyTemplate: string;\n\n /**\n * The name of the template.\n */\n templateName?: string;\n\n /**\n * Represents the description of the Amazon Device Messaging (ADM) registration.\n */\n}\nexport interface AdmRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Amazon Device Messaging registration identifier.\n */\n admRegistrationId: string;\n}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) registration.\n */\nexport interface AdmRegistrationDescription extends AdmRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Adm\";\n}\n\n/**\n * Creates an ADM registration description.\n * @param description - A partial ADM registration description.\n * @returns A created ADM registration description.\n */\nexport function createAdmRegistrationDescription(\n description: AdmRegistrationDescriptionCommon,\n): AdmRegistrationDescription {\n return {\n ...description,\n kind: \"Adm\",\n };\n}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) template registration.\n */\nexport interface AdmTemplateRegistrationDescriptionCommon\n extends AdmRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) template registration.\n */\nexport interface AdmTemplateRegistrationDescription\n extends AdmTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"AdmTemplate\";\n}\n\n/**\n * Creates an ADM template registration description.\n * @param description - A partial ADM template registration description.\n * @returns A created ADM template registration description.\n */\nexport function createAdmTemplateRegistrationDescription(\n description: AdmTemplateRegistrationDescriptionCommon,\n): AdmTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"AdmTemplate\",\n };\n}\n\n/**\n * Represents the description of apple registration.\n */\nexport interface AppleRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The APNs device token.\n */\n deviceToken: string;\n}\n\n/**\n * Represents the description of apple registration.\n */\nexport interface AppleRegistrationDescription extends AppleRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Apple\";\n}\n\n/**\n * Creates an Apple registration description.\n * @param description - A partial Apple registration description.\n * @returns A created Apple registration description.\n */\nexport function createAppleRegistrationDescription(\n description: AppleRegistrationDescriptionCommon,\n): AppleRegistrationDescription {\n return {\n ...description,\n kind: \"Apple\",\n };\n}\n\n/**\n * Represents the description of the Apple template registration.\n */\nexport interface AppleTemplateRegistrationDescriptionCommon\n extends AppleRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The expiry date.\n */\n expiry?: Date;\n\n /**\n * The notification priority.\n */\n priority?: \"10\" | \"5\";\n\n /**\n * The APNS headers.\n */\n apnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents the description of the Apple template registration.\n */\nexport interface AppleTemplateRegistrationDescription\n extends AppleTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"AppleTemplate\";\n}\n\n/**\n * Creates an Apple template registration description.\n * @param description - A partial Apple template registration description.\n * @returns A created Apple template registration description.\n */\nexport function createAppleTemplateRegistrationDescription(\n description: AppleTemplateRegistrationDescriptionCommon,\n): AppleTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"AppleTemplate\",\n };\n}\n\nexport interface BaiduRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Baidu user identifier.\n */\n baiduUserId: string;\n\n /**\n * The Baidu channel identifier.\n */\n baiduChannelId: string;\n}\n\n/**\n * Represents a Baidu registration description.\n */\nexport interface BaiduRegistrationDescription extends BaiduRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Baidu\";\n}\n\n/**\n * Creates a Baidu registration description.\n * @param description - A partial Baidu registration description.\n * @returns A created Baidu registration description.\n */\nexport function createBaiduRegistrationDescription(\n description: BaiduRegistrationDescriptionCommon,\n): BaiduRegistrationDescription {\n return {\n ...description,\n kind: \"Baidu\",\n };\n}\n\n/**\n * Represents a Baidu template registration description.\n */\nexport interface BaiduTemplateRegistrationDescriptionCommon\n extends BaiduRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Baidu template registration description.\n */\nexport interface BaiduTemplateRegistrationDescription\n extends BaiduTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"BaiduTemplate\";\n}\n\n/**\n * Creates a Baidu template registration description.\n * @param description - A partial Baidu template registration description.\n * @returns A created Baidu template registration description.\n */\nexport function createBaiduTemplateRegistrationDescription(\n description: BaiduTemplateRegistrationDescriptionCommon,\n): BaiduTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"BaiduTemplate\",\n };\n}\n\n/**\n * Represents a Browser Push registration description.\n */\nexport interface BrowserRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Browser push endpoint.\n */\n endpoint: string;\n\n /**\n * The Browser push P256DH.\n */\n p256dh: string;\n\n /**\n * The Browser push auth secret.\n */\n auth: string;\n}\n\n/**\n * Represents a Browser Push registration description.\n */\nexport interface BrowserRegistrationDescription extends BrowserRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Browser\";\n}\n\n/**\n * Creates a Web Push registration description.\n * @param description - A partial Web Push registration description.\n * @returns A created Web Push registration description.\n */\nexport function createBrowserRegistrationDescription(\n description: BrowserRegistrationDescriptionCommon,\n): BrowserRegistrationDescription {\n return {\n ...description,\n kind: \"Browser\",\n };\n}\n\n/**\n * Represents a Browser Push remplate registration description.\n */\nexport interface BrowserTemplateRegistrationDescriptionCommon\n extends BrowserRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Browser Push remplate registration description.\n */\nexport interface BrowserTemplateRegistrationDescription\n extends BrowserTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"BrowserTemplate\";\n}\n\n/**\n * Creates a Web Push registration description.\n * @param description - A partial Web Push template registration description.\n * @returns A created Web Push template registration description.\n */\nexport function createBrowserTemplateRegistrationDescription(\n description: BrowserTemplateRegistrationDescriptionCommon,\n): BrowserTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"BrowserTemplate\",\n };\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface GcmRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * Registration id obtained from the Google Cloud Messaging service.\n */\n gcmRegistrationId: string;\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface GcmRegistrationDescription extends GcmRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Gcm\";\n}\n\n/**\n * Creates a Firebase Legacy registration description.\n * @param description - A partial GCM registration description.\n * @returns A created GCM registration description.\n */\nexport function createFcmLegacyRegistrationDescription(\n description: GcmRegistrationDescriptionCommon,\n): GcmRegistrationDescription {\n return {\n ...description,\n kind: \"Gcm\",\n };\n}\n\n/**\n * Represents Notification Hub template registration description for Firebase Legacy Cloud Messaging.\n */\nexport interface GcmTemplateRegistrationDescriptionCommon\n extends GcmRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents Notification Hub template registration description for Firebase Legacy Cloud Messaging.\n */\nexport interface GcmTemplateRegistrationDescription\n extends GcmTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"GcmTemplate\";\n}\n\n/**\n * Creates a GCM template registration description.\n * @param description - A partial GCM template registration description.\n * @returns A created GCM template registration description.\n */\nexport function createFcmLegacyTemplateRegistrationDescription(\n description: GcmTemplateRegistrationDescriptionCommon,\n): GcmTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"GcmTemplate\",\n };\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface FcmV1RegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * Registration id obtained from the Firebase Cloud Messaging service.\n */\n fcmV1RegistrationId: string;\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface FcmV1RegistrationDescription extends FcmV1RegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"FcmV1\";\n}\n\n/**\n * Creates a Firebase V1 registration description.\n * @param description - A partial FCM V1 registration description.\n * @returns A created FCM V1 registration description.\n */\nexport function createFcmV1RegistrationDescription(\n description: FcmV1RegistrationDescriptionCommon,\n): FcmV1RegistrationDescription {\n return {\n ...description,\n kind: \"FcmV1\",\n };\n}\n\n/**\n * Represents Notification Hub template registration description for Firebase V1 Cloud Messaging.\n */\nexport interface FcmV1TemplateRegistrationDescriptionCommon\n extends FcmV1RegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents Notification Hub template registration description for Firebase V1 Cloud Messaging.\n */\nexport interface FcmV1TemplateRegistrationDescription\n extends FcmV1TemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"FcmV1Template\";\n}\n\n/**\n * Creates a FCM V1 template registration description.\n * @param description - A partial FCM V1 template registration description.\n * @returns A created FCM V1 template registration description.\n */\nexport function createFcmV1TemplateRegistrationDescription(\n description: FcmV1TemplateRegistrationDescriptionCommon,\n): FcmV1TemplateRegistrationDescription {\n return {\n ...description,\n kind: \"FcmV1Template\",\n };\n}\n\n/**\n * Represents a Windows Phone Notification Services registration description.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The channel URI.\n */\n channelUri: string;\n}\n\n/**\n * Represents a Windows Phone Notification Services registration description.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsRegistrationDescription extends MpnsRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Mpns\";\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescription\n extends MpnsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n mpnsHeaders?: Record<string, string>;\n\n /**\n * The kind of the registration.\n */\n kind: \"MpnsTemplate\";\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescriptionCommon\n extends MpnsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n mpnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescription\n extends MpnsTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"MpnsTemplate\";\n}\n\n/**\n * Represents a Windows Notification Services (WNS) registration description.\n */\nexport interface WindowsRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The channel URI.\n */\n channelUri: string;\n}\n\n/**\n * Represents a Windows Notification Services (WNS) registration description.\n */\nexport interface WindowsRegistrationDescription extends WindowsRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Windows\";\n}\n\n/**\n * Creates a Windows registration description.\n * @param description - A partial Windows registration description.\n * @returns A created Windows registration description.\n */\nexport function createWindowsRegistrationDescription(\n description: WindowsRegistrationDescriptionCommon,\n): WindowsRegistrationDescription {\n return {\n ...description,\n kind: \"Windows\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface WindowsTemplateRegistrationDescriptionCommon\n extends WindowsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n wnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface WindowsTemplateRegistrationDescription\n extends WindowsTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"WindowsTemplate\";\n}\n\n/**\n * Creates a Windows template registration description.\n * @param description - A partial Windows template registration description.\n * @returns A created Windows template registration description.\n */\nexport function createWindowsTemplateRegistrationDescription(\n description: WindowsTemplateRegistrationDescriptionCommon,\n): WindowsTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"WindowsTemplate\",\n };\n}\n\n/**\n * Represents a Xiaomi registration description.\n */\nexport interface XiaomiRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Xiaomi registration ID.\n */\n xiaomiRegistrationId: string;\n}\n\n/**\n * Represents a Xiaomi registration description.\n */\nexport interface XiaomiRegistrationDescription extends XiaomiRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Xiaomi\";\n}\n\n/**\n * Creates a Xiaomi registration description.\n * @param description - A partial Xiaomi registration description.\n * @returns A created Xiaomi registration description.\n */\nexport function createXiaomiRegistrationDescription(\n description: XiaomiRegistrationDescriptionCommon,\n): XiaomiRegistrationDescription {\n return {\n ...description,\n kind: \"Xiaomi\",\n };\n}\n\n/**\n * Represents a Xiaomi template registration.\n */\nexport interface XiaomiTemplateRegistrationDescriptionCommon\n extends XiaomiRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface XiaomiTemplateRegistrationDescription\n extends XiaomiTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"XiaomiTemplate\";\n}\n\n/**\n * Creates a Xiaomi template registration description.\n * @param description - A partial Xiaomi template registration description.\n * @returns A created Xiaomi template registration description.\n */\nexport function createXiaomiTemplateRegistrationDescription(\n description: XiaomiTemplateRegistrationDescriptionCommon,\n): XiaomiTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"XiaomiTemplate\",\n };\n}\n\n/**\n * Describes the types of registration descriptions.\n */\nexport type RegistrationDescription =\n | AdmRegistrationDescription\n | AdmTemplateRegistrationDescription\n | AppleRegistrationDescription\n | AppleTemplateRegistrationDescription\n | BaiduRegistrationDescription\n | BaiduTemplateRegistrationDescription\n | BrowserRegistrationDescription\n | BrowserTemplateRegistrationDescription\n | GcmRegistrationDescription\n | GcmTemplateRegistrationDescription\n | FcmV1RegistrationDescription\n | FcmV1TemplateRegistrationDescription\n | MpnsRegistrationDescription\n | MpnsTemplateRegistrationDescription\n | XiaomiRegistrationDescription\n | XiaomiTemplateRegistrationDescription\n | WindowsRegistrationDescription\n | WindowsTemplateRegistrationDescription;\n\n/**\n * Describes an ADM Registration channel query.\n */\nexport interface AdmRegistrationChannel {\n /**\n * The ADM Registration ID.\n */\n admRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"adm\";\n}\n\n/**\n * Describes an Apple Registration channel query.\n */\nexport interface AppleRegistrationChannel {\n /**\n * The APNs device token.\n */\n deviceToken: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"apple\";\n}\n\n/**\n * Describes an Baidu Registration channel query.\n */\nexport interface BaiduRegistrationChannel {\n /**\n * The Baidu Channel ID.\n */\n baiduChannelId: string;\n /**\n * The Baidu User ID.\n */\n baiduUserId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"baidu\";\n}\n\n/**\n * Describes an Browser Registration channel query.\n */\nexport interface BrowserRegistrationChannel {\n /**\n * The Web Push endpoint URL.\n */\n endpoint: string;\n /**\n * The Web Push subscription P256DH.\n */\n p256dh: string;\n /**\n * The Web Push subscription auth secret.\n */\n auth: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"browser\";\n}\n\n/**\n * Describes an Firebase Legacy Registration channel query.\n */\nexport interface FirebaseLegacyRegistrationChannel {\n /**\n * The FCM Legacy registration ID.\n */\n gcmRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"gcm\";\n}\n\n/**\n * Describes an Firebase Legacy Registration channel query.\n */\nexport interface FirebaseV1RegistrationChannel {\n /**\n * The FCM V1 registration ID.\n */\n fcmV1RegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"fcmv1\";\n}\n\n/**\n * Describes an Windows Notification Services Registration channel query.\n */\nexport interface WindowsRegistrationChannel {\n /**\n * The WNS Channel URI.\n */\n channelUri: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"windows\";\n}\n\n/**\n * Describes an Xiaomi Registration channel query.\n */\nexport interface XiaomiRegistrationChannel {\n /**\n * The Xiaomi registration ID.\n */\n xiaomiRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"xiaomi\";\n}\n\n/**\n * Describes a Registration query.\n */\nexport type RegistrationChannel =\n | AdmRegistrationChannel\n | AppleRegistrationChannel\n | BaiduRegistrationChannel\n | BrowserRegistrationChannel\n | FirebaseLegacyRegistrationChannel\n | FirebaseV1RegistrationChannel\n | XiaomiRegistrationChannel\n | WindowsRegistrationChannel;\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Creates a tag expression from a list of tags as a || expression.\n * @param tags - The tags to create the || expression\n * @returns The tag expression made from the array of strings into an || expression.\n */\nexport function createTagExpression(tags: string[]): string {\n return tags.join(\"||\");\n}\n"],"names":["createHmac","constants.SDK_VERSION","createDefaultHttpClient","getClient","RestError","createHttpHeaders","parseXML","createPipelineRequest","stringifyXML","createTracingClient","OPERATION_NAME","delay","__asyncValues","__await","__asyncDelegator","objectHasProperty","randomUUID","createOrUpdateInstallationMethod","deleteInstallationMethod","getInstallationMethod","updateInstallationMethod","createRegistrationIdMethod","createRegistrationMethod","createOrUpdateRegistrationMethod","updateRegistrationMethod","getRegistrationMethod","listRegistrationsMethod","listRegistrationsByChannelMethod","listRegistrationsByTagMethod","sendNotificationMethod","scheduleNotificationMethod","cancelScheduledNotificationMethod","getFeedbackContainerUrlMethod","getNotificationOutcomeDetailsMethod","getNotificationHubJobMethod","beginSubmitNotificationHubJobMethod","submitNotificationHubJobMethod","listNotificationHubJobsMethod","Constants.JSON_CONTENT_TYPE","Constants.WNS_TOAST","Constants.WNS_TITLE","Constants.WNS_BADGE","Constants.WNS_RAW","Constants.XML_CONTENT_TYPE","Constants.WNS_TYPE_NAME","Constants.STREAM_CONTENT_TYPE"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAE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A;AAEzD,IAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACK,WAAW,CAAA,EAAA,EACd,IAAI,EAAE,iBAAiB,EACvB,CAAA,CAAA;AACJ,CAAC;AAsBD;;;;AAIG;AACG,SAAU,mCAAmC,CACjD,WAAgD,EAAA;AAEhD,IAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACK,WAAW,CAAA,EAAA,EACd,IAAI,EAAE,QAAQ,EACd,CAAA,CAAA;AACJ,CAAC;AAoBD;;;;AAIG;AACG,SAAU,2CAA2C,CACzD,WAAwD,EAAA;AAExD,IAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACK,WAAW,CAAA,EAAA,EACd,IAAI,EAAE,gBAAgB,EACtB,CAAA,CAAA;AACJ;;ACtrBA;AACA;AAEA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,IAAc,EAAA;AAChD,IAAA,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/utils/constants.ts","../src/auth/hmacSha256.ts","../src/auth/sasTokenCredential.ts","../src/auth/connectionStringUtils.ts","../src/api/clientContext.ts","../src/utils/utils.ts","../src/serializers/notificationOutcomeSerializer.ts","../src/utils/xmlUtils.ts","../src/api/internal/_client.ts","../src/serializers/notificationHubJobSerializer.ts","../src/utils/tracing.ts","../src/api/getNotificationHubJob.ts","../src/api/submitNotificationHubJob.ts","../src/api/beginSubmitNotificationHubJob.ts","../src/api/cancelScheduledNotification.ts","../src/api/createOrUpdateInstallation.ts","../src/serializers/registrationSerializer.ts","../src/api/internal/_createOrUpdateRegistrationDescription.ts","../src/api/createOrUpdateRegistration.ts","../src/api/createRegistrationId.ts","../src/api/createRegistration.ts","../src/api/deleteInstallation.ts","../src/api/deleteRegistration.ts","../src/api/getFeedbackContainerUrl.ts","../src/api/getInstallation.ts","../src/serializers/notificationDetailsSerializer.ts","../src/api/getNotificationOutcomeDetails.ts","../src/api/getRegistration.ts","../src/api/listNotificationHubJobs.ts","../src/api/internal/_listRegistrations.ts","../src/api/listRegistrationsByChannel.ts","../src/api/listRegistrationsByTag.ts","../src/api/listRegistrations.ts","../src/api/scheduleNotification.ts","../src/utils/optionUtils.ts","../src/utils/notificationUtils.ts","../src/api/sendNotification.ts","../src/api/updateInstallation.ts","../src/api/updateRegistration.ts","../src/notificationHubsClient.ts","../src/models/installation.ts","../src/models/notification.ts","../src/models/notificationBodyBuilder.ts","../src/models/registration.ts","../src/models/tagExpressionBuilder.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.2.0\";\n\nexport const JSON_CONTENT_TYPE = \"application/json;charset=utf-8\";\nexport const XML_CONTENT_TYPE = \"application/xml\";\nexport const STREAM_CONTENT_TYPE = \"application/octet-stream\";\n\nexport const WNS_TYPE_NAME = \"X-WNS-Type\";\nexport const WNS_RAW = \"wns/raw\";\nexport const WNS_BADGE = \"wns/badge\";\nexport const WNS_TITLE = \"wns/tile\";\nexport const WNS_TOAST = \"wns/toast\";\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createHmac } from \"crypto\";\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const hmac = createHmac(\"sha256\", key).update(toSign).digest(\"base64\");\n return encodeURIComponent(hmac);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccessToken, TokenCredential } from \"@azure/core-auth\";\nimport { signString } from \"./hmacSha256.js\";\n\n/**\n * Represents a named key credential.\n */\nexport interface NamedKeyCredential {\n /**\n * The Shared Access Signature key name.\n */\n sharedAccessKeyName: string;\n\n /**\n * The Shared Access Signature key value.\n */\n sharedAccessKey: string;\n}\n\n/**\n * A TokenProvider that generates a Sas token:\n * `SharedAccessSignature sr=<resource>&sig=<signature>&se=<expiry>&skn=<keyname>`\n *\n * @internal\n */\nexport class SasTokenCredential implements TokenCredential {\n /**\n * The SASCredential containing the key name and secret key value.\n */\n private _credential: NamedKeyCredential;\n\n /**\n * Initializes a new instance of SasTokenProvider\n * @param credential - The source `NamedKeyCredential` or `SASCredential`.\n */\n constructor(credential: NamedKeyCredential) {\n this._credential = credential;\n }\n\n /**\n * Gets the sas token for the specified audience\n * @param scopes - The scope for which the token is desired.\n */\n async getToken(scopes: string | string[]): Promise<AccessToken | null> {\n const audience = Array.isArray(scopes) ? scopes[0] : scopes;\n return createToken(\n this._credential.sharedAccessKeyName,\n this._credential.sharedAccessKey,\n Math.floor(Date.now() / 1000) + 3600,\n audience,\n );\n }\n}\n\n/**\n * Creates the sas token based on the provided information.\n * @param keyName - The shared access key name.\n * @param key - The shared access key.\n * @param expiry - The time period in unix time after which the token will expire.\n * @param audience - The audience for which the token is desired.\n * @internal\n */\nasync function createToken(\n keyName: string,\n key: string,\n expiry: number,\n audience: string,\n): Promise<AccessToken> {\n audience = encodeURIComponent(audience.toLowerCase());\n keyName = encodeURIComponent(keyName);\n const stringToSign = audience + \"\\n\" + expiry;\n const sig = await signString(key, stringToSign);\n\n return {\n token: `SharedAccessSignature sr=${audience}&sig=${sig}&se=${expiry}&skn=${keyName}`,\n expiresOnTimestamp: expiry,\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { SasTokenCredential } from \"./sasTokenCredential.js\";\n\n/**\n * Defines an object with possible properties defined in T.\n */\nexport type ParsedOutput<T> = { [P in keyof T]: T[P] };\n\n/**\n * Parses the connection string and returns an object of type T.\n *\n * Connection strings have the following syntax:\n *\n * ConnectionString ::= `Part { \";\" Part } [ \";\" ] [ WhiteSpace ]`\n * Part ::= [ PartLiteral [ \"=\" PartLiteral ] ]\n * PartLiteral ::= [ WhiteSpace ] Literal [ WhiteSpace ]\n * Literal ::= ? any sequence of characters except ; or = or WhiteSpace ?\n * WhiteSpace ::= ? all whitespace characters including `\\r` and `\\n` ?\n *\n * @param connectionString - The connection string to be parsed.\n * @returns ParsedOutput<T>.\n */\nfunction parseConnectionString<T>(connectionString: string): ParsedOutput<T> {\n const output: { [k: string]: string } = {};\n const parts = connectionString.trim().split(\";\");\n\n for (let part of parts) {\n part = part.trim();\n\n if (part === \"\") {\n // parts can be empty\n continue;\n }\n\n const splitIndex = part.indexOf(\"=\");\n if (splitIndex === -1) {\n throw new Error(\n \"Connection string malformed: each part of the connection string must have an `=` assignment.\",\n );\n }\n\n const key = part.substring(0, splitIndex).trim();\n if (key === \"\") {\n throw new Error(\"Connection string malformed: missing key for assignment\");\n }\n\n const value = part.substring(splitIndex + 1).trim();\n\n output[key] = value;\n }\n\n return output as any;\n}\n\n/**\n * The set of properties that comprise a Notification Hubs connection string.\n */\nexport interface NotificationHubsConnectionStringProperties {\n /**\n * The value for \"Endpoint\" in the connection string.\n */\n endpoint: string;\n /**\n * The value for \"SharedAccessKey\" in the connection string. This along with the \"SharedAccessKeyName\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKey: string;\n /**\n * The value for \"SharedAccessKeyName\" in the connection string. This along with the \"SharedAccessKey\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKeyName: string;\n}\n\n/**\n * Creates a SasTokenCredential from a shared access key and shared access key name.\n * @param sharedAccessKey - The shared access key value.\n * @param sharedAccessKeyName - The shared access key name.\n * @returns A SasTokenCredential with the given shared access token information.\n */\nexport function createTokenCredentialFromConnection(\n sharedAccessKey: string,\n sharedAccessKeyName: string,\n): SasTokenCredential {\n return new SasTokenCredential({ sharedAccessKey, sharedAccessKeyName });\n}\n\n/**\n * Parses given connection string into the different properties applicable to Azure Service Bus.\n * The properties are useful to then construct a ServiceBusClient.\n * @param connectionString - The connection string associated with the Shared Access Policy created\n * for the Service Bus namespace, queue or topic.\n */\nexport function parseNotificationHubsConnectionString(\n connectionString: string,\n): NotificationHubsConnectionStringProperties {\n const parsedResult = parseConnectionString<{\n Endpoint: string;\n SharedAccessKey?: string;\n SharedAccessKeyName?: string;\n }>(connectionString);\n if (!parsedResult.Endpoint) {\n throw new Error(\"Connection string should have an Endpoint key.\");\n }\n\n if (parsedResult.SharedAccessKey && !parsedResult.SharedAccessKeyName) {\n throw new Error(\"Connection string with SharedAccessKey should have SharedAccessKeyName.\");\n } else if (!parsedResult.SharedAccessKey && parsedResult.SharedAccessKeyName) {\n throw new Error(\n \"Connection string with SharedAccessKeyName should have SharedAccessKey as well.\",\n );\n }\n\n const output: NotificationHubsConnectionStringProperties = {\n endpoint: parsedResult.Endpoint,\n sharedAccessKey: parsedResult.SharedAccessKey!,\n sharedAccessKeyName: parsedResult.SharedAccessKeyName!,\n };\n\n return output;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as constants from \"../utils/constants.js\";\nimport {\n HttpClient,\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n RestError,\n createDefaultHttpClient,\n createHttpHeaders,\n} from \"@azure/core-rest-pipeline\";\nimport {\n createTokenCredentialFromConnection,\n parseNotificationHubsConnectionString,\n} from \"../auth/connectionStringUtils.js\";\nimport { NotificationHubsClientOptions } from \"../models/options.js\";\nimport { SasTokenCredential } from \"../auth/sasTokenCredential.js\";\nimport { Client, getClient } from \"@azure-rest/core-client\";\n\nconst API_VERSION = \"2020-06\";\n\n/**\n * Represents the Notification Hubs SDK client context.\n */\nexport interface NotificationHubsClientContext {\n /**\n * @internal\n */\n sendRequest(request: PipelineRequest): Promise<PipelineResponse>;\n\n /**\n * @internal\n */\n createHeaders(operationName: string, rawHeaders?: Record<string, string>): Promise<HttpHeaders>;\n\n /**\n * @internal\n */\n requestUrl(): URL;\n}\n\n/**\n * Creates a NotificationHubClient from the Access Policy connection string and hub name.\n * @param connectionString - The Access Policy connection string for the notification hub.\n * @param hubName - The notification hub name.\n * @returns A NotificationHubsClientContext initialized from the connection string and hub name.\n */\nexport function createClientContext(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n): NotificationHubsClientContext {\n return new NotificationHubsServiceClient(connectionString, hubName, options);\n}\n\nclass NotificationHubsServiceClient implements NotificationHubsClientContext {\n sasTokenCredential: SasTokenCredential;\n baseUrl: string;\n hubName: string;\n client: Client;\n httpClient: HttpClient;\n\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this.hubName = hubName;\n\n const parsedConnection = parseNotificationHubsConnectionString(connectionString);\n // Node doesn't allow change in protocol but browsers do, so doing a string replace\n this.baseUrl = parsedConnection.endpoint.replace(\"sb://\", \"https://\");\n this.sasTokenCredential = createTokenCredentialFromConnection(\n parsedConnection.sharedAccessKey,\n parsedConnection.sharedAccessKeyName,\n );\n\n const packageDetails = `azsdk-js-notificationhubs/${constants.SDK_VERSION}`;\n const userAgentPrefix = options.userAgentOptions?.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n this.httpClient = options?.httpClient ?? createDefaultHttpClient();\n this.client = getClient(this.baseUrl, {\n userAgentOptions: {\n userAgentPrefix,\n },\n ...options,\n });\n }\n\n async createHeaders(\n operationName: string,\n rawHeaders?: Record<string, string>,\n ): Promise<HttpHeaders> {\n const authorization = await this.sasTokenCredential.getToken(this.baseUrl);\n if (!authorization) {\n throw new RestError(\"Failed to get the authorization header\", { statusCode: 401 });\n }\n\n const headers = createHttpHeaders(rawHeaders);\n headers.set(\"Authorization\", authorization.token);\n headers.set(\"x-ms-version\", API_VERSION);\n headers.set(\n \"x-ms-azsdk-telemetry\",\n `class=NotificationHubsServiceClient;method=${operationName}`,\n );\n\n return headers;\n }\n\n sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n return this.client.pipeline.sendRequest(this.httpClient, request);\n }\n\n requestUrl(): URL {\n const url = new URL(this.baseUrl);\n url.pathname = this.hubName;\n url.searchParams.set(\"api-version\", API_VERSION);\n\n return url;\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Helper TypeGuard that checks if something is defined or not.\n * @param thing - Anything\n * @internal\n */\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return typeof thing !== \"undefined\" && thing !== null;\n}\n\n/**\n * Helper TypeGuard that checks if something is a string or not.\n * @param thing - Anything\n * @internal\n */\nexport function isString(thing: unknown): thing is string {\n return typeof thing === \"string\" || thing instanceof String;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given string,\n * or throws error if undefined.\n */\nexport function getString(value: unknown, nameOfProperty: string): string {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a string value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given input,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getStringOrUndefined(value: any): string | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n return value.toString();\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or throws error if undefined.\n */\nexport function getInteger(value: unknown, nameOfProperty: string): number {\n const result = getIntegerOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getIntegerOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseInt(value.toString());\n return isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or throws error if undefined.\n */\nexport function getFloat(value: unknown, nameOfProperty: string): number {\n const result = getFloatOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getFloatOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseFloat(value.toString());\n return Number.isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type.\n */\nexport function getDate(value: string, nameOfProperty: string): Date {\n const result = getDateOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a Date value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getDateOrUndefined(value: any): Date | undefined {\n const stringValue = getStringOrUndefined(value);\n if (stringValue === undefined) {\n return undefined;\n }\n const result = new Date(stringValue.toString());\n return Number.isNaN(+result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to parse tags from a comma separated string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTagsOrUndefined(value?: any): string[] | undefined {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n return undefined;\n }\n return result.split(\",\");\n}\n\nexport type NullableRecord = Record<string, string | undefined>;\nexport type NonNullableRecord = Record<string, NonNullable<NullableRecord[string]>>;\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationHubsMessageResponse,\n RegistrationResult,\n} from \"../models/notificationDetails.js\";\nimport { getInteger, getString, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\nexport async function parseNotificationOutcome(\n bodyText: string,\n): Promise<NotificationHubsMessageResponse> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const outcome = xml.NotificationOutcome;\n\n return {\n successCount: getInteger(outcome.Success, \"Success\"),\n failureCount: getInteger(outcome.Failure, \"Failure\"),\n results: parseRegistrationResults(outcome.Results.RegistrationResult),\n state: \"DetailedStateAvailable\",\n };\n}\n\nfunction parseRegistrationResults(results?: Record<string, any>): RegistrationResult[] {\n const registrationResults: RegistrationResult[] = [];\n\n if (!isDefined(results)) {\n return registrationResults;\n }\n\n const resultsArray = Array.isArray(results) ? results : [results];\n\n for (const result of resultsArray) {\n registrationResults.push({\n applicationPlatform: getString(result.ApplicationPlatform, \"ApplicationPlatform\"),\n registrationId: getString(result.RegistrationId, \"RegistrationId\"),\n outcome: getString(result.Outcome, \"Outcome\"),\n pnsHandle: getString(result.PnsHandle, \"PnsHandle\"),\n });\n }\n\n return registrationResults;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { isDefined } from \"./utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * Marker for atom metadata.\n *\n * @internal\n */\nexport const XML_METADATA_MARKER = \"$\";\n\n/**\n * Marker for atom value.\n *\n * @internal\n */\nexport const XML_VALUE_MARKER = \"_\";\n\n/**\n * @internal\n * Helps in differentiating JSON like objects from other kinds of objects.\n */\nconst EMPTY_JSON_OBJECT_CONSTRUCTOR = {}.constructor;\n\n/**\n * @internal\n * Returns `true` if given input is a JSON like object.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isJSONLikeObject(value: any): boolean {\n // `value.constructor === {}.constructor` differentiates among the \"object\"s,\n // would filter the JSON objects and won't match any array or other kinds of objects\n\n // -------------------------------------------------------------------------------\n // Few examples | typeof obj ===\"object\" | obj.constructor==={}.constructor\n // -------------------------------------------------------------------------------\n // {abc:1} | true | true\n // [\"a\",\"b\"] | true | false\n // [{\"a\":1},{\"b\":2}] | true | false\n // new Date() | true | false\n // 123 | false | false\n // -------------------------------------------------------------------------------\n return typeof value === \"object\" && value.constructor === EMPTY_JSON_OBJECT_CONSTRUCTOR;\n}\n\n/**\n * @internal\n * The key-value pairs having undefined/null as the values would lead to the empty tags in the serialized XML request.\n * Empty tags in the request body is problematic because of the following reasons.\n * - ATOM based management operations throw a \"Bad Request\" error if empty tags are included in the XML request body at top level.\n * - At the inner levels, Service assigns the empty strings as values to the empty tags instead of throwing an error.\n *\n * This method recursively removes the key-value pairs with undefined/null as the values from the request object that is to be serialized.\n *\n */\nexport function sanitizeSerializableObject(resource: { [key: string]: any }): void {\n Object.keys(resource).forEach(function (property) {\n if (!isDefined(resource[property])) {\n delete resource[property];\n } else if (isJSONLikeObject(resource[property])) {\n sanitizeSerializableObject(resource[property]);\n }\n });\n}\n\n/**\n * @internal\n * Serializes input information to construct the Atom XML request\n * @param resourceName - Name of the resource to be serialized like `QueueDescription`\n * @param resource - The entity details\n * @returns An object to be serialized into a string.\n */\nexport function serializeToAtomXmlRequest(\n resourceName: string,\n resource: unknown,\n): Record<string, unknown> {\n const content: any = {};\n\n content[resourceName] = Object.assign({}, resource);\n sanitizeSerializableObject(content[resourceName]);\n\n content[resourceName][XML_METADATA_MARKER] = {\n xmlns: \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\",\n \"xmlns:i\": \"http://www.w3.org/2001/XMLSchema-instance\",\n };\n\n content[XML_METADATA_MARKER] = { type: \"application/xml\" };\n const requestDetails: Record<string, unknown> = {\n updated: new Date().toISOString(),\n content: content,\n };\n requestDetails[XML_METADATA_MARKER] = {\n xmlns: \"http://www.w3.org/2005/Atom\",\n };\n return requestDetails;\n}\n\n/**\n * @internal\n * Parses the XML message from a Notification Hubs response\n * @param bodyText - The HTTP response body.\n * @returns The notification details if any from the XML.\n */\nexport async function parseXMLError(bodyText: string): Promise<string | undefined> {\n let result: string | undefined;\n const xmlError = await parseXML(bodyText, { includeRoot: true });\n const detail = xmlError[\"Error\"][\"Detail\"];\n if (isDefined(detail)) {\n return detail;\n }\n\n return result;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n HttpHeaders,\n HttpMethods,\n PipelineRequest,\n PipelineResponse,\n RestError,\n createPipelineRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"../../models/notificationDetails.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { isDefined } from \"../../utils/utils.js\";\nimport { parseNotificationOutcome } from \"../../serializers/notificationOutcomeSerializer.js\";\nimport { parseXMLError } from \"../../utils/xmlUtils.js\";\n\nexport function createRequest(\n endpoint: URL,\n method: HttpMethods,\n headers: HttpHeaders,\n options: OperationOptions,\n): PipelineRequest {\n return createPipelineRequest({\n ...options.tracingOptions,\n ...options.requestOptions,\n url: endpoint.toString(),\n abortSignal: options.abortSignal,\n method,\n headers,\n });\n}\n\n/**\n * Parses the HTTP response and creates a NotificationHubsResponse with header information from the operation.\n * @param response - The HTTP response used to populate the result.\n * @returns A NotificationHubsResponse with header information from the operation.\n */\nexport function parseNotificationResponse(response: PipelineResponse): NotificationHubsResponse {\n const correlationId = response.headers.get(\"x-ms-correlation-request-id\");\n const trackingId = response.headers.get(\"TrackingId\");\n const location = response.headers.get(\"Location\");\n\n return {\n correlationId,\n trackingId,\n location,\n };\n}\n\n/**\n * Parses the HTTP response and creates a NotificationHubsMessageResponse with results from the notification.\n * @param response - The HTTP response used to populate the result.\n * @returns A NotificationHubsMessageResponse with results from the notification.\n */\nexport async function parseNotificationSendResponse(\n response: PipelineResponse,\n): Promise<NotificationHubsMessageResponse> {\n const result = parseNotificationResponse(response);\n let notificationId: string | undefined;\n if (result.location) {\n const locationUrl = new URL(result.location);\n notificationId = locationUrl.pathname.split(\"/\")[3];\n }\n\n const requestUrl = new URL(response.request.url);\n const isTestSend = requestUrl.searchParams.has(\"test\");\n const isDirectSend = requestUrl.searchParams.has(\"direct\");\n\n // Only broadcast/tag based sends are supported for test send\n const responseBody = response.bodyAsText;\n if (isTestSend && !isDirectSend && isDefined(responseBody)) {\n const outcome = await parseNotificationOutcome(responseBody);\n return {\n ...result,\n ...outcome,\n notificationId,\n };\n } else {\n return createDefaultResponse(result, notificationId);\n }\n}\n\nfunction createDefaultResponse(\n response: NotificationHubsResponse,\n notificationId?: string,\n): NotificationHubsMessageResponse {\n return {\n ...response,\n notificationId,\n successCount: 0,\n failureCount: 0,\n results: [],\n state: \"Enqueued\",\n };\n}\n\n/**\n * Sends a request through the client context.\n * @param context - The client context to use.\n * @param request - The HTTP request to send.\n * @param successStatusCode - A status code or list of status codes to check for success.\n * @returns The HTTP Response.\n */\nexport async function sendRequest(\n context: NotificationHubsClientContext,\n request: PipelineRequest,\n successStatusCode: number | number[],\n): Promise<PipelineResponse> {\n const statuses: number[] = Array.isArray(successStatusCode)\n ? successStatusCode\n : [successStatusCode];\n\n const response = await context.sendRequest(request);\n\n if (!statuses.some((statusCode) => statusCode === response.status)) {\n const responseBody = response.bodyAsText;\n let details: string | undefined;\n if (isDefined(responseBody)) {\n try {\n details = await parseXMLError(responseBody);\n } catch (err) {\n // eslint-disable no-empty\n }\n }\n\n let errorMessage: string | undefined;\n if (isDefined(details)) {\n errorMessage = `operations failed with: ${details}`;\n } else {\n errorMessage = `operation failed with status ${response.status}`;\n }\n\n throw new RestError(errorMessage, {\n statusCode: response.status,\n response,\n });\n }\n\n return response;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationHubJob,\n NotificationHubJobStatus,\n NotificationHubJobType,\n} from \"../models/notificationHubJob.js\";\nimport {\n getDateOrUndefined,\n getFloatOrUndefined,\n getString,\n getStringOrUndefined,\n isDefined,\n} from \"../utils/utils.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { serializeToAtomXmlRequest } from \"../utils/xmlUtils.js\";\n\n/**\n * @internal\n * Serializes a NotificationHubJob into an Atom XML entry.\n * @param entry - The NotificationHubJob to turn into an Atom XML entry.\n * @returns An Atom XML entry containing the notification hub job.\n */\nexport function serializeNotificationHubJobEntry(entry: NotificationHubJob): string {\n const job: Record<string, any> = {\n Type: entry.type,\n OutputContainerUri: { __cdata: entry.outputContainerUrl },\n ImportFileUri: isDefined(entry.importFileUrl) ? { __cdata: entry.importFileUrl } : undefined,\n };\n\n const requestObject = serializeToAtomXmlRequest(\"NotificationHubJob\", job);\n\n return stringifyXML(requestObject, { rootName: \"entry\", cdataPropName: \"__cdata\" });\n}\n\n/**\n * Parses an Atom XML of an notification hub job entry.\n * @param bodyText - The incoming Atom XML entry to parse into a notification hub job.\n * @returns A parsed NotificationHubJob.\n */\nexport async function parseNotificationHubJobEntry(bodyText: string): Promise<NotificationHubJob> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const content = xml.entry.content.NotificationHubJob;\n return createNotificationHubJob(content);\n}\n\n/**\n * Parses an Atom XML feed of notification hub jobs.\n * @param bodyText - The incoming Atom XML feed to parse into notification hub jobs.\n * @returns A list of notification hub jobs.\n */\nexport async function parseNotificationHubJobFeed(bodyText: string): Promise<NotificationHubJob[]> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const results: NotificationHubJob[] = [];\n\n if (!isDefined(xml.feed.entry)) {\n return results;\n }\n\n const entries = Array.isArray(xml.feed.entry) ? xml.feed.entry : [xml.feed.entry];\n\n for (const item of entries) {\n results.push(createNotificationHubJob(item.content.NotificationHubJob));\n }\n\n return results;\n}\n\nfunction createInputOutputProperties(content: Record<string, any>): Record<string, string> {\n const props: Record<string, string> = {};\n\n const keyValues = content[\"d3p1:KeyValueOfstringstring\"];\n const keyValueArray = Array.isArray(keyValues) ? keyValues : [keyValues];\n for (const item of keyValueArray) {\n props[item[\"d3p1:Key\"]] = item[\"d3p1:Value\"];\n }\n\n return props;\n}\n\nfunction createNotificationHubJob(content: Record<string, any>): NotificationHubJob {\n let outputProperties: Record<string, string> | undefined;\n if (isDefined(content[\"OutputProperties\"])) {\n outputProperties = createInputOutputProperties(content[\"OutputProperties\"]);\n }\n\n let inputProperties: Record<string, string> | undefined;\n if (isDefined(content[\"InputProperties\"])) {\n inputProperties = createInputOutputProperties(content[\"InputProperties\"]);\n }\n\n return {\n jobId: getStringOrUndefined(content[\"JobId\"]),\n type: getString(content[\"Type\"], \"type\") as NotificationHubJobType,\n status: getStringOrUndefined(content[\"Status\"]) as NotificationHubJobStatus,\n progress: getFloatOrUndefined(content[\"Progress\"]),\n outputContainerUrl: getString(content[\"OutputContainerUri\"], \"outputContainerUrl\"),\n importFileUrl: getStringOrUndefined(content[\"ImportFileUri\"]),\n failure: getStringOrUndefined(content[\"Failure\"]),\n createdAt: getDateOrUndefined(content[\"CreatedAt\"]),\n updatedAt: getDateOrUndefined(content[\"UpdatedAt\"]),\n inputProperties,\n outputProperties,\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { SDK_VERSION } from \"./constants.js\";\nimport { createTracingClient } from \"@azure/core-tracing\";\n\n/**\n * A tracing client to handle spans.\n * @internal\n */\nexport const tracingClient = createTracingClient({\n namespace: \"Microsoft.NotificationHubs\",\n packageName: \"@azure/notification-hubs\",\n packageVersion: SDK_VERSION,\n});\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { parseNotificationHubJobEntry } from \"../serializers/notificationHubJobSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getNotificationHubJob\";\n\n/**\n * Gets a Notification Hub Job by the ID.\n * @param context - The Notification Hubs client.\n * @param jobId - The Notification Hub Job ID.\n * @param options - The operation options.\n * @returns The Notification Hub Job with the matching ID.\n */\nexport function getNotificationHubJob(\n context: NotificationHubsClientContext,\n jobId: string,\n options: OperationOptions = {},\n): Promise<NotificationHubJob> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/jobs/${jobId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationHubJobEntry(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport {\n parseNotificationHubJobEntry,\n serializeNotificationHubJobEntry,\n} from \"../serializers/notificationHubJobSerializer.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"submitNotificationHubJob\";\n\n/**\n * Submits a Notification Hub Job.\n * Note: this is available to Standard SKU namespace and above.\n * @param context - The Notification Hubs client.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\nexport function submitNotificationHubJob(\n context: NotificationHubsClientContext,\n job: NotificationHubJob,\n options: OperationOptions = {},\n): Promise<NotificationHubJob> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/jobs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = serializeNotificationHubJobEntry(job);\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationHubJobEntry(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { CancelOnProgress, OperationState, SimplePollerLike } from \"@azure/core-lro\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PolledOperationOptions } from \"../models/options.js\";\nimport { delay } from \"@azure/core-util\";\nimport { getNotificationHubJob } from \"./getNotificationHubJob.js\";\nimport { submitNotificationHubJob } from \"./submitNotificationHubJob.js\";\n\n/**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param context - The Notification Hubs client.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\nexport async function beginSubmitNotificationHubJob(\n context: NotificationHubsClientContext,\n notificationHubJob: NotificationHubJob,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<NotificationHubJobPoller> {\n let submittedJob = await submitNotificationHubJob(\n context,\n notificationHubJob,\n polledOperationOptions,\n );\n\n type Handler = (state: OperationState<NotificationHubJob>) => void;\n\n const state: OperationState<NotificationHubJob> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<NotificationHubJob> | undefined;\n let cancelJob: (() => void) | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: SimplePollerLike<OperationState<NotificationHubJob>, NotificationHubJob> = {\n async poll(options?: { abortSignal?: AbortSignalLike }): Promise<void> {\n submittedJob = await getNotificationHubJob(context, submittedJob.jobId!, options);\n if (submittedJob.status === \"Running\" || submittedJob.status === \"Started\") {\n state.status = \"running\";\n }\n\n if (submittedJob.status === \"Completed\") {\n state.status = \"succeeded\";\n state.result = submittedJob;\n }\n\n if (submittedJob.status === \"Failed\") {\n state.status = \"failed\";\n state.error = new Error(submittedJob.failure);\n }\n\n await processProgressCallbacks();\n\n if (state.status === \"canceled\") {\n throw new Error(\"Operation was canceled\");\n }\n if (state.status === \"failed\") {\n throw state.error;\n }\n },\n\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<NotificationHubJob> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone()) {\n await poller.poll({ abortSignal });\n while (!poller.isDone()) {\n await delay(currentPollIntervalInMs, { abortSignal });\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n return poller.getResult() as NotificationHubJob;\n case \"canceled\":\n throw new Error(\"Operation was canceled\");\n case \"failed\":\n throw state.error;\n case \"notStarted\":\n case \"running\":\n throw new Error(`Polling completed without succeeding or failing`);\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(callback: (state: OperationState<NotificationHubJob>) => void): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n stopPolling(): void {\n abortController.abort();\n cancelJob?.();\n },\n\n isStopped(): boolean {\n return resultPromise === undefined;\n },\n\n getOperationState(): OperationState<NotificationHubJob> {\n return state;\n },\n\n getResult(): NotificationHubJob | undefined {\n return state.result;\n },\n\n toString() {\n return JSON.stringify({ state });\n },\n };\n\n return poller;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"cancelScheduledNotification\";\n\n/**\n * Cancels the scheduled notification with the given notification ID.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param notificationId - The notification ID from the scheduled notification.\n * @param options - The operation options.\n * @returns A notification hub response with correlation ID and tracking ID.\n */\nexport function cancelScheduledNotification(\n context: NotificationHubsClientContext,\n notificationId: string,\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/schedulednotifications/${notificationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { Installation } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createOrUpdateInstallation\";\n\n/**\n * Creates or overwrites an installation to a Notification Hub.\n * @param context - The Notification Hubs client.\n * @param installation - The installation to create or overwrite.\n * @param options - Configuration options for the create or update installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function createOrUpdateInstallation(\n context: NotificationHubsClientContext,\n installation: Installation,\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installation.installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"PUT\", headers, updatedOptions);\n request.body = JSON.stringify(installation);\n\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AdmRegistrationDescription,\n AdmTemplateRegistrationDescription,\n AppleRegistrationDescription,\n AppleTemplateRegistrationDescription,\n BaiduRegistrationDescription,\n BaiduTemplateRegistrationDescription,\n BrowserRegistrationDescription,\n BrowserTemplateRegistrationDescription,\n GcmRegistrationDescription,\n GcmTemplateRegistrationDescription,\n FcmV1RegistrationDescription,\n FcmV1TemplateRegistrationDescription,\n MpnsRegistrationDescription,\n MpnsTemplateRegistrationDescription,\n RegistrationDescription,\n RegistrationDescriptionCommon,\n TemplateRegistrationDescription,\n XiaomiRegistrationDescription,\n XiaomiTemplateRegistrationDescription,\n WindowsRegistrationDescription,\n WindowsTemplateRegistrationDescription,\n} from \"../models/registration.js\";\nimport {\n getDateOrUndefined,\n getString,\n getStringOrUndefined,\n getTagsOrUndefined,\n isDefined,\n} from \"../utils/utils.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { serializeToAtomXmlRequest } from \"../utils/xmlUtils.js\";\n\n/**\n * Represents a registration description parser from the incoming XML.\n */\nexport interface RegistrationDescriptionParser {\n /**\n * @internal\n * Creates a registration type from the incoming entry.\n */\n parseRegistrationEntry: (bodyText: string) => Promise<RegistrationDescription>;\n /**\n * @internal\n * Creates a list of registrations from an incoming ATOM XML Feed.\n */\n parseRegistrationFeed: (bodyText: string) => Promise<RegistrationDescription[]>;\n /**\n * @internal\n * Creates an Amazon Device Messaging (ADM) registration description from the incoming parsed XML.\n */\n createAdmRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => AdmRegistrationDescription;\n /**\n * @internal\n * Creates an Amazon Device Messaging (ADM) template registration description from the incoming parsed XML.\n */\n createAdmTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => AdmTemplateRegistrationDescription;\n /**\n * @internal\n * Creates an Apple Platform Notification Services (APNs) registration description from the incoming parsed XML.\n */\n createAppleRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => AppleRegistrationDescription;\n /**\n * @internal\n * Creates an Apple Platform Notification Services (APNs) template registration description from the incoming parsed XML.\n */\n createAppleTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => AppleTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Baidu registration description from the incoming parsed XML.\n */\n createBaiduRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => BaiduRegistrationDescription;\n /**\n * @internal\n * Creates a Baidu template registration description from the incoming parsed XML.\n */\n createBaiduTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => BaiduTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Web Push registration description from the incoming parsed XML.\n */\n createBrowserRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => BrowserRegistrationDescription;\n /**\n * @internal\n * Creates a Web Push template registration description from the incoming parsed XML.\n */\n createBrowserTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => BrowserTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Firebase V1 Cloud Messaging (FCM) registration description from the incoming parsed XML.\n */\n createFcmV1RegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => FcmV1RegistrationDescription;\n /**\n * @internal\n * Creates a Firebase V1 Cloud Messaging (FCM) template registration description from the incoming parsed XML.\n */\n createFcmV1TemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => FcmV1TemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Google Cloud Messaging (GCM) registration description from the incoming parsed XML.\n */\n createGcmRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => GcmRegistrationDescription;\n /**\n * @internal\n * Creates a Google Cloud Messaging (GCM) template registration description from the incoming parsed XML.\n */\n createGcmTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => GcmTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Microsoft Phone Notification Services (MPNS) registration description from the incoming parsed XML.\n */\n createMpnsRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => MpnsRegistrationDescription;\n /**\n * @internal\n * Creates a Microsoft Phone Notification Services (MPNS) template registration description from the incoming parsed XML.\n */\n createMpnsTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => MpnsTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Xiaomi registration description from the incoming parsed XML.\n */\n createXiaomiRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => XiaomiRegistrationDescription;\n /**\n * @internal\n * Creates a Xiaomi template registration description from the incoming parsed XML.\n */\n createXiaomiTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => XiaomiTemplateRegistrationDescription;\n /**\n * @internal\n * Creates a Windows Notification Services (WNS) registration description from the incoming parsed XML.\n */\n createWindowsRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => WindowsRegistrationDescription;\n /**\n * @internal\n * Creates a Windows Notification Services (WNS) template registration description from the incoming parsed XML.\n */\n createWindowsTemplateRegistrationDescription: (\n rawRegistrationDescription: Record<string, any>,\n ) => WindowsTemplateRegistrationDescription;\n}\n\nexport const registrationDescriptionParser: RegistrationDescriptionParser = {\n /**\n * @internal\n * Creates a registration type from the incoming entry.\n */\n async parseRegistrationEntry(bodyText: string): Promise<RegistrationDescription> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n delete xml.entry.content[\"$\"];\n const keyName = Object.keys(xml.entry.content)[0];\n const content = xml.entry.content[keyName];\n const methodName = `create${keyName}`;\n\n const method = this[methodName as keyof RegistrationDescriptionParser] as any;\n if (!methodName) {\n throw new RestError(`${keyName} is not a supported registration type`, { statusCode: 500 });\n }\n\n return method.call(this, content) as RegistrationDescription;\n },\n\n /**\n * @internal\n * Creates a list of registrations from an incoming ATOM XML Feed.\n */\n async parseRegistrationFeed(bodyText: string): Promise<RegistrationDescription[]> {\n const xml = await parseXML(bodyText, { includeRoot: true });\n const results: RegistrationDescription[] = [];\n if (!isDefined(xml.feed.entry)) {\n return results;\n }\n\n const entries = Array.isArray(xml.feed.entry) ? xml.feed.entry : [xml.feed.entry];\n\n for (const entry of entries) {\n delete entry.content[\"$\"];\n\n const keyName = Object.keys(entry.content)[0];\n const methodName = `create${keyName}`;\n const content = entry.content[keyName];\n const method = this[methodName as keyof RegistrationDescriptionParser] as any;\n if (!methodName) {\n throw new RestError(`${keyName} is not a supported registration type`, { statusCode: 500 });\n }\n\n results.push(method.call(this, content) as RegistrationDescription);\n }\n\n return results;\n },\n\n /**\n * @internal\n * Creates an ADM registration description from incoming XML property bag.\n */\n createAdmRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): AdmRegistrationDescription {\n return {\n admRegistrationId: getString(\n rawRegistrationDescription[\"AdmRegistrationId\"],\n \"admRegistrationId\",\n ),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Adm\",\n };\n },\n\n /**\n * @internal\n * Creates an ADM template registration description from incoming XML property bag.\n */\n createAdmTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): AdmTemplateRegistrationDescription {\n return {\n ...this.createAdmRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"AdmTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates an Apple registration description from incoming XML property bag.\n */\n createAppleRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): AppleRegistrationDescription {\n return {\n deviceToken: getString(rawRegistrationDescription[\"DeviceToken\"], \"deviceToken\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Apple\",\n };\n },\n\n /**\n * @internal\n * Creates an Apple template registration description from incoming XML property bag.\n */\n createAppleTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): AppleTemplateRegistrationDescription {\n return {\n priority: getStringOrUndefined(rawRegistrationDescription[\"Priority\"]) as \"10\" | \"5\",\n apnsHeaders: getHeadersOrUndefined(rawRegistrationDescription[\"ApnsHeaders\"]?.[\"ApnsHeader\"]),\n ...this.createAppleRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"AppleTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Baidu registration description from incoming XML property bag.\n */\n createBaiduRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): BaiduRegistrationDescription {\n return {\n baiduChannelId: getString(rawRegistrationDescription[\"BaiduChannelId\"], \"baiduChannelId\"),\n baiduUserId: getString(rawRegistrationDescription[\"BaiduUserId\"], \"baiduUserId\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Baidu\",\n };\n },\n\n /**\n * @internal\n * Creates a Baidu template registration description from incoming XML property bag.\n */\n createBaiduTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): BaiduTemplateRegistrationDescription {\n return {\n ...this.createBaiduRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"BaiduTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Browser registration description from incoming XML property bag.\n */\n createBrowserRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): BrowserRegistrationDescription {\n return {\n endpoint: getString(rawRegistrationDescription[\"Endpoint\"], \"endpoint\"),\n p256dh: getString(rawRegistrationDescription[\"P256DH\"], \"p256dh\"),\n auth: getString(rawRegistrationDescription[\"Auth\"], \"auth\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Browser\",\n };\n },\n\n /**\n * @internal\n * Creates a Browser template registration description from incoming XML property bag.\n */\n createBrowserTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): BrowserTemplateRegistrationDescription {\n return {\n ...this.createBrowserRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"BrowserTemplate\",\n };\n },\n /**\n * @internal\n * Creates an GCM registration description from incoming XML property bag.\n */\n createFcmV1RegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): FcmV1RegistrationDescription {\n return {\n fcmV1RegistrationId: getString(\n rawRegistrationDescription[\"FcmV1RegistrationId\"],\n \"fcmV1RegistrationId\",\n ),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"FcmV1\",\n };\n },\n\n /**\n * @internal\n * Creates an FCM template registration description from incoming XML property bag.\n */\n createFcmV1TemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): FcmV1TemplateRegistrationDescription {\n return {\n ...this.createFcmV1RegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"FcmV1Template\",\n };\n },\n\n /**\n * @internal\n * Creates an GCM registration description from incoming XML property bag.\n */\n createGcmRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): GcmRegistrationDescription {\n return {\n gcmRegistrationId: getString(\n rawRegistrationDescription[\"GcmRegistrationId\"],\n \"gcmRegistrationId\",\n ),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Gcm\",\n };\n },\n\n /**\n * @internal\n * Creates an FCM template registration description from incoming XML property bag.\n */\n createGcmTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): GcmTemplateRegistrationDescription {\n return {\n ...this.createGcmRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"GcmTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Windows Phone registration description from incoming XML property bag.\n */\n createMpnsRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): MpnsRegistrationDescription {\n return {\n channelUri: getString(rawRegistrationDescription[\"ChannelUri\"], \"channelUri\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Mpns\",\n };\n },\n\n /**\n * @internal\n * Creates a Windows Phone template registration description from incoming XML property bag.\n */\n createMpnsTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): MpnsTemplateRegistrationDescription {\n return {\n mpnsHeaders: getHeadersOrUndefined(rawRegistrationDescription[\"MpnsHeaders\"]?.[\"MpnsHeader\"]),\n ...this.createWindowsRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"MpnsTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Xiaomi registration description from incoming XML property bag.\n */\n createXiaomiRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): XiaomiRegistrationDescription {\n return {\n xiaomiRegistrationId: getString(\n rawRegistrationDescription[\"XiaomiRegistrationId\"],\n \"xiaomiRegistrationId\",\n ),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Xiaomi\",\n };\n },\n\n /**\n * @internal\n * Creates a Xiaomi template registration description from incoming XML property bag.\n */\n createXiaomiTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): XiaomiTemplateRegistrationDescription {\n return {\n ...this.createXiaomiRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"XiaomiTemplate\",\n };\n },\n\n /**\n * @internal\n * Creates a Windows registration description from incoming XML property bag.\n */\n createWindowsRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): WindowsRegistrationDescription {\n return {\n channelUri: getString(rawRegistrationDescription[\"ChannelUri\"], \"channelUri\"),\n ...createRegistrationDescription(rawRegistrationDescription),\n kind: \"Windows\",\n };\n },\n\n /**\n * @internal\n * Creates a Windows template registration description from incoming XML property bag.\n */\n createWindowsTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n ): WindowsTemplateRegistrationDescription {\n return {\n wnsHeaders: getHeadersOrUndefined(rawRegistrationDescription[\"WnsHeaders\"]?.[\"WnsHeader\"]),\n ...this.createWindowsRegistrationDescription(rawRegistrationDescription),\n ...createTemplateRegistrationDescription(rawRegistrationDescription),\n kind: \"WindowsTemplate\",\n };\n },\n};\n\nfunction getHeadersOrUndefined(\n value?: { Header: string; Value: string }[],\n): Record<string, string> | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n\n const headerObj: Record<string, string> = {};\n for (const { Header, Value } of value) {\n headerObj[Header] = Value;\n }\n\n return headerObj;\n}\n\nfunction createRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n): Omit<RegistrationDescriptionCommon, \"kind\"> {\n let pushVariables: Record<string, string> | undefined;\n const unparsed = getStringOrUndefined(rawRegistrationDescription[\"PushVariables\"]);\n if (unparsed) {\n pushVariables = JSON.parse(unparsed) as Record<string, string>;\n }\n\n return {\n registrationId: getStringOrUndefined(rawRegistrationDescription[\"RegistrationId\"]),\n expirationTime: getDateOrUndefined(rawRegistrationDescription[\"ExpirationTime\"]),\n etag: getStringOrUndefined(rawRegistrationDescription[\"ETag\"]),\n tags: getTagsOrUndefined(rawRegistrationDescription[\"Tags\"]),\n pushVariables: pushVariables,\n };\n}\n\nfunction createTemplateRegistrationDescription(\n rawRegistrationDescription: Record<string, any>,\n): TemplateRegistrationDescription {\n return {\n bodyTemplate: getString(rawRegistrationDescription[\"BodyTemplate\"], \"bodyTemplate\"),\n templateName: getStringOrUndefined(rawRegistrationDescription[\"TemplateName\"]),\n ...createRegistrationDescription(rawRegistrationDescription),\n };\n}\n\n/**\n * @internal\n * Represents a serializer for all registration descriptions.\n */\nexport interface RegistrationDescriptionSerializer {\n /**\n * @internal\n * Serializes a registration description into an ATOM XML string.\n */\n serializeRegistrationDescription(description: RegistrationDescription): string;\n /**\n * @internal\n * Serializes an Amazon Device Messaging (ADM) registration description into an XML object for serialization.\n */\n serializeAdmRegistrationDescription(\n description: Omit<AdmRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes an Amazon Device Messaging (ADM) template registration description into an XML object for serialization.\n */\n serializeAdmTemplateRegistrationDescription(\n description: Omit<AdmTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes an Apple registration description into an XML object for serialization.\n */\n serializeAppleRegistrationDescription(\n description: Omit<AppleRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes an Apple template registration description into an XML object for serialization.\n */\n serializeAppleTemplateRegistrationDescription(\n description: Omit<AppleRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Baidu registration description into an XML object for serialization.\n */\n serializeBaiduRegistrationDescription(\n description: Omit<BaiduRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Baidu template registration description into an XML object for serialization.\n */\n serializeBaiduTemplateRegistrationDescription(\n description: Omit<BaiduTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Web Push registration description into an XML object for serialization.\n */\n serializeBrowserRegistrationDescription(\n description: Omit<BrowserRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Web Push template registration description into an XML object for serialization.\n */\n serializeBrowserTemplateRegistrationDescription(\n description: Omit<BrowserTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Google Cloud Messaging (GCM) registration description into an XML object for serialization.\n */\n serializeFcmV1RegistrationDescription(\n description: Omit<FcmV1RegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Google Cloud Messaging (GCM) template registration description into an XML object for serialization.\n */\n serializeFcmV1TemplateRegistrationDescription(\n description: Omit<FcmV1TemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Google Cloud Messaging (GCM) registration description into an XML object for serialization.\n */\n serializeGcmRegistrationDescription(\n description: Omit<GcmRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Google Cloud Messaging (GCM) template registration description into an XML object for serialization.\n */\n serializeGcmTemplateRegistrationDescription(\n description: Omit<GcmTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Windows Phone registration description into an XML object for serialization.\n */\n serializeMpnsRegistrationDescription(\n description: Omit<MpnsRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Windows Phone template registration description into an XML object for serialization.\n */\n serializeMpnsTemplateRegistrationDescription(\n description: Omit<MpnsTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Xiaomi registration description into an XML object for serialization.\n */\n serializeXiaomiRegistrationDescription(\n description: Omit<XiaomiRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Xiaomi template registration description into an XML object for serialization.\n */\n serializeXiaomiTemplateRegistrationDescription(\n description: Omit<XiaomiTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Windows Notification Services (WNS) registration description into an XML object for serialization.\n */\n serializeWindowsRegistrationDescription(\n description: Omit<WindowsRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n /**\n * @internal\n * Serializes a Windows Notification Services (WNS) template registration description into an XML object for serialization.\n */\n serializeWindowsTemplateRegistrationDescription(\n description: Omit<WindowsTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any>;\n}\n\n/**\n * Represents a RegistrationDescription serializer.\n */\nexport const registrationDescriptionSerializer: RegistrationDescriptionSerializer = {\n serializeRegistrationDescription(description: RegistrationDescription): string {\n const rootName = `${description.kind}RegistrationDescription`;\n const methodName = `serialize${rootName}`;\n\n const method = this[methodName as keyof RegistrationDescriptionSerializer].bind(this) as (\n description: RegistrationDescription,\n ) => Record<string, any>;\n if (!isDefined(method)) {\n throw new RestError(`Undefined platform ${description.kind}`, { statusCode: 400 });\n }\n\n const registration = method(description) as Record<string, any>;\n const requestObject = serializeToAtomXmlRequest(rootName, registration);\n\n return stringifyXML(requestObject, { rootName: \"entry\" });\n },\n\n /**\n * @internal\n * Serializes an existing ADM registration description to an object for serialization.\n */\n serializeAdmRegistrationDescription(\n description: Omit<AdmRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n AdmRegistrationId: getString(description.admRegistrationId, \"admRegistrationId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing ADM template registration description to an object for serialization.\n */\n serializeAdmTemplateRegistrationDescription(\n description: Omit<AdmTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeAdmRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Apple registration description to an object for serialization.\n */\n serializeAppleRegistrationDescription(\n description: Omit<AppleRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n DeviceToken: getString(description.deviceToken, \"deviceToken\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Apple template registration description to an object for serialization.\n */\n serializeAppleTemplateRegistrationDescription(\n description: AppleTemplateRegistrationDescription,\n ): Record<string, any> {\n let apnsHeaders: Record<string, any> | undefined;\n if (description.apnsHeaders) {\n apnsHeaders = {\n ApnsHeader: [],\n };\n\n for (const header of Object.keys(description.apnsHeaders)) {\n apnsHeaders[\"ApnsHeader\"].push({\n Header: header,\n Value: description.apnsHeaders[header],\n });\n }\n }\n\n return {\n ...this.serializeAppleRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n Expiry: getStringOrUndefined(description.expiry),\n ApnsHeaders: apnsHeaders,\n };\n },\n\n /**\n * @internal\n * Serializes an existing Baidu registration description to an object for serialization.\n */\n serializeBaiduRegistrationDescription(\n description: Omit<BaiduRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n BaiduChannelId: getString(description.baiduChannelId, \"baiduChannelId\"),\n BaiduUserId: getString(description.baiduUserId, \"baiduUserId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Baidu template registration description to an object for serialization.\n */\n serializeBaiduTemplateRegistrationDescription(\n description: Omit<BaiduTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeBaiduRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Browser registration description to an object for serialization.\n */\n serializeBrowserRegistrationDescription(\n description: Omit<BrowserRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n Endpoint: description.endpoint,\n Auth: description.auth,\n P256DH: description.p256dh,\n };\n },\n\n /**\n * @internal\n * Serializes an existing Browser template registration description to an object for serialization.\n */\n serializeBrowserTemplateRegistrationDescription(\n description: Omit<BrowserTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeBrowserRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing FCM V1 registration description to an object for serialization.\n */\n serializeFcmV1RegistrationDescription(\n description: Omit<FcmV1RegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n FcmV1RegistrationId: getString(description.fcmV1RegistrationId, \"fcmRegistrationId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing FCM V1 template registration description to an object for serialization.\n */\n serializeFcmV1TemplateRegistrationDescription(\n description: Omit<FcmV1TemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeFcmV1RegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing GCM registration description to an object for serialization.\n */\n serializeGcmRegistrationDescription(\n description: Omit<GcmRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n GcmRegistrationId: getString(description.gcmRegistrationId, \"gcmRegistrationId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing GCM template registration description to an object for serialization.\n */\n serializeGcmTemplateRegistrationDescription(\n description: Omit<GcmTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeGcmRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * @deprecated Windows Phone is no longer supported.\n * Serializes an existing MPNS registration description to an object for serialization.\n */\n serializeMpnsRegistrationDescription(\n description: Omit<MpnsRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n ChannelUri: description.channelUri,\n };\n },\n\n /**\n * @internal\n * @deprecated Windows Phone is no longer supported.\n * Serializes an existing MPNS template registration description to an object for serialization.\n */\n serializeMpnsTemplateRegistrationDescription(\n description: Omit<MpnsTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n let mpnsHeaders: Record<string, any> | undefined;\n if (description.mpnsHeaders) {\n mpnsHeaders = {\n MpnsHeader: [],\n };\n\n for (const header of Object.keys(description.mpnsHeaders)) {\n mpnsHeaders[\"MpnsHeader\"].push({\n Header: header,\n Value: description.mpnsHeaders[header],\n });\n }\n }\n\n return {\n ...this.serializeMpnsRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n MpnsHeaders: mpnsHeaders,\n };\n },\n\n /**\n * @internal\n * Serializes an existing Xiaomi registration description to an object for serialization.\n */\n serializeXiaomiRegistrationDescription(\n description: Omit<XiaomiRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n XiaomiRegistrationId: getString(description.xiaomiRegistrationId, \"xiaomiRegistrationId\"),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Xiaomi template registration description to an object for serialization.\n */\n serializeXiaomiTemplateRegistrationDescription(\n description: Omit<XiaomiTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...this.serializeXiaomiRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n };\n },\n\n /**\n * @internal\n * Serializes an existing Windows registration description to an object for serialization.\n */\n serializeWindowsRegistrationDescription(\n description: Omit<WindowsRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n return {\n ...serializeRegistrationDescription(description),\n ChannelUri: description.channelUri,\n };\n },\n\n /**\n * @internal\n * Serializes an existing Windows template registration description to an object for serialization.\n */\n serializeWindowsTemplateRegistrationDescription(\n description: Omit<WindowsTemplateRegistrationDescription, \"kind\">,\n ): Record<string, any> {\n let wnsHeaders: Record<string, any> | undefined;\n if (description.wnsHeaders) {\n wnsHeaders = {\n WnsHeader: [],\n };\n\n for (const header of Object.keys(description.wnsHeaders)) {\n wnsHeaders[\"WnsHeader\"].push({\n Header: header,\n Value: description.wnsHeaders[header],\n });\n }\n }\n\n return {\n ...this.serializeWindowsRegistrationDescription(description),\n ...serializeTemplateRegistrationDescription(description),\n WnsHeaders: wnsHeaders,\n };\n },\n};\n\nfunction serializeRegistrationDescription(\n description: Omit<RegistrationDescriptionCommon, \"kind\">,\n): Record<string, any> {\n let tags: string | undefined;\n if (description.tags) {\n tags = description.tags.join(\",\");\n }\n\n let pushVariables: string | undefined;\n if (description.pushVariables) {\n pushVariables = JSON.stringify(description.pushVariables);\n }\n\n return {\n RegistrationId: getStringOrUndefined(description.registrationId),\n Tags: tags,\n PushVariables: pushVariables,\n };\n}\n\nfunction serializeTemplateRegistrationDescription(\n description: TemplateRegistrationDescription,\n): Record<string, any> {\n return {\n BodyTemplate: { __cdata: description.bodyTemplate },\n TemplateName: getStringOrUndefined(description.templateName),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./_client.js\";\nimport {\n registrationDescriptionParser,\n registrationDescriptionSerializer,\n} from \"../../serializers/registrationSerializer.js\";\nimport { HttpMethods } from \"@azure/core-rest-pipeline\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../../models/registration.js\";\nimport { isDefined } from \"../../utils/utils.js\";\n\n/**\n * @internal\n */\nexport async function createOrUpdateRegistrationDescription(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n operationName: \"create\" | \"createOrUpdate\" | \"update\",\n options: OperationOptions,\n): Promise<RegistrationDescription> {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrations\";\n let httpMethod: HttpMethods = \"POST\";\n\n if (operationName === \"createOrUpdate\" || operationName === \"update\") {\n endpoint.pathname += `/${registration.registrationId}`;\n httpMethod = \"PUT\";\n }\n\n const etag = registration.etag;\n\n // Clear out readonly properties\n registration.registrationId = undefined;\n registration.etag = undefined;\n\n const headers = await context.createHeaders(`${operationName}Registration`);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n if (operationName === \"update\") {\n headers.set(\"If-Match\", isDefined(etag) ? `\"${etag}\"` : \"*\");\n }\n\n const request = createRequest(endpoint, httpMethod, headers, options);\n request.body = registrationDescriptionSerializer.serializeRegistrationDescription(registration);\n const response = await sendRequest(context, request, [200, 201]);\n\n return registrationDescriptionParser.parseRegistrationEntry(response.bodyAsText!);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createOrUpdateRegistration\";\n\n/**\n * Creates or updates a registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\nexport function createOrUpdateRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n return createOrUpdateRegistrationDescription(\n context,\n registration,\n \"createOrUpdate\",\n updatedOptions,\n );\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createRegistrationId\";\n\n/**\n * Creates a new registration ID.\n * @param context - The Notification Hubs client.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\nexport function createRegistrationId(\n context: NotificationHubsClientContext,\n options: OperationOptions = {},\n): Promise<string> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrationIDs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n const response = await sendRequest(context, request, 201);\n\n // In the form: https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/<registrationId>\n const locationHeader = response.headers.get(\"Location\");\n if (!locationHeader || !locationHeader.startsWith(\"https://\")) {\n throw new RestError(`Location header ${locationHeader} is an invalid URL`, {\n statusCode: 500,\n request,\n response,\n });\n }\n const locationUrl = new URL(locationHeader!);\n const registrationId = locationUrl.pathname.split(\"/\")[3];\n\n return registrationId;\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"createRegistration\";\n\n/**\n * Creates a new registration. This method generates a registration ID,\n * which you can subsequently use to retrieve, update, and delete this registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\nexport function createRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n if (registration.registrationId) {\n throw new RestError(\"registrationId must not be set during a create operation\", {\n statusCode: 400,\n });\n }\n\n return createOrUpdateRegistrationDescription(context, registration, \"create\", updatedOptions);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"deleteInstallation\";\n\n/**\n * Deletes an installation from a Notification Hub.\n * @param context - The Notification Hubs client.\n * @param installationId - The installation ID of the installation to delete.\n * @param options - Configuration options for the installation delete operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function deleteInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n const response = await sendRequest(context, request, 204);\n\n return parseNotificationResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { EntityOperationOptions } from \"../models/options.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { isDefined } from \"../utils/utils.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"deleteRegistration\";\n\n/**\n * Deletes a registration with the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The registration ID of the registration to delete.\n * @param options - The options for delete operations including the ETag\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function deleteRegistration(\n context: NotificationHubsClientContext,\n registrationId: string,\n options: EntityOperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/registrations/${registrationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n headers.set(\"If-Match\", isDefined(options.etag) ? `\"${options.etag}\"` : \"*\");\n\n const request = createRequest(endpoint, \"DELETE\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getFeedbackContainerUrl\";\n\n/**\n * Retrieves an Azure Storage container URL. The container has feedback data for the notification hub.\n * The caller can then use the Azure Storage Services SDK to retrieve the contents of the container.\n * @param context - The Notification Hubs client.\n * @param options - The options for getting the push notification feedback container URL.\n * @returns The URL of the Azure Storage Container containing the feedback data.\n */\nexport function getFeedbackContainerUrl(\n context: NotificationHubsClientContext,\n options: OperationOptions = {},\n): Promise<string> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/feedbackcontainer\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return response.bodyAsText!;\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { Installation } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getInstallation\";\n\n/**\n * Gets an Azure Notification Hub installation by the installation ID.\n * @param context - The Notification Hubs client.\n * @param installationId - The ID of the installation to get.\n * @param options - Configuration options for the get installation operation.\n * @returns The installation that matches the installation ID.\n */\nexport function getInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n options: OperationOptions = {},\n): Promise<Installation> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return JSON.parse(response.bodyAsText!) as Installation;\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n NotificationDetails,\n NotificationOutcome,\n NotificationOutcomeState,\n} from \"../models/notificationDetails.js\";\nimport { getDateOrUndefined, getInteger, getStringOrUndefined, isDefined } from \"../utils/utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * @internal\n * Parses a NotificationDetails from incoming XML.\n */\nexport async function parseNotificationDetails(bodyText: string): Promise<NotificationDetails> {\n const xml = await parseXML(bodyText, {\n includeRoot: true,\n });\n const notificationDetails = xml[\"NotificationDetails\"];\n\n let apnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"ApnsOutcomeCounts\"])) {\n apnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"ApnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n let admOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"AdmOutcomeCounts\"])) {\n admOutcomeCounts = parseOutcomeCounts(notificationDetails[\"AdmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let baiduOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"BaiduOutcomeCounts\"])) {\n baiduOutcomeCounts = parseOutcomeCounts(notificationDetails[\"BaiduOutcomeCounts\"][\"Outcome\"]);\n }\n\n let fcmOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"GcmOutcomeCounts\"])) {\n fcmOutcomeCounts = parseOutcomeCounts(notificationDetails[\"GcmOutcomeCounts\"][\"Outcome\"]);\n }\n\n let xiaomiOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"XiaomiOutcomeCounts\"])) {\n xiaomiOutcomeCounts = parseOutcomeCounts(notificationDetails[\"XiaomiOutcomeCounts\"][\"Outcome\"]);\n }\n\n let wnsOutcomeCounts: NotificationOutcome[] | undefined;\n if (isDefined(notificationDetails[\"WnsOutcomeCounts\"])) {\n wnsOutcomeCounts = parseOutcomeCounts(notificationDetails[\"WnsOutcomeCounts\"][\"Outcome\"]);\n }\n\n return {\n notificationId: getStringOrUndefined(notificationDetails[\"NotificationId\"]),\n location: getStringOrUndefined(notificationDetails[\"Location\"]),\n state: getStringOrUndefined(notificationDetails[\"State\"]) as NotificationOutcomeState,\n enqueueTime: getDateOrUndefined(notificationDetails[\"EnqueueTime\"]),\n startTime: getDateOrUndefined(notificationDetails[\"StartTime\"]),\n endTime: getDateOrUndefined(notificationDetails[\"EndTime\"]),\n pnsErrorDetailsUrl: getStringOrUndefined(notificationDetails[\"PnsErrorDetailsUri\"]),\n targetPlatforms: getStringOrUndefined(notificationDetails[\"TargetPlatforms\"]),\n notificationBody: getStringOrUndefined(notificationDetails[\"NotificationBody\"]),\n apnsOutcomeCounts,\n admOutcomeCounts,\n baiduOutcomeCounts,\n fcmOutcomeCounts,\n xiaomiOutcomeCounts,\n wnsOutcomeCounts,\n };\n}\n\nfunction parseOutcomeCounts(\n counts: Record<string, any>[] | Record<string, any>,\n): NotificationOutcome[] {\n const items = Array.isArray(counts) ? counts : [counts];\n const results: NotificationOutcome[] = [];\n for (const item of items) {\n results.push({ state: item[\"Name\"], count: getInteger(item[\"Count\"], \"Count\") });\n }\n\n return results;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationDetails } from \"../models/notificationDetails.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { parseNotificationDetails } from \"../serializers/notificationDetailsSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getNotificationOutcomeDetails\";\n\n/**\n * Retrieves the results of a send operation. This can retrieve intermediate results if the send is being processed\n * or final results if the Send* has completed. This API can only be called for Standard SKU and above.\n * @param context - The Notification Hubs client.\n * @param notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\nexport function getNotificationOutcomeDetails(\n context: NotificationHubsClientContext,\n notificationId: string,\n options: OperationOptions = {},\n): Promise<NotificationDetails> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/messages/${notificationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationDetails(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"getRegistration\";\n\n/**\n * Gets a registration by the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The ID of the registration to get.\n * @param options - The options for getting a registration by ID.\n * @returns A RegistrationDescription that has the given registration ID.\n */\nexport function getRegistration(\n context: NotificationHubsClientContext,\n registrationId: string,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/registrations/${registrationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return registrationDescriptionParser.parseRegistrationEntry(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubJob } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { parseNotificationHubJobFeed } from \"../serializers/notificationHubJobSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listNotificationHubJobs\";\n\n/**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param context - The Notification Hubs client.xs\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\nexport function listNotificationHubJobs(\n context: NotificationHubsClientContext,\n options: OperationOptions = {},\n): Promise<NotificationHubJob[]> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/jobs\";\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/atom+xml;type=entry;charset=utf-8\");\n\n const request = createRequest(endpoint, \"GET\", headers, updatedOptions);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationHubJobFeed(response.bodyAsText!);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./_client.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { RegistrationDescription } from \"../../models/registration.js\";\nimport { RegistrationQueryOptions } from \"../../models/options.js\";\nimport { RegistrationQueryResponse } from \"../../models/response.js\";\nimport { registrationDescriptionParser } from \"../../serializers/registrationSerializer.js\";\n\nexport async function* listRegistrationsAll(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationPagingPage(context, options)) {\n yield* page;\n }\n}\n\nexport async function* listRegistrationPagingPage(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrations(context, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrations(context, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrations(\n context: NotificationHubsClientContext,\n options: RegistrationQueryOptions,\n continuationToken?: string,\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/registrations\";\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (options.filter !== undefined) {\n endpoint.searchParams.set(\"$filter\", options.filter);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(\"listRegistrations\");\n const request = createRequest(endpoint, \"GET\", headers, options);\n const response = await sendRequest(context, request, 200);\n\n const registrations = await registrationDescriptionParser.parseRegistrationFeed(\n response.bodyAsText!,\n );\n const nextToken = response.headers.get(\"x-ms-continuationtoken\");\n return {\n registrations,\n continuationToken: nextToken,\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RegistrationDescription, RegistrationChannel } from \"../models/registration.js\";\nimport { listRegistrationPagingPage, listRegistrationsAll } from \"./internal/_listRegistrations.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param context - The Notification Hubs client.\n * @param channel - The Registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\nexport function listRegistrationsByChannel(\n context: NotificationHubsClientContext,\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const newOptions = {\n ...options,\n filter: getFilterByChannel(channel),\n };\n const { span, updatedOptions } = tracingClient.startSpan(\n \"NotificationHubsClientContext.listRegistrationsByDevice\",\n newOptions,\n );\n try {\n const iter = listRegistrationsAll(context, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationPagingPage(context, updatedOptions);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n\nfunction getFilterByChannel(device: RegistrationChannel): string {\n switch (device.kind) {\n case \"adm\":\n return `AdmRegistrationId eq '${device.admRegistrationId}'`;\n case \"apple\":\n return `DeviceToken eq '${device.deviceToken.toLocaleUpperCase()}'`;\n case \"baidu\":\n return `BaiduChannelId eq ${device.baiduChannelId}' and BaiduUserId eq '${device.baiduUserId}'`;\n case \"browser\":\n return `Endpoint eq '${encodeURIComponent(device.endpoint)}' and P256DH eq '${\n device.p256dh\n }' and Auth eq '${device.auth}'`;\n case \"gcm\":\n return `GcmRegistrationId eq '${device.gcmRegistrationId}'`;\n case \"windows\":\n return `ChannelUri eq '${encodeURIComponent(device.channelUri)}'`;\n default:\n throw new RestError(`Device type is unsupported`, {\n statusCode: 400,\n });\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, sendRequest } from \"./internal/_client.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { RegistrationQueryResponse } from \"../models/response.js\";\nimport { registrationDescriptionParser } from \"../serializers/registrationSerializer.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"listRegistrationsByTag\";\n\n/**\n * Lists all registrations with the matching tag.\n * @param context - The Notification Hubs client.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\nexport function listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const { span, updatedOptions } = tracingClient.startSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n );\n try {\n const iter = listRegistrationsByTagAll(context, tag, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationsByTagPagingPage(context, tag, options);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n\nasync function* listRegistrationsByTagAll(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n): AsyncIterableIterator<RegistrationDescription> {\n for await (const page of listRegistrationsByTagPagingPage(context, tag, options)) {\n yield* page;\n }\n}\n\nasync function* listRegistrationsByTagPagingPage(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n): AsyncIterableIterator<RegistrationDescription[]> {\n let result = await _listRegistrationsByTag(context, tag, options);\n yield result.registrations || [];\n let continuationToken = result.continuationToken;\n while (continuationToken) {\n result = await _listRegistrationsByTag(context, tag, options, continuationToken);\n continuationToken = result.continuationToken;\n yield result.registrations || [];\n }\n}\n\nasync function _listRegistrationsByTag(\n context: NotificationHubsClientContext,\n tag: string,\n options: RegistrationQueryLimitOptions,\n continuationToken?: string,\n): Promise<RegistrationQueryResponse> {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/tags/${tag}/registrations`;\n if (options.top !== undefined) {\n endpoint.searchParams.set(\"$top\", `${options.top}`);\n }\n\n if (continuationToken !== undefined) {\n endpoint.searchParams.set(\"continuationtoken\", continuationToken);\n }\n\n const headers = await context.createHeaders(OPERATION_NAME);\n const request = createRequest(endpoint, \"GET\", headers, options);\n const response = await sendRequest(context, request, 200);\n\n const registrations = await registrationDescriptionParser.parseRegistrationFeed(\n response.bodyAsText!,\n );\n const nextToken = response.headers.get(\"x-ms-continuationtoken\");\n return {\n registrations,\n continuationToken: nextToken,\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RegistrationQueryLimitOptions } from \"../models/options.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\nimport { listRegistrationPagingPage, listRegistrationsAll } from \"./internal/_listRegistrations.js\";\n\n/**\n * Gets all registrations for the notification hub with the given query options.\n * @param context - The Notification Hubs client.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\nexport function listRegistrations(\n context: NotificationHubsClientContext,\n options: RegistrationQueryLimitOptions = {},\n): PagedAsyncIterableIterator<RegistrationDescription> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"NotificationHubsClientContext.listRegistrations\",\n options,\n );\n try {\n const iter = listRegistrationsAll(context, updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return listRegistrationPagingPage(context, updatedOptions);\n },\n };\n } catch (e: any) {\n span.setStatus({ status: \"error\", error: e });\n throw e;\n } finally {\n span.end();\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport { NonNullableRecord } from \"../utils/utils.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { ScheduleNotificationOptions } from \"../models/options.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleNotification(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions = {},\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.scheduleNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/schedulednotifications/\";\n\n const headers = await context.createHeaders(\n \"scheduleNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-ScheduleTime\", scheduledTime.toISOString());\n headers.set(\"Content-Type\", notification.contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n if (options.tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = notification.body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DirectSendNotificationOptions, SendNotificationOptions } from \"../models/options.js\";\nimport { objectHasProperty } from \"@azure/core-util\";\n\n/**\n * Determines whether the options are of type SendNotificationOptions.\n * @param options - The options to test if SendNotificationOptions.\n * @returns true if SendNotificationOptions otherwise false.\n */\nexport function isSendNotificationOptions(options: unknown): options is SendNotificationOptions {\n return (\n objectHasProperty(options, \"tagExpression\") || objectHasProperty(options, \"enableTestSend\")\n );\n}\n\n/**\n * Determines whether the options are of type DirectSendNotificationOptions.\n * @param options - The options to test if DirectSendNotificationOptions.\n * @returns true if DirectSendNotificationOptions otherwise false.\n */\nexport function isDirectSendNotificationOptions(\n options: unknown,\n): options is DirectSendNotificationOptions {\n return objectHasProperty(options, \"deviceHandle\");\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Notification } from \"../models/notification.js\";\n\n/**\n * @internal\n */\nexport function createMultipartDirectNotification(\n boundaryName: string,\n notification: Notification,\n deviceHandles: string[],\n): string {\n return (\n `--${boundaryName}\\r\\n` +\n `Content-type: ${notification.contentType}\\r\\n` +\n \"Content-Disposition: inline; name=notification\\r\\n\\r\\n\" +\n notification.body +\n \"\\r\\n\" +\n `--${boundaryName}\\r\\n` +\n \"Content-type: application/json\\r\\n\" +\n \"Content-Disposition: inline; name=devices\\r\\n\\r\\n\" +\n JSON.stringify(deviceHandles) +\n \"\\r\\n\" +\n `--${boundaryName}--`\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DirectSendNotificationOptions, SendNotificationOptions } from \"../models/options.js\";\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./internal/_client.js\";\nimport {\n isDirectSendNotificationOptions,\n isSendNotificationOptions,\n} from \"../utils/optionUtils.js\";\nimport { BrowserPushChannel } from \"../models/installation.js\";\nimport { NonNullableRecord } from \"../utils/utils.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { createMultipartDirectNotification } from \"../utils/notificationUtils.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\n/**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param context - The Notification Hubs client.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendNotification(\n context: NotificationHubsClientContext,\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions = { enableTestSend: false },\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.sendNotification`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/messages/\";\n\n // Check if batch direct send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.pathname += \"$batch\";\n }\n\n // Check for test send\n if (isSendNotificationOptions(options) && options.enableTestSend) {\n endpoint.searchParams.append(\"test\", \"true\");\n }\n\n const headers = await context.createHeaders(\n \"sendNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n let body = notification.body;\n let contentType: string = notification.contentType;\n\n // Check for direct batch send\n if (isDirectSendNotificationOptions(options) && Array.isArray(options.deviceHandle)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n const boundary = `nh-boundary-${randomUUID()}`;\n contentType = `multipart/mixed; boundary = \"${boundary}\"`;\n body = createMultipartDirectNotification(boundary, notification, options.deviceHandle);\n } else if (isDirectSendNotificationOptions(options)) {\n endpoint.searchParams.append(\"direct\", \"true\");\n\n if (notification.platform === \"browser\") {\n const browserHandle = options.deviceHandle as BrowserPushChannel;\n headers.set(\"ServiceBusNotification-DeviceHandle\", browserHandle.endpoint);\n headers.set(\"Auth\", browserHandle.auth);\n headers.set(\"P256DH\", browserHandle.p256dh);\n } else {\n headers.set(\"ServiceBusNotification-DeviceHandle\", options.deviceHandle as string);\n }\n } else if (isSendNotificationOptions(options)) {\n if (options.tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", options.tagExpression);\n }\n }\n\n headers.set(\"Content-Type\", contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createRequest, parseNotificationResponse, sendRequest } from \"./internal/_client.js\";\nimport { JsonPatch } from \"../models/installation.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsResponse } from \"../models/notificationDetails.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"updateInstallation\";\n\n/**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param context - The Notification Hubs client.\n * @param installationId - The ID of the installation to update.\n * @param installationPatches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function updateInstallation(\n context: NotificationHubsClientContext,\n installationId: string,\n installationPatches: JsonPatch[],\n options: OperationOptions = {},\n): Promise<NotificationHubsResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += `/installations/${installationId}`;\n\n const headers = await context.createHeaders(OPERATION_NAME);\n headers.set(\"Content-Type\", \"application/json\");\n\n const request = createRequest(endpoint, \"PATCH\", headers, updatedOptions);\n request.body = JSON.stringify(installationPatches);\n const response = await sendRequest(context, request, 200);\n\n return parseNotificationResponse(response);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RegistrationDescription } from \"../models/registration.js\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport { createOrUpdateRegistrationDescription } from \"./internal/_createOrUpdateRegistrationDescription.js\";\nimport { tracingClient } from \"../utils/tracing.js\";\n\nconst OPERATION_NAME = \"updateRegistration\";\n\n/**\n * Updates an existing registration.\n * @param context - The Notification Hubs client.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\nexport function updateRegistration(\n context: NotificationHubsClientContext,\n registration: RegistrationDescription,\n options: OperationOptions = {},\n): Promise<RegistrationDescription> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${OPERATION_NAME}`,\n options,\n async (updatedOptions) => {\n if (!registration.etag) {\n throw new RestError(\"ETag is required for registration update\", { statusCode: 400 });\n }\n return createOrUpdateRegistrationDescription(context, registration, \"update\", updatedOptions);\n },\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DirectSendNotificationOptions,\n EntityOperationOptions,\n NotificationHubsClientOptions,\n PolledOperationOptions,\n RegistrationQueryLimitOptions,\n ScheduleNotificationOptions,\n SendNotificationOptions,\n} from \"./models/options.js\";\nimport { Installation, JsonPatch } from \"./models/installation.js\";\nimport {\n NotificationDetails,\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"./models/notificationDetails.js\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"./models/notificationHubJob.js\";\nimport { NotificationHubsClientContext, createClientContext } from \"./api/clientContext.js\";\nimport { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport { Notification } from \"./models/notification.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { beginSubmitNotificationHubJob as beginSubmitNotificationHubJobMethod } from \"./api/beginSubmitNotificationHubJob.js\";\nimport { cancelScheduledNotification as cancelScheduledNotificationMethod } from \"./api/cancelScheduledNotification.js\";\nimport { createOrUpdateInstallation as createOrUpdateInstallationMethod } from \"./api/createOrUpdateInstallation.js\";\nimport { createOrUpdateRegistration as createOrUpdateRegistrationMethod } from \"./api/createOrUpdateRegistration.js\";\nimport { createRegistrationId as createRegistrationIdMethod } from \"./api/createRegistrationId.js\";\nimport { createRegistration as createRegistrationMethod } from \"./api/createRegistration.js\";\nimport { deleteInstallation as deleteInstallationMethod } from \"./api/deleteInstallation.js\";\nimport { deleteRegistration } from \"./api/deleteRegistration.js\";\nimport { getFeedbackContainerUrl as getFeedbackContainerUrlMethod } from \"./api/getFeedbackContainerUrl.js\";\nimport { getInstallation as getInstallationMethod } from \"./api/getInstallation.js\";\nimport { getNotificationHubJob as getNotificationHubJobMethod } from \"./api/getNotificationHubJob.js\";\nimport { getNotificationOutcomeDetails as getNotificationOutcomeDetailsMethod } from \"./api/getNotificationOutcomeDetails.js\";\nimport { getRegistration as getRegistrationMethod } from \"./api/getRegistration.js\";\nimport { listNotificationHubJobs as listNotificationHubJobsMethod } from \"./api/listNotificationHubJobs.js\";\nimport { listRegistrationsByChannel as listRegistrationsByChannelMethod } from \"./api/listRegistrationsByChannel.js\";\nimport { listRegistrationsByTag as listRegistrationsByTagMethod } from \"./api/listRegistrationsByTag.js\";\nimport { listRegistrations as listRegistrationsMethod } from \"./api/listRegistrations.js\";\nimport { scheduleNotification as scheduleNotificationMethod } from \"./api/scheduleNotification.js\";\nimport { sendNotification as sendNotificationMethod } from \"./api/sendNotification.js\";\nimport { submitNotificationHubJob as submitNotificationHubJobMethod } from \"./api/submitNotificationHubJob.js\";\nimport { updateInstallation as updateInstallationMethod } from \"./api/updateInstallation.js\";\nimport { updateRegistration as updateRegistrationMethod } from \"./api/updateRegistration.js\";\n\n/**\n * This represents a client for Azure Notification Hubs to manage installations and send\n * messages to devices.\n */\nexport class NotificationHubsClient {\n private _client: NotificationHubsClientContext;\n\n /**\n * Creates a new instance of the NotificationClient with a connection string, hub name and options.\n * @param connectionString - The Notification Hub Access Policy connection string.\n * @param hubName - The name of the Azure Notification Hub.\n * @param options - Options for configuring the Azure Notification Hubs client.\n */\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this._client = createClientContext(connectionString, hubName, options);\n }\n\n /**\n * Creates or overwrites an installation to a Notification Hub.\n * @param installation - The installation to create or overwrite.\n * @param options - Configuration options for the create or update installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n createOrUpdateInstallation(\n installation: Installation,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return createOrUpdateInstallationMethod(this._client, installation, options);\n }\n\n /**\n * Deletes an installation from a Notification Hub.\n * @param installationId - The installation ID of the installation to delete.\n * @param options - Configuration options for the installation delete operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n deleteInstallation(\n installationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Gets an Azure Notification Hub installation by the installation ID.\n * @param installationId - The ID of the installation to get.\n * @param options - Configuration options for the get installation operation.\n * @returns The installation that matches the installation ID.\n */\n getInstallation(installationId: string, options: OperationOptions = {}): Promise<Installation> {\n return getInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param installationId - The ID of the installation to update.\n * @param patches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n updateInstallation(\n installationId: string,\n patches: JsonPatch[],\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return updateInstallationMethod(this._client, installationId, patches, options);\n }\n\n /**\n * Creates a new registration ID.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\n createRegistrationId(options: OperationOptions = {}): Promise<string> {\n return createRegistrationIdMethod(this._client, options);\n }\n\n /**\n * Creates a new registration. This method generates a registration ID,\n * which you can subsequently use to retrieve, update, and delete this registration.\n * @param registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\n createRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Creates or updates a registration.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\n createOrUpdateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createOrUpdateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Updates an existing registration.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\n updateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return updateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Deletes a registration with the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The registration ID of the registration to delete.\n * @param options - The options for delete operations including the ETag\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n deleteRegistration(\n registrationId: string,\n options: EntityOperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteRegistration(this._client, registrationId, options);\n }\n\n /**\n * Gets a registration by the given registration ID.\n * @param registrationId - The ID of the registration to get.\n * @param options - The options for getting a registration by ID.\n * @returns A RegistrationDescription that has the given registration ID.\n */\n getRegistration(\n registrationId: string,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return getRegistrationMethod(this._client, registrationId, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given query options.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrations(\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsMethod(this._client, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param channel - The registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrationsByChannel(\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByChannelMethod(this._client, channel, options);\n }\n\n /**\n * Lists all registrations with the matching tag.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\n listRegistrationsByTag(\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByTagMethod(this._client, tag, options);\n }\n\n /**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendNotification(\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions = { enableTestSend: false },\n ): Promise<NotificationHubsMessageResponse> {\n return sendNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleNotification(\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Cancels the scheduled notification with the given notification ID.\n * @param notificationId - The notification ID from the scheduled notification.\n * @param options - The operation options.\n * @returns A notification hub response with correlation ID and tracking ID.\n */\n cancelScheduledNotification(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return cancelScheduledNotificationMethod(this._client, notificationId, options);\n }\n\n /**\n * Retrieves an Azure Storage container URL. The container has feedback data for the notification hub.\n * The caller can then use the Azure Storage Services SDK to retrieve the contents of the container.\n * @param options - The options for getting the push notification feedback container URL.\n * @returns The URL of the Azure Storage Container containing the feedback data.\n */\n getFeedbackContainerUrl(options: OperationOptions = {}): Promise<string> {\n return getFeedbackContainerUrlMethod(this._client, options);\n }\n\n /**\n * Retrieves the results of a send operation. This can retrieve intermediate results if the send is being processed\n * or final results if the Send* has completed. This API can only be called for Standard SKU and above.\n * @param notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\n getNotificationOutcomeDetails(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationDetails> {\n return getNotificationOutcomeDetailsMethod(this._client, notificationId, options);\n }\n\n /**\n * Gets a Notification Hub Job by the ID.\n * @param jobId - The Notification Hub Job ID.\n * @param options - The operation options.\n * @returns The Notification Hub Job with the matching ID.\n */\n getNotificationHubJob(\n jobId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return getNotificationHubJobMethod(this._client, jobId, options);\n }\n\n /**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\n beginSubmitNotificationHubJob(\n notificationHubJob: NotificationHubJob,\n options: PolledOperationOptions = {},\n ): Promise<NotificationHubJobPoller> {\n return beginSubmitNotificationHubJobMethod(this._client, notificationHubJob, options);\n }\n\n /**\n * Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\n submitNotificationHubJob(\n job: NotificationHubJob,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return submitNotificationHubJobMethod(this._client, job, options);\n }\n\n /**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\n listNotificationHubJobs(options: OperationOptions = {}): Promise<NotificationHubJob[]> {\n return listNotificationHubJobsMethod(this._client, options);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as Constants from \"../utils/constants.js\";\nimport {\n AdmNativeMessage,\n AppleNativeMessage,\n FirebaseLegacyNativeMessage,\n FirebaseV1NativeMessage,\n} from \"./notificationBodyBuilder.js\";\nimport { AppleHeaders, WindowsHeaders } from \"./notificationHeaderBuilder.js\";\n\nfunction isString(value: unknown): value is string {\n return typeof value === \"string\" || value instanceof String;\n}\n\n/**\n * Represents a notification that can be sent to a device.\n */\nexport interface NotificationCommon {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, unknown>;\n}\n\n/**\n * The common notification parameters to accept a string body or JSON body.\n */\nexport interface NotificationCommonParams {\n /**\n * The body for the push notification.\n */\n body: string | unknown;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, unknown>;\n}\n\n/**\n * Represents a JSON notification hub.\n */\nexport interface JsonNotification extends NotificationCommon {\n /**\n * The content type for the push notification.\n */\n contentType: \"application/json;charset=utf-8\";\n}\n\n/**\n * Represents an Apple APNs push notification.\n */\nexport interface AppleNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"apple\";\n}\n\n/**\n * Represents an Apple notification that can be sent to a device.\n */\nexport interface AppleNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AppleNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: AppleHeaders;\n}\n\n/**\n * Creates a notification to send to an Apple device.\n * @param notification - A partial message used to create a message for Apple.\n * @returns A newly created Apple.\n */\nexport function createAppleNotification(notification: AppleNotificationParams): AppleNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"apple\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) push notification.\n */\nexport interface AdmNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"adm\";\n}\n\n/**\n * Represents an ADM notification that can be sent to a device.\n */\nexport interface AdmNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | AdmNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to an Amazon Device Messaging device.\n * @param notification - A partial message used to create a message for Amazon Device Messaging.\n * @returns A newly created Amazon Device Messaging.\n */\nexport function createAdmNotification(notification: AdmNotificationParams): AdmNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"adm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Baidu push notification.\n */\nexport interface BaiduNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a notification to send to a Baidu registered device.\n * @param notification - A partial message used to create a message for Baidu.\n * @returns A newly created Baidu.\n */\nexport function createBaiduNotification(notification: NotificationCommonParams): BaiduNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"baidu\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Browser push notification.\n */\nexport interface BrowserNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a notification to send to a browser.\n * @param notification - A partial message used to create a message for a browser.\n * @returns A newly created Web Push browser.\n */\nexport function createBrowserNotification(\n notification: NotificationCommonParams,\n): BrowserNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"browser\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Firebase legacy HTTP push notification.\n */\nexport interface FcmLegacyNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"gcm\";\n}\n\n/**\n * Represents an Firebase Legacy notification that can be sent to a device.\n */\nexport interface FcmLegacyNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseLegacyNativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmLegacyNotification(\n notification: FcmLegacyNotificationParams,\n): FcmLegacyNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"gcm\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents an Firebase V1 API notification that can be sent to a device.\n */\nexport interface FcmV1Notification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Represents an Firebase V1 notification that can be sent to a device.\n */\nexport interface FcmV1NotificationParams {\n /**\n * The body for the push notification.\n */\n body: string | FirebaseV1NativeMessage;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: Record<string, string>;\n}\n\n/**\n * Creates a notification to send to Firebase.\n * @param notification - A partial message used to create a message for Firebase.\n * @returns A newly created Firebase notification.\n */\nexport function createFcmV1Notification(notification: FcmV1NotificationParams): FcmV1Notification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"fcmv1\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a Xiaomi push notification.\n */\nexport interface XiaomiNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a notification to send to Xiaomi.\n * @param notification - A partial message used to create a message for Xiaomi.\n * @returns A newly created Xiaomi notification.\n */\nexport function createXiaomiNotification(\n notification: NotificationCommonParams,\n): XiaomiNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"xiaomi\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents a template based push notification.\n */\nexport interface TemplateNotification extends JsonNotification {\n /**\n * The platform for the push notification.\n */\n platform: \"template\";\n}\n\n/**\n * Creates a template notification.\n * @param notification - A partial message used to be used for a template notification.\n * @returns A newly created Firebase.\n */\nexport function createTemplateNotification(\n notification: NotificationCommonParams,\n): TemplateNotification {\n const body = isString(notification.body) ? notification.body : JSON.stringify(notification.body);\n\n return {\n ...notification,\n body,\n platform: \"template\",\n contentType: Constants.JSON_CONTENT_TYPE,\n };\n}\n\n/**\n * Represents the possible WNS content-types.\n */\nexport type WindowsContentType = \"application/xml\" | \"application/octet-stream\";\n\n/**\n * Represents a Windows Notification Services (WNS) push notification.\n */\nexport interface WindowsNotification extends NotificationCommon {\n /**\n * The platform for the push notification.\n */\n platform: \"windows\";\n\n /**\n * The content type for the push notification.\n */\n contentType: WindowsContentType;\n}\n\n/**\n * Represents a WNS notification that can be sent to a device.\n */\nexport interface WnsNotificationParams {\n /**\n * The body for the push notification.\n */\n body: string;\n\n /**\n * The headers to include for the push notification.\n */\n headers?: WindowsHeaders;\n}\n\n/**\n * Creates a notification to send to WNS.\n * @param notification - The WNS notification to send.\n * @returns A newly created WNS message.\n */\nexport function createWindowsNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n if (notification?.headers && notification.headers[\"X-WNS-Type\"]) {\n const wnsType = notification.headers[\"X-WNS-Type\"];\n switch (wnsType) {\n case Constants.WNS_TOAST:\n return createWindowsToastNotification(notification);\n case Constants.WNS_TITLE:\n return createWindowsTileNotification(notification);\n case Constants.WNS_BADGE:\n return createWindowsBadgeNotification(notification);\n case Constants.WNS_RAW:\n return createWindowsRawNotification(notification);\n default:\n throw new Error(`Invalid WNS type: ${wnsType}`);\n }\n } else {\n throw new Error(`Missing WNS type in headers`);\n }\n}\n\n/**\n * Creates a badge message to send to WNS.\n * @param notification - A partial message used to create a badge message for WNS.\n * @returns A newly created WNS badge.\n */\nexport function createWindowsBadgeNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_BADGE;\n }\n\n return result;\n}\n\n/**\n * Creates a tile message to send to WNS.\n * @param notification - A partial message used to create a tile message for WNS.\n * @returns A newly created WNS tile.\n */\nexport function createWindowsTileNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TITLE;\n }\n\n return result;\n}\n\n/**\n * Creates a toast message to send to WNS.\n * @param notification - A partial message used to create a toast message for WNS.\n * @returns A newly created WNS toast.\n */\nexport function createWindowsToastNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.XML_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_TOAST;\n }\n\n return result;\n}\n\n/**\n * Creates a notification to send to WNS in wns/raw format..\n * @param notification - A partial message used to create a message for WNS in XML format.\n * @returns A newly created WNS message using XML.\n */\nexport function createWindowsRawNotification(\n notification: WnsNotificationParams,\n): WindowsNotification {\n const result: WindowsNotification = {\n ...notification,\n platform: \"windows\",\n contentType: Constants.STREAM_CONTENT_TYPE,\n };\n\n if (!result.headers) {\n result.headers = {};\n }\n\n if (!result.headers[Constants.WNS_TYPE_NAME]) {\n result.headers[Constants.WNS_TYPE_NAME] = Constants.WNS_RAW;\n }\n\n return result;\n}\n\n/**\n * Represents the possible push notification messages types.\n */\nexport type Notification =\n | AppleNotification\n | AdmNotification\n | BaiduNotification\n | BrowserNotification\n | FcmLegacyNotification\n | FcmV1Notification\n | XiaomiNotification\n | WindowsNotification\n | TemplateNotification;\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { stringifyXML } from \"@azure/core-xml\";\n\n/**\n * Represents what is in the APNs alert body.\n */\nexport interface AppleAlert {\n /**\n * The title of the notification. Apple Watch displays this string in the short look notification\n * interface. Specify a string that’s quickly understood by the user.\n */\n title?: string;\n\n /**\n * Additional information that explains the purpose of the notification.\n */\n subtitle?: string;\n\n /**\n * The content of the alert message.\n */\n body?: string;\n\n /**\n * The name of the launch image file to display. If the user chooses to launch your app,\n * the contents of the specified image or storyboard file are displayed instead of your app’s normal launch image.\n */\n \"launch-image\"?: string;\n\n /**\n * The key for a localized title string. Specify this key instead of the title key to retrieve\n * the title from your app’s Localizable.strings files. The value must contain the name of a key in your strings file.\n */\n \"title-loc-key\"?: string;\n\n /**\n * An array of strings containing replacement values for variables in your title string.\n * Each %\\@ character in the string specified by the title-loc-key is replaced by a value\n * from this array. The first item in the array replaces the first instance\n * of the %\\@ character in the string, the second item replaces the second instance, and so on.\n */\n \"title-loc-args\"?: string[];\n\n /**\n * The key for a localized subtitle string. Use this key, instead of the subtitle key, to\n * retrieve the subtitle from your app’s Localizable.strings file.\n * The value must contain the name of a key in your strings file.\n */\n \"subtitle-loc-key\"?: string;\n\n /**\n * An array of strings containing replacement values for variables in your title string.\n * Each %\\@ character in the string specified by subtitle-loc-key is replaced by a value\n * from this array. The first item in the array replaces the first instance of the\n * %\\@ character in the string, the second item replaces the second instance, and so on.\n */\n \"subtitle-loc-args\"?: string[];\n\n /**\n * The key for a localized message string. Use this key, instead of the body key, to\n * retrieve the message text from your app’s Localizable.strings file. The value must contain\n * the name of a key in your strings file.\n */\n \"loc-key\"?: string;\n\n /**\n * An array of strings containing replacement values for variables in your message text.\n * Each %\\@ character in the string specified by loc-key is replaced by a value from\n * this array. The first item in the array replaces the first instance of the %\\@ character\n * in the string, the second item replaces the second instance, and so on.\n */\n \"loc-args\"?: string[];\n}\n\n/**\n * Represents an APNs critical sound\n */\nexport interface AppleCriticalSound {\n /**\n * The critical alert flag. Set to 1 to enable the critical alert.\n */\n critical: number;\n\n /**\n * The name of a sound file in your app’s main bundle or in the Library/Sounds folder\n * of your app’s container directory. Specify the string “default” to play the system sound.\n */\n name: string;\n\n /**\n * The volume for the critical alert’s sound. Set this to a value between 0 (silent) and 1 (full volume).\n */\n volume: number;\n}\n\n/**\n * Represents a native APNs message.\n */\nexport interface AppleNativeMessage extends Record<string, any> {\n /**\n * The Apple specific push notification information.\n */\n aps?: AppleApsNativeMessage;\n}\n\n/**\n * Represents a native APNs APS message.\n */\nexport interface AppleApsNativeMessage extends Record<string, any> {\n /**\n * The information for displaying an alert.\n */\n alert?: string | AppleAlert;\n\n /**\n * The number to display in a badge on your app’s icon.\n */\n badge?: number;\n\n /**\n * The name of a sound file in your app’s main bundle or in the Library/Sounds\n * folder of your app’s container directory. Specify the string “default” to\n * play the system sound. Use this key for regular notifications.\n * For critical alerts, use the sound dictionary instead.\n */\n sound?: string | AppleCriticalSound;\n\n /**\n * An app-specific identifier for grouping related notifications.\n */\n \"thread-id\"?: string;\n\n /**\n * The notification’s type.\n */\n category?: string;\n\n /**\n * The background notification flag. To perform a silent background update,\n * specify the value 1 and don’t include the alert, badge, or sound keys in your payload.\n */\n \"content-available\"?: number;\n\n /**\n * The notification service app extension flag. If the value is 1, the system passes\n * the notification to your notification service app extension before delivery.\n */\n \"mutable-content\"?: number;\n\n /**\n * The identifier of the window brought forward.\n */\n \"target-content-id\"?: string;\n\n /**\n * The importance and delivery timing of a notification.\n */\n \"interruption-level\"?: \"passive\" | \"active\" | \"time-sensitive\" | \"critical\";\n\n /**\n * The relevance score, a number between 0 and 1, that the system uses to sort the\n * notifications from your app. The highest score gets featured in the notification summary.\n */\n \"relevance-score\"?: number;\n\n /**\n * The criteria the system evaluates to determine if it displays the notification in the current Focus.\n */\n \"filter-criteria\"?: string;\n\n /**\n * The UNIX timestamp that represents the date at which a Live Activity becomes stale, or out of date.\n */\n \"stale-date\"?: number;\n\n /**\n * The updated or final content for a Live Activity.\n */\n \"content-state\"?: Record<string, any>;\n\n /**\n * The UNIX timestamp that marks the time when you send the remote notification that updates or ends a Live Activity.\n */\n timestamp?: number;\n\n /**\n * The string that describes whether you update or end an ongoing Live Activity with the remote push notification. To update the Live Activity, use update. To end the Live Activity, use end.\n */\n events?: string;\n\n /**\n * The UNIX timestamp that represents the date at which the system ends a Live Activity and removes it from the Dynamic Island and the Lock Screen.\n */\n \"dismissal-date\"?: number;\n}\n\n/**\n * Creates an APNs native message to send to Notification Hubs.\n * @param nativeMessage - The Apple native message properties to set.\n * @param additionalProperties - Additional properties for Apple messages.\n * @returns An AppleNotification to send to Notification Hubs.\n */\nexport function createAppleNotificationBody(nativeMessage: AppleNativeMessage): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Represents the targets, options, and payload for HTTP JSON messages for the Firebase Legacy HTTP interface.\n */\nexport interface FirebaseLegacyNativeMessage {\n /**\n * The recipient of a message.\n */\n to?: string;\n\n /**\n * The recipient of a multicast message, a message sent to more than one registration token.\n */\n registration_ids?: string[];\n\n /**\n * A logical expression of conditions that determine the message target.\n */\n condition?: string;\n\n /**\n * Used to identify a group of messages.\n */\n collapse_key?: string;\n\n /**\n * The priority of the message.\n */\n priority?: \"normal\" | \"high\";\n\n /**\n * The background notification flag. To perform a silent background update,\n * specify the value 1 and don’t include the alert, badge, or sound keys in your payload.\n */\n content_available?: boolean;\n\n /**\n * The notification service app extension flag. If the value is 1, the system passes\n * the notification to your notification service app extension before delivery.\n */\n mutable_content?: number;\n\n /**\n * Specifies how long (in seconds) the message should be kept in FCM storage if the device is offline\n */\n time_to_live?: number;\n\n /**\n * The package name of the application where the registration tokens must match in order to receive the message.\n */\n restricted_package_name?: string;\n\n /**\n * When set to true, allows developers to test a request without actually sending a message.\n */\n dry_run?: boolean;\n\n /**\n * Custom key-value pairs of the message's payload.\n */\n data?: Record<string, any>;\n\n /**\n * The predefined, user-visible key-value pairs of the notification payload.\n */\n notification?:\n | FirebaseLegacyAppleNativePayload\n | FirebaseLegacyAndroidNativePayload\n | FirebaseLegacyWebNativePayload;\n}\n\n/**\n * Represents an APNs native payload for the Firebase Legacy HTTP interface.\n */\nexport interface FirebaseLegacyAppleNativePayload {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The sound to play when the device receives the notification.\n */\n sound?: string;\n\n /**\n * The value of the badge on the home screen app icon.\n */\n badge?: string;\n\n /**\n * The action associated with a user click on the notification which corresponds to the APNs category.\n */\n click_action?: string;\n\n /**\n * The notification's subtitle.\n */\n subtitle?: string;\n\n /**\n * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.\n */\n body_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.\n */\n body_loc_args?: string[];\n\n /**\n * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.\n */\n title_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.\n */\n title_loc_args?: string[];\n}\n\n/**\n * Represents an Android native payload for the Firebase Legacy HTTP interface.\n */\nexport interface FirebaseLegacyAndroidNativePayload {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The notification's channel ID.\n */\n android_channel_id?: string;\n\n /**\n * The notification's icon.\n */\n icon?: string;\n\n /**\n * The sound to play when the device receives the notification.\n */\n sound?: string;\n\n /**\n * Identifier used to replace existing notifications in the notification drawer.\n */\n tag?: string;\n\n /**\n * The notification's icon color, expressed in #rrggbb format.\n */\n color?: string;\n\n /**\n * The action associated with a user click on the notification.\n */\n click_action?: string;\n\n /**\n * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.\n */\n body_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.\n */\n body_loc_args?: string[];\n\n /**\n * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.\n */\n title_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.\n */\n title_loc_args?: string[];\n}\n\n/**\n * Represents an Web Push native payload for the Firebase Legacy HTTP interface.\n */\nexport interface FirebaseLegacyWebNativePayload {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The URL to use for the notification's icon.\n */\n icon?: string;\n\n /**\n * The action associated with a user click on the notification.\n */\n click_action?: string;\n}\n\n/**\n * Creates a FcmLegacyNotification from a native Firebase payload.\n * @param nativeMessage - The native message payload to send to Notification Hubs.\n * @returns The JSON body to send to Notification Hubs.\n */\nexport function createFirebaseLegacyNotificationBody(\n nativeMessage: FirebaseLegacyNativeMessage,\n): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Represents the targets, options, and payload for HTTP JSON messages for the Firebase V1 interface.\n */\nexport interface FirebaseV1NativeMessage {\n /**\n * Custom key-value pairs of the message's payload.\n */\n data?: Record<string, any>;\n\n /**\n * The predefined, user-visible key-value pairs of the notification payload.\n */\n notification?: FirebaseV1NativeNotification;\n\n /**\n * Android specific options for messages sent through FCM connection server.\n */\n android?: FirebaseV1AndroidConfig;\n\n /**\n * Webpush protocol options.\n */\n webpush?: FirebaseV1WebPushConfig;\n\n /**\n * APNs specific options.\n */\n apns?: FirebaseV1ApnsConfig;\n\n /**\n * FCM options.\n */\n fcm_options?: FirebaseV1FcmOptions;\n\n /**\n * Registration token to send a message to.\n */\n token?: string;\n\n /**\n * Topic name to send a message to, e.g. \"weather\".\n */\n topic?: string;\n\n /**\n * Condition to send a message to, e.g. \"'foo' in topics && 'bar' in topics\".\n */\n condition?: string;\n}\n\n/**\n * Represents a native FCM V1 notification message payload.\n */\nexport interface FirebaseV1NativeNotification {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * Contains the URL of an image that is going to be downloaded on the device and displayed in a notification.\n */\n image?: string;\n}\n\n/**\n * Android specific options for messages sent through FCM connection server.\n */\nexport interface FirebaseV1AndroidConfig {\n /**\n * An identifier of a group of messages that can be collapsed, so that only the last message gets sent when delivery can be resumed.\n */\n collapse_key?: string;\n\n /**\n * Message priority. Can take \"normal\" and \"high\" values.\n */\n priority?: \"normal\" | \"high\";\n\n /**\n * How long (in seconds) the message should be kept in FCM storage if the device is offline.\n */\n ttl?: string;\n\n /**\n * Package name of the application where the registration token must match in order to receive the message.\n */\n restricted_package_name?: string;\n\n /**\n * Custom key-value pairs of the message's payload.\n */\n data?: Record<string, any>;\n\n /**\n * Notification to send to android devices.\n */\n notification?: FirebaseV1AndroidNotification;\n\n /**\n * Options for features provided by the FCM SDK for Android.\n */\n fcm_options?: FirebaseV1AndroidFcmOptions;\n\n /**\n * If set to true, messages will be allowed to be delivered to the app while the device is in direct boot mode.\n */\n direct_boot_ok?: boolean;\n}\n\n/**\n * Notification to send to android devices.\n */\nexport interface FirebaseV1AndroidNotification {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The notification's icon.\n */\n icon?: string;\n\n /**\n * The notification's icon color, expressed in #rrggbb format.\n */\n color?: string;\n\n /**\n * The sound to play when the device receives the notification.\n */\n sound?: string;\n\n /**\n * Identifier used to replace existing notifications in the notification drawer.\n */\n tag?: string;\n\n /**\n * The action associated with a user click on the notification.\n */\n click_action?: string;\n\n /**\n * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.\n */\n body_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.\n */\n body_loc_args?: string[];\n\n /**\n * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.\n */\n title_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.\n */\n title_loc_args?: string[];\n\n /**\n * The notification's channel id (new in Android O).\n */\n channel_id?: string;\n\n /**\n * Sets the \"ticker\" text, which is sent to accessibility services.\n */\n ticker?: string;\n\n /**\n * When set to false or unset, the notification is automatically dismissed when the user clicks it in the panel.\n */\n sticky?: boolean;\n\n /**\n * Set the time that the event in the notification occurred.\n */\n event_time?: string;\n\n /**\n * Set whether or not this notification is relevant only to the current device.\n */\n local_only?: boolean;\n\n /**\n * Set the relative priority for this notification.\n */\n notification_priority?: number;\n\n /**\n * If set to true, use the Android framework's default sound for the notification.\n */\n default_sound?: boolean;\n\n /**\n * If set to true, use the Android framework's default vibrate pattern for the notification.\n */\n default_vibrate_timings?: boolean;\n\n /**\n * If set to true, use the Android framework's default light settings for the notification.\n */\n default_light_settings?: boolean;\n\n /**\n * Set the vibration pattern to use.\n */\n vibrate_timings?: string[];\n\n /**\n * Set the Notification.visibility of the notification.\n */\n visibility?: number;\n\n /**\n * Sets the number of items this notification represents.\n */\n notification_count?: number;\n\n /**\n * Settings to control the notification's LED blinking rate and color if LED is available on the device.\n */\n light_settings?: {\n color: {\n red: number;\n green: number;\n blue: number;\n alpha: number;\n };\n light_on_duration: string;\n light_off_duration: string;\n };\n\n /**\n * Contains the URL of an image that is going to be displayed in a notification.\n */\n image?: string;\n}\n\n/**\n * Options for features provided by the FCM SDK for Android.\n */\nexport interface FirebaseV1AndroidFcmOptions {\n /**\n * The label associated with the message's analytics data.\n */\n analytics_label?: string;\n}\n\nexport interface FirebaseV1WebPushConfig {\n /**\n * A collection of WebPush protocol options.\n */\n headers?: Record<string, string>;\n\n /**\n * A collection of WebPush protocol options.\n */\n data?: Record<string, string>;\n\n /**\n * Web Notification options as a JSON object.\n */\n notification?: FirebaseV1WebPushNotification;\n\n /**\n * A collection of WebPush protocol options.\n */\n fcm_options?: FirebaseV1WebPushFcmOptions;\n}\n\n/**\n * Represents a Web Push notification payload.\n */\nexport interface FirebaseV1WebPushNotification {\n /**\n * An array of actions to display in the notification.\n */\n actions?: {\n action?: string;\n title?: string;\n icon?: string;\n }[];\n\n /**\n * Defines a title for the notification.\n */\n title?: string;\n\n /**\n * The body string of the notification\n */\n body?: string;\n\n /**\n * A string containing the URL of an icon to be displayed in the notification.\n */\n icon?: string;\n\n /**\n * A string containing the URL of an image to represent the notification when there is not enough space to display the notification itself such as for example, the Android Notification Bar.\n */\n badge?: string;\n\n /**\n * The notification's data.\n */\n data?: Record<string, any>;\n\n /**\n * The direction in which to display the notification.\n */\n dir?: \"auto\" | \"ltr\" | \"rtl\";\n\n /**\n * A string containing the URL of an image to be displayed in the notification.\n */\n image?: string;\n\n /**\n * The notification's language.\n */\n lang?: string;\n\n /**\n * A boolean value specifying whether the user should be notified after a new notification replaces an old one.\n */\n renotify?: boolean;\n\n /**\n * Indicates that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.\n */\n requireInteraction?: boolean;\n\n /**\n * A boolean value specifying whether the notification is silent\n */\n silent?: boolean;\n\n /**\n * A string representing an identifying tag for the notification.\n */\n tag?: string;\n\n /**\n * A number representing the time at which a notification is created or applicable\n */\n timestamp?: number;\n\n /**\n * A vibration pattern for the device's vibration hardware to emit with the notification.\n */\n vibrate?: number[];\n}\n\n/**\n * Options for features provided by the FCM SDK for Web.\n */\nexport interface FirebaseV1WebPushFcmOptions {\n /**\n * The link to open when the user clicks on the notification.\n */\n link?: string;\n\n /**\n * Label associated with the message's analytics data.\n */\n analytics_label?: string;\n}\n\n/**\n * Apple Push Notification Service specific options.\n */\nexport interface FirebaseV1ApnsConfig {\n /**\n * A collection of APNs headers.\n */\n headers?: Record<string, string>;\n\n /**\n * A collection of APNs headers.\n */\n payload?: AppleNativeMessage;\n\n /**\n * A collection of APNs headers.\n */\n fcm_options?: FirebaseV1ApnsFcmOptions;\n}\n\n/**\n * Options for features provided by the FCM SDK for iOS.\n */\nexport interface FirebaseV1ApnsFcmOptions {\n /**\n * Label associated with the message's analytics data.\n */\n analytics_label?: string;\n\n /**\n * Contains the URL of an image that is going to be displayed in a notification.\n */\n image?: string;\n}\n\nexport interface FirebaseV1FcmOptions {\n /**\n * Label associated with the message's analytics data.\n */\n analytics_label?: string;\n}\n\n/**\n * Creates a FcmV1Notification from a native Firebase payload.\n * @param nativeMessage - The native message payload to send to Notification Hubs.\n * @returns The JSON body to send to Notification Hubs.\n */\nexport function createFirebaseV1NotificationBody(nativeMessage: FirebaseV1NativeMessage): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Describes ADM notification messages.\n */\nexport interface AdmNativeNotification {\n /**\n * The notification's title.\n */\n title?: string;\n\n /**\n * The notification's body text.\n */\n body?: string;\n\n /**\n * The notification's icon.\n */\n icon?: string;\n\n /**\n * The notification's icon color, expressed in #rrggbb format.\n */\n color?: string;\n\n /**\n * The sound to play when the device receives the notification. Supports \"default\" or the filename of a sound resource bundled in the app.\n */\n sound?: string;\n\n /**\n * Identifier used to replace existing notifications in the notification drawer.\n */\n tag?: string;\n\n /**\n * The action associated with a user click on the notification.\n */\n click_action?: string;\n\n /**\n * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.\n */\n body_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.\n */\n body_loc_args?: string[];\n\n /**\n * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.\n */\n title_loc_key?: string;\n\n /**\n * Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.\n */\n title_loc_args?: string[];\n\n /**\n * The notification's channel id.\n */\n channel_id?: string;\n\n /**\n * Sets the \"ticker\" text, which is sent to accessibility services.\n */\n ticker?: string;\n\n /**\n * When set to false or unset, the notification is automatically dismissed when the user clicks it in the panel.\n */\n sticky?: boolean;\n\n /**\n * Set the time that the event in the notification occurred. Must be a timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: \"2014-10-02T15:01:23.045123456Z\".\n */\n event_time?: string;\n\n /**\n * Set whether or not this notification is relevant only to the current device.\n */\n local_only?: boolean;\n\n /**\n * Set the relative priority for this notification.\n */\n notification_priority?: number;\n\n /**\n * If set to true, use the Android framework's default sound for the notification.\n */\n default_sound?: boolean;\n\n /**\n * Set the Notification.visibility of the notification.\n */\n visibility?: number;\n\n /**\n * Sets the number of items this notification represents.\n */\n notification_count?: number;\n\n /**\n * Contains the URL of an image that is going to be displayed in a notification.\n */\n image?: string;\n}\n\n/**\n * Represents a native ADM notification message payload.\n */\nexport interface AdmNativeMessage {\n /**\n * The notification payload to send with the message.\n */\n notification?: AdmNativeNotification;\n\n /**\n * The payload data to send with the message.\n */\n data?: Record<string, string>;\n\n /**\n * The priority of the msssage.\n */\n priority?: \"normal\" | \"high\";\n\n /**\n * This is an arbitrary string used to indicate that multiple messages are logically the same\n * and that ADM is allowed to drop previously enqueued messages in favor of this new one.\n */\n consolidationKey?: string;\n\n /**\n * The number of seconds that ADM should retain the message if the device is offline.\n */\n expiresAfter?: number;\n\n /**\n * This is a base-64-encoded MD5 checksum of the data parameter.\n */\n md5?: string;\n}\n\n/**\n * Creates a AdmNotification from a native ADM payload.\n * @param nativeMessage - The native message payload to send to Notification Hubs.\n * @returns The AdmNotification to send to Notification Hubs.\n */\nexport function createAdmNotificationBody(nativeMessage: AdmNativeMessage): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Represents the Baidu Apple native payload.\n */\nexport interface BaiduAppleNativePayload {\n /**\n * The alert string.\n */\n alert?: string;\n\n /**\n * The APNs sound to play.\n */\n sound?: string;\n\n /**\n * The APNs badge count.\n */\n badge?: number;\n}\n\n/**\n * Baidu Native Format:\n * https://stackoverflow.com/questions/42591815/customize-baidu-push-json-payload\n * http://www.tuicool.com/articles/ZnmANn\n */\nexport interface BaiduNativeMessage extends Record<string, any> {\n /**\n * Notification title for Android.\n */\n title?: string;\n\n /**\n * Baidu Notification description for Android.\n */\n description?: string;\n\n /**\n * Baidu Notification builder ID.\n */\n notification_builder_id?: number;\n\n /**\n * Baidu Notification Android basic style.\n */\n notification_basic_style?: number;\n\n /**\n * Baidu Android open type.\n */\n open_type?: number;\n\n /**\n * Baidu Android net support option.\n */\n net_support?: number;\n\n /**\n * Baidu Android user confirm.\n */\n user_confirm?: number;\n\n /**\n * Baidu Android URL.\n */\n url?: string;\n\n /**\n * Baidu Android package content.\n */\n pkg_content?: string;\n\n /**\n * Baidu Android package version.\n */\n pkg_version?: string;\n\n /**\n * Baidu Android custom content dictionary.\n */\n custom_content?: Record<string, any>;\n\n /**\n * Baidu APNs support.\n */\n aps?: BaiduAppleNativePayload;\n}\n\n/**\n * Creates a BaiduNotification from a native Baidu payload.\n * @param nativeMessage - The native message payload to send to Notification Hubs.\n * @returns The JSON body to send to Notification Hubs.\n */\nexport function createBaiduNotificationBody(nativeMessage: BaiduNativeMessage): string {\n return JSON.stringify(nativeMessage);\n}\n\n/**\n * Represents the types of Windows Badge Glyphs\n */\nexport type WindowsBadgeGlyphType =\n | \"none\"\n | \"activity\"\n | \"alarm\"\n | \"alert\"\n | \"attention\"\n | \"available\"\n | \"away\"\n | \"busy\"\n | \"error\"\n | \"newMessage\"\n | \"paused\"\n | \"playing\"\n | \"unavailable\";\n\n/**\n * Represents the Windows Badge Message\n */\nexport interface WindowsBadgeNativeMessage {\n /**\n * Either a numeric value or a string value that specifies a predefined badge glyph.\n */\n value: WindowsBadgeGlyphType | number;\n}\n\n/**\n * Builds a WindowsNotification from a Windows Badge.\n * @param nativeMessage - The Windows Badge Message to build.\n * @returns The WNS XML created with the badge information.\n */\nexport function createWindowsBadgeNotificationBody(\n nativeMessage: WindowsBadgeNativeMessage,\n): string {\n const badge = {\n $: { value: nativeMessage.value },\n };\n\n return stringifyXML(badge, { rootName: \"badge\" });\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents the types of registration descriptions.\n */\nexport type RegistrationType =\n | \"Adm\"\n | \"AdmTemplate\"\n | \"Apple\"\n | \"AppleTemplate\"\n | \"Baidu\"\n | \"BaiduTemplate\"\n | \"Browser\"\n | \"BrowserTemplate\"\n | \"Gcm\"\n | \"GcmTemplate\"\n | \"FcmV1\"\n | \"FcmV1Template\"\n | \"Mpns\"\n | \"MpnsTemplate\"\n | \"Xiaomi\"\n | \"XiaomiTemplate\"\n | \"Windows\"\n | \"WindowsTemplate\";\n\n/**\n * Represents a registration description.\n */\nexport interface RegistrationDescriptionCommon {\n /**\n * The registration ID.\n */\n registrationId?: string;\n\n /**\n * The expiration time of the registration.\n */\n expirationTime?: Date;\n\n /**\n * The ETag associated with this description.\n */\n etag?: string;\n\n /**\n * The tags associated with the registration.\n */\n tags?: string[];\n\n /**\n * A dictionary of push variables associated with property bag.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents the description of a template registration.\n */\nexport interface TemplateRegistrationDescription {\n /**\n * The body template.\n */\n bodyTemplate: string;\n\n /**\n * The name of the template.\n */\n templateName?: string;\n\n /**\n * Represents the description of the Amazon Device Messaging (ADM) registration.\n */\n}\nexport interface AdmRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Amazon Device Messaging registration identifier.\n */\n admRegistrationId: string;\n}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) registration.\n */\nexport interface AdmRegistrationDescription extends AdmRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Adm\";\n}\n\n/**\n * Creates an ADM registration description.\n * @param description - A partial ADM registration description.\n * @returns A created ADM registration description.\n */\nexport function createAdmRegistrationDescription(\n description: AdmRegistrationDescriptionCommon,\n): AdmRegistrationDescription {\n return {\n ...description,\n kind: \"Adm\",\n };\n}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) template registration.\n */\nexport interface AdmTemplateRegistrationDescriptionCommon\n extends AdmRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents the description of the Amazon Device Messaging (ADM) template registration.\n */\nexport interface AdmTemplateRegistrationDescription\n extends AdmTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"AdmTemplate\";\n}\n\n/**\n * Creates an ADM template registration description.\n * @param description - A partial ADM template registration description.\n * @returns A created ADM template registration description.\n */\nexport function createAdmTemplateRegistrationDescription(\n description: AdmTemplateRegistrationDescriptionCommon,\n): AdmTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"AdmTemplate\",\n };\n}\n\n/**\n * Represents the description of apple registration.\n */\nexport interface AppleRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The APNs device token.\n */\n deviceToken: string;\n}\n\n/**\n * Represents the description of apple registration.\n */\nexport interface AppleRegistrationDescription extends AppleRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Apple\";\n}\n\n/**\n * Creates an Apple registration description.\n * @param description - A partial Apple registration description.\n * @returns A created Apple registration description.\n */\nexport function createAppleRegistrationDescription(\n description: AppleRegistrationDescriptionCommon,\n): AppleRegistrationDescription {\n return {\n ...description,\n kind: \"Apple\",\n };\n}\n\n/**\n * Represents the description of the Apple template registration.\n */\nexport interface AppleTemplateRegistrationDescriptionCommon\n extends AppleRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The expiry date.\n */\n expiry?: Date;\n\n /**\n * The notification priority.\n */\n priority?: \"10\" | \"5\";\n\n /**\n * The APNS headers.\n */\n apnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents the description of the Apple template registration.\n */\nexport interface AppleTemplateRegistrationDescription\n extends AppleTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"AppleTemplate\";\n}\n\n/**\n * Creates an Apple template registration description.\n * @param description - A partial Apple template registration description.\n * @returns A created Apple template registration description.\n */\nexport function createAppleTemplateRegistrationDescription(\n description: AppleTemplateRegistrationDescriptionCommon,\n): AppleTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"AppleTemplate\",\n };\n}\n\nexport interface BaiduRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Baidu user identifier.\n */\n baiduUserId: string;\n\n /**\n * The Baidu channel identifier.\n */\n baiduChannelId: string;\n}\n\n/**\n * Represents a Baidu registration description.\n */\nexport interface BaiduRegistrationDescription extends BaiduRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Baidu\";\n}\n\n/**\n * Creates a Baidu registration description.\n * @param description - A partial Baidu registration description.\n * @returns A created Baidu registration description.\n */\nexport function createBaiduRegistrationDescription(\n description: BaiduRegistrationDescriptionCommon,\n): BaiduRegistrationDescription {\n return {\n ...description,\n kind: \"Baidu\",\n };\n}\n\n/**\n * Represents a Baidu template registration description.\n */\nexport interface BaiduTemplateRegistrationDescriptionCommon\n extends BaiduRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Baidu template registration description.\n */\nexport interface BaiduTemplateRegistrationDescription\n extends BaiduTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"BaiduTemplate\";\n}\n\n/**\n * Creates a Baidu template registration description.\n * @param description - A partial Baidu template registration description.\n * @returns A created Baidu template registration description.\n */\nexport function createBaiduTemplateRegistrationDescription(\n description: BaiduTemplateRegistrationDescriptionCommon,\n): BaiduTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"BaiduTemplate\",\n };\n}\n\n/**\n * Represents a Browser Push registration description.\n */\nexport interface BrowserRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Browser push endpoint.\n */\n endpoint: string;\n\n /**\n * The Browser push P256DH.\n */\n p256dh: string;\n\n /**\n * The Browser push auth secret.\n */\n auth: string;\n}\n\n/**\n * Represents a Browser Push registration description.\n */\nexport interface BrowserRegistrationDescription extends BrowserRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Browser\";\n}\n\n/**\n * Creates a Web Push registration description.\n * @param description - A partial Web Push registration description.\n * @returns A created Web Push registration description.\n */\nexport function createBrowserRegistrationDescription(\n description: BrowserRegistrationDescriptionCommon,\n): BrowserRegistrationDescription {\n return {\n ...description,\n kind: \"Browser\",\n };\n}\n\n/**\n * Represents a Browser Push remplate registration description.\n */\nexport interface BrowserTemplateRegistrationDescriptionCommon\n extends BrowserRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Browser Push remplate registration description.\n */\nexport interface BrowserTemplateRegistrationDescription\n extends BrowserTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"BrowserTemplate\";\n}\n\n/**\n * Creates a Web Push registration description.\n * @param description - A partial Web Push template registration description.\n * @returns A created Web Push template registration description.\n */\nexport function createBrowserTemplateRegistrationDescription(\n description: BrowserTemplateRegistrationDescriptionCommon,\n): BrowserTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"BrowserTemplate\",\n };\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface GcmRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * Registration id obtained from the Google Cloud Messaging service.\n */\n gcmRegistrationId: string;\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface GcmRegistrationDescription extends GcmRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Gcm\";\n}\n\n/**\n * Creates a Firebase Legacy registration description.\n * @param description - A partial GCM registration description.\n * @returns A created GCM registration description.\n */\nexport function createFcmLegacyRegistrationDescription(\n description: GcmRegistrationDescriptionCommon,\n): GcmRegistrationDescription {\n return {\n ...description,\n kind: \"Gcm\",\n };\n}\n\n/**\n * Represents Notification Hub template registration description for Firebase Legacy Cloud Messaging.\n */\nexport interface GcmTemplateRegistrationDescriptionCommon\n extends GcmRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents Notification Hub template registration description for Firebase Legacy Cloud Messaging.\n */\nexport interface GcmTemplateRegistrationDescription\n extends GcmTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"GcmTemplate\";\n}\n\n/**\n * Creates a GCM template registration description.\n * @param description - A partial GCM template registration description.\n * @returns A created GCM template registration description.\n */\nexport function createFcmLegacyTemplateRegistrationDescription(\n description: GcmTemplateRegistrationDescriptionCommon,\n): GcmTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"GcmTemplate\",\n };\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface FcmV1RegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * Registration id obtained from the Firebase Cloud Messaging service.\n */\n fcmV1RegistrationId: string;\n}\n\n/**\n * Represents Notification Hub registration description for Google Cloud Messaging.\n */\nexport interface FcmV1RegistrationDescription extends FcmV1RegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"FcmV1\";\n}\n\n/**\n * Creates a Firebase V1 registration description.\n * @param description - A partial FCM V1 registration description.\n * @returns A created FCM V1 registration description.\n */\nexport function createFcmV1RegistrationDescription(\n description: FcmV1RegistrationDescriptionCommon,\n): FcmV1RegistrationDescription {\n return {\n ...description,\n kind: \"FcmV1\",\n };\n}\n\n/**\n * Represents Notification Hub template registration description for Firebase V1 Cloud Messaging.\n */\nexport interface FcmV1TemplateRegistrationDescriptionCommon\n extends FcmV1RegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents Notification Hub template registration description for Firebase V1 Cloud Messaging.\n */\nexport interface FcmV1TemplateRegistrationDescription\n extends FcmV1TemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"FcmV1Template\";\n}\n\n/**\n * Creates a FCM V1 template registration description.\n * @param description - A partial FCM V1 template registration description.\n * @returns A created FCM V1 template registration description.\n */\nexport function createFcmV1TemplateRegistrationDescription(\n description: FcmV1TemplateRegistrationDescriptionCommon,\n): FcmV1TemplateRegistrationDescription {\n return {\n ...description,\n kind: \"FcmV1Template\",\n };\n}\n\n/**\n * Represents a Windows Phone Notification Services registration description.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The channel URI.\n */\n channelUri: string;\n}\n\n/**\n * Represents a Windows Phone Notification Services registration description.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsRegistrationDescription extends MpnsRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Mpns\";\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescription\n extends MpnsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n mpnsHeaders?: Record<string, string>;\n\n /**\n * The kind of the registration.\n */\n kind: \"MpnsTemplate\";\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescriptionCommon\n extends MpnsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n mpnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents a Windows Phone Notification Services template registration.\n * @deprecated Windows Phone is no longer supported.\n */\nexport interface MpnsTemplateRegistrationDescription\n extends MpnsTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"MpnsTemplate\";\n}\n\n/**\n * Represents a Windows Notification Services (WNS) registration description.\n */\nexport interface WindowsRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The channel URI.\n */\n channelUri: string;\n}\n\n/**\n * Represents a Windows Notification Services (WNS) registration description.\n */\nexport interface WindowsRegistrationDescription extends WindowsRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Windows\";\n}\n\n/**\n * Creates a Windows registration description.\n * @param description - A partial Windows registration description.\n * @returns A created Windows registration description.\n */\nexport function createWindowsRegistrationDescription(\n description: WindowsRegistrationDescriptionCommon,\n): WindowsRegistrationDescription {\n return {\n ...description,\n kind: \"Windows\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface WindowsTemplateRegistrationDescriptionCommon\n extends WindowsRegistrationDescriptionCommon,\n TemplateRegistrationDescription {\n /**\n * The WNS headers.\n */\n wnsHeaders?: Record<string, string>;\n}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface WindowsTemplateRegistrationDescription\n extends WindowsTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"WindowsTemplate\";\n}\n\n/**\n * Creates a Windows template registration description.\n * @param description - A partial Windows template registration description.\n * @returns A created Windows template registration description.\n */\nexport function createWindowsTemplateRegistrationDescription(\n description: WindowsTemplateRegistrationDescriptionCommon,\n): WindowsTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"WindowsTemplate\",\n };\n}\n\n/**\n * Represents a Xiaomi registration description.\n */\nexport interface XiaomiRegistrationDescriptionCommon extends RegistrationDescriptionCommon {\n /**\n * The Xiaomi registration ID.\n */\n xiaomiRegistrationId: string;\n}\n\n/**\n * Represents a Xiaomi registration description.\n */\nexport interface XiaomiRegistrationDescription extends XiaomiRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"Xiaomi\";\n}\n\n/**\n * Creates a Xiaomi registration description.\n * @param description - A partial Xiaomi registration description.\n * @returns A created Xiaomi registration description.\n */\nexport function createXiaomiRegistrationDescription(\n description: XiaomiRegistrationDescriptionCommon,\n): XiaomiRegistrationDescription {\n return {\n ...description,\n kind: \"Xiaomi\",\n };\n}\n\n/**\n * Represents a Xiaomi template registration.\n */\nexport interface XiaomiTemplateRegistrationDescriptionCommon\n extends XiaomiRegistrationDescriptionCommon,\n TemplateRegistrationDescription {}\n\n/**\n * Represents a Windows Notification Services (WNS) template registration.\n */\nexport interface XiaomiTemplateRegistrationDescription\n extends XiaomiTemplateRegistrationDescriptionCommon {\n /**\n * The kind of the registration.\n */\n kind: \"XiaomiTemplate\";\n}\n\n/**\n * Creates a Xiaomi template registration description.\n * @param description - A partial Xiaomi template registration description.\n * @returns A created Xiaomi template registration description.\n */\nexport function createXiaomiTemplateRegistrationDescription(\n description: XiaomiTemplateRegistrationDescriptionCommon,\n): XiaomiTemplateRegistrationDescription {\n return {\n ...description,\n kind: \"XiaomiTemplate\",\n };\n}\n\n/**\n * Describes the types of registration descriptions.\n */\nexport type RegistrationDescription =\n | AdmRegistrationDescription\n | AdmTemplateRegistrationDescription\n | AppleRegistrationDescription\n | AppleTemplateRegistrationDescription\n | BaiduRegistrationDescription\n | BaiduTemplateRegistrationDescription\n | BrowserRegistrationDescription\n | BrowserTemplateRegistrationDescription\n | GcmRegistrationDescription\n | GcmTemplateRegistrationDescription\n | FcmV1RegistrationDescription\n | FcmV1TemplateRegistrationDescription\n | MpnsRegistrationDescription\n | MpnsTemplateRegistrationDescription\n | XiaomiRegistrationDescription\n | XiaomiTemplateRegistrationDescription\n | WindowsRegistrationDescription\n | WindowsTemplateRegistrationDescription;\n\n/**\n * Describes an ADM Registration channel query.\n */\nexport interface AdmRegistrationChannel {\n /**\n * The ADM Registration ID.\n */\n admRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"adm\";\n}\n\n/**\n * Describes an Apple Registration channel query.\n */\nexport interface AppleRegistrationChannel {\n /**\n * The APNs device token.\n */\n deviceToken: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"apple\";\n}\n\n/**\n * Describes an Baidu Registration channel query.\n */\nexport interface BaiduRegistrationChannel {\n /**\n * The Baidu Channel ID.\n */\n baiduChannelId: string;\n /**\n * The Baidu User ID.\n */\n baiduUserId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"baidu\";\n}\n\n/**\n * Describes an Browser Registration channel query.\n */\nexport interface BrowserRegistrationChannel {\n /**\n * The Web Push endpoint URL.\n */\n endpoint: string;\n /**\n * The Web Push subscription P256DH.\n */\n p256dh: string;\n /**\n * The Web Push subscription auth secret.\n */\n auth: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"browser\";\n}\n\n/**\n * Describes an Firebase Legacy Registration channel query.\n */\nexport interface FirebaseLegacyRegistrationChannel {\n /**\n * The FCM Legacy registration ID.\n */\n gcmRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"gcm\";\n}\n\n/**\n * Describes an Firebase Legacy Registration channel query.\n */\nexport interface FirebaseV1RegistrationChannel {\n /**\n * The FCM V1 registration ID.\n */\n fcmV1RegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"fcmv1\";\n}\n\n/**\n * Describes an Windows Notification Services Registration channel query.\n */\nexport interface WindowsRegistrationChannel {\n /**\n * The WNS Channel URI.\n */\n channelUri: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"windows\";\n}\n\n/**\n * Describes an Xiaomi Registration channel query.\n */\nexport interface XiaomiRegistrationChannel {\n /**\n * The Xiaomi registration ID.\n */\n xiaomiRegistrationId: string;\n /**\n * The kind of the registration channel.\n */\n kind: \"xiaomi\";\n}\n\n/**\n * Describes a Registration query.\n */\nexport type RegistrationChannel =\n | AdmRegistrationChannel\n | AppleRegistrationChannel\n | BaiduRegistrationChannel\n | BrowserRegistrationChannel\n | FirebaseLegacyRegistrationChannel\n | FirebaseV1RegistrationChannel\n | XiaomiRegistrationChannel\n | WindowsRegistrationChannel;\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Creates a tag expression from a list of tags as a || expression.\n * @param tags - The tags to create the || expression\n * @returns The tag expression made from the array of strings into an || expression.\n */\nexport function createTagExpression(tags: string[]): string {\n return tags.join(\"||\");\n}\n"],"names":["createHmac","constants.SDK_VERSION","createDefaultHttpClient","getClient","RestError","createHttpHeaders","parseXML","createPipelineRequest","stringifyXML","createTracingClient","OPERATION_NAME","delay","__asyncValues","__await","__asyncDelegator","objectHasProperty","randomUUID","createOrUpdateInstallationMethod","deleteInstallationMethod","getInstallationMethod","updateInstallationMethod","createRegistrationIdMethod","createRegistrationMethod","createOrUpdateRegistrationMethod","updateRegistrationMethod","getRegistrationMethod","listRegistrationsMethod","listRegistrationsByChannelMethod","listRegistrationsByTagMethod","sendNotificationMethod","scheduleNotificationMethod","cancelScheduledNotificationMethod","getFeedbackContainerUrlMethod","getNotificationOutcomeDetailsMethod","getNotificationHubJobMethod","beginSubmitNotificationHubJobMethod","submitNotificationHubJobMethod","listNotificationHubJobsMethod","Constants.JSON_CONTENT_TYPE","Constants.WNS_TOAST","Constants.WNS_TITLE","Constants.WNS_BADGE","Constants.WNS_RAW","Constants.XML_CONTENT_TYPE","Constants.WNS_TYPE_NAME","Constants.STREAM_CONTENT_TYPE"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAEO,MAAM,WAAW,GAAW,OAAO,CAAC;AAEpC,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAC3D,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAC3C,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAEvD,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,OAAO,GAAG,SAAS,CAAC;AAC1B,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,SAAS,GAAG,UAAU,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