"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.GlueStartJobRun=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),iam=require("../../../aws-iam"),sfn=require("../../../aws-stepfunctions"),core_1=require("../../../core"),task_utils_1=require("../private/task-utils");class GlueStartJobRun extends sfn.TaskStateBase{constructor(scope,id,props){var _b;super(scope,id,props);this.props=props,jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_tasks_GlueStartJobRunProps(props),this.integrationPattern=(_b=props.integrationPattern)!==null&&_b!==void 0?_b:sfn.IntegrationPattern.REQUEST_RESPONSE,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(){var _b,_c;const notificationProperty=this.props.notifyDelayAfter?{NotifyDelayAfter:this.props.notifyDelayAfter.toMinutes()}:null;return{Resource:task_utils_1.integrationResourceArn("glue","startJobRun",this.integrationPattern),Parameters:sfn.FieldUtils.renderObject({JobName:this.props.glueJobName,Arguments:(_b=this.props.arguments)===null||_b===void 0?void 0:_b.value,Timeout:(_c=this.props.timeout)===null||_c===void 0?void 0:_c.toMinutes(),SecurityConfiguration:this.props.securityConfiguration,NotificationProperty:notificationProperty}),TimeoutSeconds: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.13.0"},GlueStartJobRun.SUPPORTED_INTEGRATION_PATTERNS=[sfn.IntegrationPattern.REQUEST_RESPONSE,sfn.IntegrationPattern.RUN_JOB];
//# sourceMappingURL=start-job-run.js.map
