"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExecutionClass=exports.WorkerType=exports.GlueStartJobRun=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},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},task_utils_1=()=>{var tmp=require("../private/task-utils");return task_utils_1=()=>tmp,tmp};class GlueStartJobRun extends sfn().TaskStateBase{constructor(scope,id,props){super(scope,id,props),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_GlueStartJobRunProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,GlueStartJobRun),error}this.integrationPattern=props.integrationPattern??sfn().IntegrationPattern.REQUEST_RESPONSE,(0,task_utils_1().validatePatternSupported)(this.integrationPattern,GlueStartJobRun.SUPPORTED_INTEGRATION_PATTERNS),this.taskPolicies=this.getPolicies(),this.taskMetrics={metricPrefixSingular:"GlueJob",metricPrefixPlural:"GlueJobs",metricDimensions:{GlueJobName:this.props.glueJobName}}}_renderTask(){const notificationProperty=this.props.notifyDelayAfter?{NotifyDelayAfter:this.props.notifyDelayAfter.toMinutes()}:null;let timeout;return this.props.timeout?timeout=this.props.timeout.toMinutes():this.props.taskTimeout?.seconds?timeout=core_1().Duration.seconds(this.props.taskTimeout.seconds).toMinutes():this.props.taskTimeout?.path&&(timeout=sfn().JsonPath.numberAt(this.props.taskTimeout.path)),{Resource:(0,task_utils_1().integrationResourceArn)("glue","startJobRun",this.integrationPattern),Parameters:sfn().FieldUtils.renderObject({JobName:this.props.glueJobName,Arguments:this.props.arguments?.value,Timeout:timeout,SecurityConfiguration:this.props.securityConfiguration,NotificationProperty:notificationProperty,WorkerType:this.props.workerConfiguration?.workerType,NumberOfWorkers:this.props.workerConfiguration?.numberOfWorkers,ExecutionClass:this.props.executionClass}),TimeoutSeconds:void 0,TimeoutSecondsPath:void 0}}getPolicies(){let iamActions;return this.integrationPattern===sfn().IntegrationPattern.REQUEST_RESPONSE?iamActions=["glue:StartJobRun"]:this.integrationPattern===sfn().IntegrationPattern.RUN_JOB&&(iamActions=["glue:StartJobRun","glue:GetJobRun","glue:GetJobRuns","glue:BatchStopJobRun"]),[new(iam()).PolicyStatement({resources:[core_1().Stack.of(this).formatArn({service:"glue",resource:"job",resourceName:this.props.glueJobName})],actions:iamActions})]}}exports.GlueStartJobRun=GlueStartJobRun,_a=JSII_RTTI_SYMBOL_1,GlueStartJobRun[_a]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.GlueStartJobRun",version:"2.159.0"},GlueStartJobRun.SUPPORTED_INTEGRATION_PATTERNS=[sfn().IntegrationPattern.REQUEST_RESPONSE,sfn().IntegrationPattern.RUN_JOB];var WorkerType;(function(WorkerType2){WorkerType2.STANDARD="Standard",WorkerType2.G_025X="G.025X",WorkerType2.G_1X="G.1X",WorkerType2.G_2X="G.2X",WorkerType2.G_4X="G.4X",WorkerType2.G_8X="G.8X",WorkerType2.Z_2X="Z.2X"})(WorkerType||(exports.WorkerType=WorkerType={}));var ExecutionClass;(function(ExecutionClass2){ExecutionClass2.FLEX="FLEX",ExecutionClass2.STANDARD="STANDARD"})(ExecutionClass||(exports.ExecutionClass=ExecutionClass={}));
