1 | ;
|
2 | var _a;
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | exports.EmailSubscription = void 0;
|
5 | const jsiiDeprecationWarnings = require("../.warnings.jsii.js");
|
6 | const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
7 | const sns = require("@aws-cdk/aws-sns");
|
8 | /**
|
9 | * Use an email address as a subscription target
|
10 | *
|
11 | * Email subscriptions require confirmation.
|
12 | */
|
13 | class EmailSubscription {
|
14 | constructor(emailAddress, props = {}) {
|
15 | this.emailAddress = emailAddress;
|
16 | this.props = props;
|
17 | try {
|
18 | jsiiDeprecationWarnings._aws_cdk_aws_sns_subscriptions_EmailSubscriptionProps(props);
|
19 | }
|
20 | catch (error) {
|
21 | if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
|
22 | Error.captureStackTrace(error, EmailSubscription);
|
23 | }
|
24 | throw error;
|
25 | }
|
26 | }
|
27 | /**
|
28 | * Returns a configuration for an email address to subscribe to an SNS topic
|
29 | */
|
30 | bind(_topic) {
|
31 | return {
|
32 | subscriberId: this.emailAddress,
|
33 | endpoint: this.emailAddress,
|
34 | protocol: this.props.json ? sns.SubscriptionProtocol.EMAIL_JSON : sns.SubscriptionProtocol.EMAIL,
|
35 | filterPolicy: this.props.filterPolicy,
|
36 | deadLetterQueue: this.props.deadLetterQueue,
|
37 | };
|
38 | }
|
39 | }
|
40 | exports.EmailSubscription = EmailSubscription;
|
41 | _a = JSII_RTTI_SYMBOL_1;
|
42 | EmailSubscription[_a] = { fqn: "@aws-cdk/aws-sns-subscriptions.EmailSubscription", version: "1.204.0" };
|
43 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1haWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJlbWFpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSx3Q0FBd0M7QUFnQnhDOzs7O0dBSUc7QUFDSCxN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