"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.TopicPolicy=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),sns_generated_1=require("./sns.generated"),aws_iam_1=require("../../aws-iam"),core_1=require("../../core");class TopicPolicy extends core_1.Resource{constructor(scope,id,props){super(scope,id),this.document=new aws_iam_1.PolicyDocument({assignSids:!0});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_sns_TopicPolicyProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,TopicPolicy),error}this.document=props.policyDocument??this.document,new sns_generated_1.CfnTopicPolicy(this,"Resource",{policyDocument:this.document,topics:props.topics.map(t=>t.topicArn)})}}exports.TopicPolicy=TopicPolicy,_a=JSII_RTTI_SYMBOL_1,TopicPolicy[_a]={fqn:"aws-cdk-lib.aws_sns.TopicPolicy",version:"2.96.1"};
