"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"),receipt_rule_1=require("./receipt-rule"),ses_generated_1=require("./ses.generated"),core_1=require("../../core");class ReceiptRuleSetBase extends core_1.Resource{addRule(id,options){return this.lastAddedRule=new receipt_rule_1.ReceiptRule(this,id,{after:this.lastAddedRule??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{static fromReceiptRuleSetName(scope,id,receiptRuleSetName){class Import extends ReceiptRuleSetBase{constructor(){super(...arguments),this.receiptRuleSetName=receiptRuleSetName}}return new Import(scope,id)}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,ReceiptRuleSet),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)))}}exports.ReceiptRuleSet=ReceiptRuleSet,_a=JSII_RTTI_SYMBOL_1,ReceiptRuleSet[_a]={fqn:"aws-cdk-lib.aws_ses.ReceiptRuleSet",version:"2.96.1"};
