"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cdk_1 = require("@aws-cdk/cdk");
const sns_generated_1 = require("./sns.generated");
/**
 * A new subscription.
 *
 * Prefer to use the `TopicRef.subscribeXxx()` methods to creating instances of
 * this class.
 */
class Subscription extends cdk_1.Construct {
    constructor(parent, name, props) {
        super(parent, name);
        new sns_generated_1.cloudformation.SubscriptionResource(this, 'Resource', {
            endpoint: props.endpoint,
            protocol: props.protocol,
            topicArn: props.topic.topicArn
        });
    }
}
exports.Subscription = Subscription;
/**
 * The type of subscription, controlling the type of the endpoint parameter.
 */
var SubscriptionProtocol;
(function (SubscriptionProtocol) {
    /**
     * JSON-encoded message is POSTED to an HTTP url.
     */
    SubscriptionProtocol["Http"] = "http";
    /**
     * JSON-encoded message is POSTed to an HTTPS url.
     */
    SubscriptionProtocol["Https"] = "https";
    /**
     * Notifications are sent via email.
     */
    SubscriptionProtocol["Email"] = "email";
    /**
     * Notifications are JSON-encoded and sent via mail.
     */
    SubscriptionProtocol["EmailJson"] = "email-json";
    /**
     * Notification is delivered by SMS
     */
    SubscriptionProtocol["Sms"] = "sms";
    /**
     * Notifications are enqueued into an SQS queue.
     */
    SubscriptionProtocol["Sqs"] = "sqs";
    /**
     * JSON-encoded notifications are sent to a mobile app endpoint.
     */
    SubscriptionProtocol["Application"] = "application";
    /**
     * Notifications trigger a Lambda function.
     */
    SubscriptionProtocol["Lambda"] = "lambda";
})(SubscriptionProtocol = exports.SubscriptionProtocol || (exports.SubscriptionProtocol = {}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Vic2NyaXB0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic3Vic2NyaXB0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsc0NBQXlDO0FBQ3pDLG1EQUFpRDtBQXlCakQ7Ozs7O0dBS0c7QUFDSCxNQUFhLFlBQWEsU0FBUSxlQU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