"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.NotificationRecipientEmailImpl = 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 NotificationRecipientEmail operations. */
class NotificationRecipientEmailImpl {
    /**
     * Initialize a new instance of the class NotificationRecipientEmail 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 notificationName Notification Name Identifier.
     * @param options The options parameters.
     */
    listByNotification(resourceGroupName, serviceName, notificationName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, 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 notificationName Notification Name Identifier.
     * @param email Email identifier.
     * @param options The options parameters.
     */
    checkEntityExists(resourceGroupName, serviceName, notificationName, email, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, 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 notificationName Notification Name Identifier.
     * @param email Email identifier.
     * @param options The options parameters.
     */
    createOrUpdate(resourceGroupName, serviceName, notificationName, email, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, 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 notificationName Notification Name Identifier.
     * @param email Email identifier.
     * @param options The options parameters.
     */
    delete(resourceGroupName, serviceName, notificationName, email, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, notificationName, email, options }, deleteOperationSpec);
    }
}
exports.NotificationRecipientEmailImpl = NotificationRecipientEmailImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listByNotificationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/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,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const checkEntityExistsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/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,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/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,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/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,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=notificationRecipientEmail.js.map