"use strict";
/*
 * 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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkspaceNotificationRecipientEmailImpl = void 0;
const tslib_1 = require("tslib");
const coreClient = tslib_1.__importStar(require("@azure/core-client"));
const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
/** Class containing WorkspaceNotificationRecipientEmail operations. */
class WorkspaceNotificationRecipientEmailImpl {
    /**
     * Initialize a new instance of the class WorkspaceNotificationRecipientEmail class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Gets the list of the Notification Recipient Emails subscribed to a 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 Notification Recipient Email 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 email Email identifier.
     * @param options The options parameters.
     */
    checkEntityExists(resourceGroupName, serviceName, workspaceId, notificationName, email, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serviceName,
            workspaceId,
            notificationName,
            email,
            options,
        }, checkEntityExistsOperationSpec);
    }
    /**
     * Adds the Email address 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 email Email identifier.
     * @param options The options parameters.
     */
    createOrUpdate(resourceGroupName, serviceName, workspaceId, notificationName, email, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serviceName,
            workspaceId,
            notificationName,
            email,
            options,
        }, createOrUpdateOperationSpec);
    }
    /**
     * Removes the email 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 email Email identifier.
     * @param options The options parameters.
     */
    delete(resourceGroupName, serviceName, workspaceId, notificationName, email, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serviceName,
            workspaceId,
            notificationName,
            email,
            options,
        }, deleteOperationSpec);
    }
}
exports.WorkspaceNotificationRecipientEmailImpl = WorkspaceNotificationRecipientEmailImpl;
// 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}/recipientEmails",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.RecipientEmailCollection,
        },
        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}/recipientEmails/{email}",
    httpMethod: "HEAD",
    responses: {
        204: {},
        404: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.notificationName,
        Parameters.email,
        Parameters.workspaceId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientEmails/{email}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.RecipientEmailContract,
        },
        201: {
            bodyMapper: Mappers.RecipientEmailContract,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.notificationName,
        Parameters.email,
        Parameters.workspaceId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientEmails/{email}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.notificationName,
        Parameters.email,
        Parameters.workspaceId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=workspaceNotificationRecipientEmail.js.map