"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KinesisStreamPutRecord=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var target_1=()=>{var tmp=require("./target");return target_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class KinesisStreamPutRecord extends target_1().ScheduleTargetBase{stream;props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler_targets.KinesisStreamPutRecord",version:"2.256.1"};constructor(stream,props){super(props,stream.streamArn),this.stream=stream,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_kinesis_IStream(stream),jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_targets_KinesisStreamPutRecordProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,KinesisStreamPutRecord),error}if(!core_1().Token.isUnresolved(props.partitionKey)&&(props.partitionKey.length<1||props.partitionKey.length>256))throw new(core_1()).ValidationError((0,literal_string_1().lit)`PartitionKeyLength`,`partitionKey length must be between 1 and 256, got ${props.partitionKey.length}`,stream)}addTargetActionToRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addTargetActionToRole),error}this.stream.grant(role,"kinesis:PutRecord","kinesis:PutRecords"),this.stream.encryptionKey?.grant(role,"kms:GenerateDataKey*")}bindBaseTargetConfig(_schedule){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_ISchedule(_schedule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindBaseTargetConfig),error}return{...super.bindBaseTargetConfig(_schedule),kinesisParameters:{partitionKey:this.props.partitionKey}}}}exports.KinesisStreamPutRecord=KinesisStreamPutRecord;
