"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReceiptRuleSet=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),core_1=require("../../core"),receipt_rule_1=require("./receipt-rule"),ses_generated_1=require("./ses.generated");class ReceiptRuleSetBase extends core_1.Resource{addRule(id,options){var _b;return this.lastAddedRule=new receipt_rule_1.ReceiptRule(this,id,{after:(_b=this.lastAddedRule)!==null&&_b!==void 0?_b:void 0,ruleSet:this,...options}),this.lastAddedRule}addDropSpamRule(){const dropSpam=new receipt_rule_1.DropSpamReceiptRule(this,"DropSpam",{ruleSet:this});this.lastAddedRule=dropSpam.rule}}class ReceiptRuleSet extends ReceiptRuleSetBase{constructor(scope,id,props={}){super(scope,id,{physicalName:props.receiptRuleSetName});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ses_ReceiptRuleSetProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}const resource=new ses_generated_1.CfnReceiptRuleSet(this,"Resource",{ruleSetName:this.physicalName});this.receiptRuleSetName=resource.ref,props&&(props.dropSpam&&this.addDropSpamRule(),(props.rules||[]).forEach((ruleOption,idx)=>this.addRule(`Rule${idx}`,ruleOption)))}static fromReceiptRuleSetName(scope,id,receiptRuleSetName){class Import extends ReceiptRuleSetBase{constructor(){super(...arguments),this.receiptRuleSetName=receiptRuleSetName}}return new Import(scope,id)}}exports.ReceiptRuleSet=ReceiptRuleSet,_a=JSII_RTTI_SYMBOL_1,ReceiptRuleSet[_a]={fqn:"aws-cdk-lib.aws_ses.ReceiptRuleSet",version:"2.21.0"};
//# sourceMappingURL=receipt-rule-set.js.map
