/*
 * Copyright (c) Microsoft Corporation.
 * Licensed under the MIT License.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is regenerated.
 */
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
/** Class containing WorkspaceNotificationRecipientUser operations. */
export class WorkspaceNotificationRecipientUserImpl {
    /**
     * Initialize a new instance of the class WorkspaceNotificationRecipientUser class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Gets the list of the Notification Recipient User subscribed to the notification.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param workspaceId Workspace identifier. Must be unique in the current API Management service
     *                    instance.
     * @param notificationName Notification Name Identifier.
     * @param options The options parameters.
     */
    listByNotification(resourceGroupName, serviceName, workspaceId, notificationName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serviceName,
            workspaceId,
            notificationName,
            options,
        }, listByNotificationOperationSpec);
    }
    /**
     * Determine if the Notification Recipient User is subscribed to the notification.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param workspaceId Workspace identifier. Must be unique in the current API Management service
     *                    instance.
     * @param notificationName Notification Name Identifier.
     * @param userId User identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    checkEntityExists(resourceGroupName, serviceName, workspaceId, notificationName, userId, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serviceName,
            workspaceId,
            notificationName,
            userId,
            options,
        }, checkEntityExistsOperationSpec);
    }
    /**
     * Adds the API Management User to the list of Recipients for the Notification.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param workspaceId Workspace identifier. Must be unique in the current API Management service
     *                    instance.
     * @param notificationName Notification Name Identifier.
     * @param userId User identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    createOrUpdate(resourceGroupName, serviceName, workspaceId, notificationName, userId, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serviceName,
            workspaceId,
            notificationName,
            userId,
            options,
        }, createOrUpdateOperationSpec);
    }
    /**
     * Removes the API Management user from the list of Notification.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param workspaceId Workspace identifier. Must be unique in the current API Management service
     *                    instance.
     * @param notificationName Notification Name Identifier.
     * @param userId User identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    delete(resourceGroupName, serviceName, workspaceId, notificationName, userId, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serviceName,
            workspaceId,
            notificationName,
            userId,
            options,
        }, deleteOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listByNotificationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientUsers",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.RecipientUserCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.notificationName,
        Parameters.workspaceId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const checkEntityExistsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientUsers/{userId}",
    httpMethod: "HEAD",
    responses: {
        204: {},
        404: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.userId,
        Parameters.notificationName,
        Parameters.workspaceId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientUsers/{userId}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.RecipientUserContract,
        },
        201: {
            bodyMapper: Mappers.RecipientUserContract,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.userId,
        Parameters.notificationName,
        Parameters.workspaceId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientUsers/{userId}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.userId,
        Parameters.notificationName,
        Parameters.workspaceId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=workspaceNotificationRecipientUser.js.map