"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SqsSendMessage=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},sfn=()=>{var tmp=require("../../../aws-stepfunctions");return sfn=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},task_utils_1=()=>{var tmp=require("../private/task-utils");return task_utils_1=()=>tmp,tmp};class SqsSendMessage extends sfn().TaskStateBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.SqsSendMessage",version:"2.256.1"};static jsonPath(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_SqsSendMessageJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new SqsSendMessage(scope,id,props)}static jsonata(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_SqsSendMessageJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new SqsSendMessage(scope,id,{...props,queryLanguage:sfn().QueryLanguage.JSONATA})}static SUPPORTED_INTEGRATION_PATTERNS=[sfn().IntegrationPattern.REQUEST_RESPONSE,sfn().IntegrationPattern.WAIT_FOR_TASK_TOKEN];taskMetrics;taskPolicies;integrationPattern;constructor(scope,id,props){super(scope,id,props),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_SqsSendMessageProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SqsSendMessage),error}if(this.integrationPattern=props.integrationPattern??sfn().IntegrationPattern.REQUEST_RESPONSE,(0,task_utils_1().validatePatternSupported)(this.integrationPattern,SqsSendMessage.SUPPORTED_INTEGRATION_PATTERNS),props.integrationPattern===sfn().IntegrationPattern.WAIT_FOR_TASK_TOKEN&&!sfn().FieldUtils.containsTaskToken(props.messageBody))throw new(cdk()).ValidationError((0,literal_string_1().lit)`TaskTokenRequired`,"Task Token is required in `messageBody` Use JsonPath.taskToken to set the token.",this);this.taskPolicies=[new(iam()).PolicyStatement({actions:["sqs:SendMessage"],resources:[this.props.queue.queueArn]})],this.props.queue.encryptionMasterKey&&this.taskPolicies.push(new(iam()).PolicyStatement({actions:["kms:Decrypt","kms:GenerateDataKey*"],resources:[this.props.queue.encryptionMasterKey.keyArn]}))}_renderTask(topLevelQueryLanguage){const queryLanguage=sfn()._getActualQueryLanguage(topLevelQueryLanguage,this.props.queryLanguage);return{Resource:(0,task_utils_1().integrationResourceArn)("sqs","sendMessage",this.integrationPattern),...this._renderParametersOrArguments({QueueUrl:this.props.queue.queueUrl,MessageBody:this.props.messageBody.value,DelaySeconds:this.props.delay?.toSeconds(),MessageDeduplicationId:this.props.messageDeduplicationId,MessageGroupId:this.props.messageGroupId},queryLanguage)}}}exports.SqsSendMessage=SqsSendMessage;
