"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodePipeline=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),util_1=require("./util"),iam=require("../../aws-iam");class CodePipeline{constructor(pipeline,options={}){this.pipeline=pipeline,this.options=options;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_codepipeline_IPipeline(pipeline),jsiiDeprecationWarnings.aws_cdk_lib_aws_events_targets_CodePipelineTargetOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CodePipeline),error}}bind(_rule,_id){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_events_IRule(_rule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}const role=this.options.eventRole||(0,util_1.singletonEventRole)(this.pipeline);return role.addToPrincipalPolicy(new iam.PolicyStatement({resources:[this.pipeline.pipelineArn],actions:["codepipeline:StartPipelineExecution"]})),{...(0,util_1.bindBaseTargetConfig)(this.options),id:"",arn:this.pipeline.pipelineArn,role,targetResource:this.pipeline}}}exports.CodePipeline=CodePipeline,_a=JSII_RTTI_SYMBOL_1,CodePipeline[_a]={fqn:"aws-cdk-lib.aws_events_targets.CodePipeline",version:"2.96.1"};
