software.amazon.textract.idp.ComprehendGenericSyncSfnTask Maven / Gradle / Ivy
Show all versions of idp-cdk-constructs Show documentation
package software.amazon.textract.idp;
/**
* Calls a Comprehend Classification endpoint and parses the result, filters on > 50 % confidence and sets the highest confidence score classification.
*
* Input: "textract_result"."txt_output_location"
* Output: { "documentType": "AWS_PAYSTUBS" } (example will be at "classification"."documentType")
*
* Example (Python)
*
*
* comprehend_sync_task = tcdk.ComprehendGenericSyncSfnTask(
* self,
* "Classification",
* comprehend_classifier_arn=
* '<your comprehend classifier arn>',
* integration_pattern=sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
* lambda_log_level="DEBUG",
* timeout=Duration.hours(24),
* input=sfn.TaskInput.from_object({
* "Token":
* sfn.JsonPath.task_token,
* "ExecutionId":
* sfn.JsonPath.string_at('$$.Execution.Id'),
* "Payload":
* sfn.JsonPath.entire_payload,
* }),
* result_path="$.classification")
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.90.0 (build d6bdb4d)", date = "2023-10-26T15:43:30.303Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = software.amazon.textract.idp.$Module.class, fqn = "amazon-textract-idp-cdk-constructs.ComprehendGenericSyncSfnTask")
public class ComprehendGenericSyncSfnTask extends software.amazon.awscdk.services.stepfunctions.TaskStateBase {
protected ComprehendGenericSyncSfnTask(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected ComprehendGenericSyncSfnTask(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id Descriptive identifier for this chainable. This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public ComprehendGenericSyncSfnTask(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.textract.idp.ComprehendGenericSyncSfnTaskProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
protected @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.stepfunctions.TaskMetricsConfig getTaskMetrics() {
return software.amazon.jsii.Kernel.get(this, "taskMetrics", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.stepfunctions.TaskMetricsConfig.class));
}
/**
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
protected @org.jetbrains.annotations.Nullable java.util.List getTaskPolicies() {
return java.util.Optional.ofNullable((java.util.List)(software.amazon.jsii.Kernel.get(this, "taskPolicies", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.PolicyStatement.class))))).map(java.util.Collections::unmodifiableList).orElse(null);
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction getComprehendSyncCallFunction() {
return software.amazon.jsii.Kernel.get(this, "comprehendSyncCallFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.IFunction.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void setComprehendSyncCallFunction(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction value) {
software.amazon.jsii.Kernel.set(this, "comprehendSyncCallFunction", java.util.Objects.requireNonNull(value, "comprehendSyncCallFunction is required"));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.stepfunctions.IStateMachine getStateMachine() {
return software.amazon.jsii.Kernel.get(this, "stateMachine", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.stepfunctions.IStateMachine.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void setStateMachine(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.stepfunctions.IStateMachine value) {
software.amazon.jsii.Kernel.set(this, "stateMachine", java.util.Objects.requireNonNull(value, "stateMachine is required"));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getVersion() {
return software.amazon.jsii.Kernel.get(this, "version", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void setVersion(final @org.jetbrains.annotations.NotNull java.lang.String value) {
software.amazon.jsii.Kernel.set(this, "version", java.util.Objects.requireNonNull(value, "version is required"));
}
/**
* A fluent builder for {@link software.amazon.textract.idp.ComprehendGenericSyncSfnTask}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id Descriptive identifier for this chainable. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final software.amazon.textract.idp.ComprehendGenericSyncSfnTaskProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new software.amazon.textract.idp.ComprehendGenericSyncSfnTaskProps.Builder();
}
/**
* An optional description for this state.
*
* Default: - No comment
*
* @return {@code this}
* @param comment An optional description for this state. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder comment(final java.lang.String comment) {
this.props.comment(comment);
return this;
}
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* @return {@code this}
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing the task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder credentials(final software.amazon.awscdk.services.stepfunctions.Credentials credentials) {
this.props.credentials(credentials);
return this;
}
/**
* (deprecated) Timeout for the heartbeat.
*
* Default: - None
*
* @return {@code this}
* @deprecated use heartbeatTimeout
* @param heartbeat Timeout for the heartbeat. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder heartbeat(final software.amazon.awscdk.Duration heartbeat) {
this.props.heartbeat(heartbeat);
return this;
}
/**
* Timeout for the heartbeat.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @return {@code this}
* @param heartbeatTimeout Timeout for the heartbeat. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder heartbeatTimeout(final software.amazon.awscdk.services.stepfunctions.Timeout heartbeatTimeout) {
this.props.heartbeatTimeout(heartbeatTimeout);
return this;
}
/**
* JSONPath expression to select part of the state to be the input to this state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*
* Default: - The entire task input (JSON path '$')
*
* @return {@code this}
* @param inputPath JSONPath expression to select part of the state to be the input to this state. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder inputPath(final java.lang.String inputPath) {
this.props.inputPath(inputPath);
return this;
}
/**
* AWS Step Functions integrates with services directly in the Amazon States Language.
*
* You can control these AWS services using service integration patterns
*
* Default: - `IntegrationPattern.REQUEST_RESPONSE` for most tasks.
* `IntegrationPattern.RUN_JOB` for the following exceptions:
* `BatchSubmitJob`, `EmrAddStep`, `EmrCreateCluster`, `EmrTerminationCluster`, and `EmrContainersStartJobRun`.
*
* @return {@code this}
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token
* @param integrationPattern AWS Step Functions integrates with services directly in the Amazon States Language. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder integrationPattern(final software.amazon.awscdk.services.stepfunctions.IntegrationPattern integrationPattern) {
this.props.integrationPattern(integrationPattern);
return this;
}
/**
* JSONPath expression to select select a portion of the state output to pass to the next state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*
* Default: - The entire JSON node determined by the state input, the task result,
* and resultPath is passed to the next state (JSON path '$')
*
* @return {@code this}
* @param outputPath JSONPath expression to select select a portion of the state output to pass to the next state. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder outputPath(final java.lang.String outputPath) {
this.props.outputPath(outputPath);
return this;
}
/**
* JSONPath expression to indicate where to inject the state's output.
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* Default: - Replaces the entire input with the result (JSON path '$')
*
* @return {@code this}
* @param resultPath JSONPath expression to indicate where to inject the state's output. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder resultPath(final java.lang.String resultPath) {
this.props.resultPath(resultPath);
return this;
}
/**
* The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* Default: - None
*
* @return {@code this}
* @see https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector
* @param resultSelector The JSON that will replace the state's raw result and become the effective result before ResultPath is applied. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder resultSelector(final java.util.Map resultSelector) {
this.props.resultSelector(resultSelector);
return this;
}
/**
* Timeout for the task.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @return {@code this}
* @param taskTimeout Timeout for the task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder taskTimeout(final software.amazon.awscdk.services.stepfunctions.Timeout taskTimeout) {
this.props.taskTimeout(taskTimeout);
return this;
}
/**
* (deprecated) Timeout for the task.
*
* Default: - None
*
* @return {@code this}
* @deprecated use taskTimeout
* @param timeout Timeout for the task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder timeout(final software.amazon.awscdk.Duration timeout) {
this.props.timeout(timeout);
return this;
}
/**
* @return {@code this}
* @param comprehendClassifierArn This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder comprehendClassifierArn(final java.lang.String comprehendClassifierArn) {
this.props.comprehendClassifierArn(comprehendClassifierArn);
return this;
}
/**
* Pass the execution ID from the context object to the execution input.
*
* This allows the Step Functions UI to link child executions from parent executions, making it easier to trace execution flow across state machines.
*
* If you set this property to true
, the input
property must be an object (provided by sfn.TaskInput.fromObject
) or omitted entirely.
*
* Default: - false
*
* @return {@code this}
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-nested-workflows.html#nested-execution-startid
* @param associateWithParent Pass the execution ID from the context object to the execution input. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder associateWithParent(final java.lang.Boolean associateWithParent) {
this.props.associateWithParent(associateWithParent);
return this;
}
/**
* default is 1.1.
*
* @return {@code this}
* @param comprehendAsyncCallBackoffRate default is 1.1. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder comprehendAsyncCallBackoffRate(final java.lang.Number comprehendAsyncCallBackoffRate) {
this.props.comprehendAsyncCallBackoffRate(comprehendAsyncCallBackoffRate);
return this;
}
/**
* default is 1.
*
* @return {@code this}
* @param comprehendAsyncCallInterval default is 1. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder comprehendAsyncCallInterval(final java.lang.Number comprehendAsyncCallInterval) {
this.props.comprehendAsyncCallInterval(comprehendAsyncCallInterval);
return this;
}
/**
* @return {@code this}
* @param comprehendAsyncCallMaxRetries This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder comprehendAsyncCallMaxRetries(final java.lang.Number comprehendAsyncCallMaxRetries) {
this.props.comprehendAsyncCallMaxRetries(comprehendAsyncCallMaxRetries);
return this;
}
/**
* The JSON input for the execution, same as that of StartExecution.
*
* Default: - The state input (JSON path '$')
*
* @return {@code this}
* @see https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html
* @param input The JSON input for the execution, same as that of StartExecution. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder input(final software.amazon.awscdk.services.stepfunctions.TaskInput input) {
this.props.input(input);
return this;
}
/**
* List of PolicyStatements to attach to the Lambda function.
*
* @return {@code this}
* @param inputPolicyStatements List of PolicyStatements to attach to the Lambda function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder inputPolicyStatements(final java.util.List extends software.amazon.awscdk.services.iam.PolicyStatement> inputPolicyStatements) {
this.props.inputPolicyStatements(inputPolicyStatements);
return this;
}
/**
* @return {@code this}
* @param lambdaLogLevel This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaLogLevel(final java.lang.String lambdaLogLevel) {
this.props.lambdaLogLevel(lambdaLogLevel);
return this;
}
/**
* Memory allocated to Lambda function, default 512.
*
* @return {@code this}
* @param lambdaMemory Memory allocated to Lambda function, default 512. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaMemory(final java.lang.Number lambdaMemory) {
this.props.lambdaMemory(lambdaMemory);
return this;
}
/**
* Lambda Function Timeout in seconds, default 300.
*
* @return {@code this}
* @param lambdaTimeout Lambda Function Timeout in seconds, default 300. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaTimeout(final java.lang.Number lambdaTimeout) {
this.props.lambdaTimeout(lambdaTimeout);
return this;
}
/**
* The name of the execution, same as that of StartExecution.
*
* Default: - None
*
* @return {@code this}
* @see https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html
* @param name The name of the execution, same as that of StartExecution. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder name(final java.lang.String name) {
this.props.name(name);
return this;
}
/**
* List of PolicyStatements to attach to the Lambda function.
*
* @return {@code this}
* @param outputPolicyStatements List of PolicyStatements to attach to the Lambda function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder outputPolicyStatements(final java.util.List extends software.amazon.awscdk.services.iam.PolicyStatement> outputPolicyStatements) {
this.props.outputPolicyStatements(outputPolicyStatements);
return this;
}
/**
* location of input S3 objects - if left empty will generate rule for s3 access to all [*].
*
* @return {@code this}
* @param s3InputBucket location of input S3 objects - if left empty will generate rule for s3 access to all [*]. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder s3InputBucket(final java.lang.String s3InputBucket) {
this.props.s3InputBucket(s3InputBucket);
return this;
}
/**
* prefix for input S3 objects - if left empty will generate rule for s3 access to all in bucket.
*
* @return {@code this}
* @param s3InputPrefix prefix for input S3 objects - if left empty will generate rule for s3 access to all in bucket. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder s3InputPrefix(final java.lang.String s3InputPrefix) {
this.props.s3InputPrefix(s3InputPrefix);
return this;
}
/**
* Bucketname to output data to.
*
* @return {@code this}
* @param s3OutputBucket Bucketname to output data to. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder s3OutputBucket(final java.lang.String s3OutputBucket) {
this.props.s3OutputBucket(s3OutputBucket);
return this;
}
/**
* The prefix to use for the temporary output files (e.
*
* g. output from async process before stiching together)
*
* @return {@code this}
* @param s3OutputPrefix The prefix to use for the temporary output files (e. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder s3OutputPrefix(final java.lang.String s3OutputPrefix) {
this.props.s3OutputPrefix(s3OutputPrefix);
return this;
}
/**
* how long can we wait for the process (default is 60 minutes).
*
* @return {@code this}
* @param textractStateMachineTimeoutMinutes how long can we wait for the process (default is 60 minutes). This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractStateMachineTimeoutMinutes(final java.lang.Number textractStateMachineTimeoutMinutes) {
this.props.textractStateMachineTimeoutMinutes(textractStateMachineTimeoutMinutes);
return this;
}
/**
* @return {@code this}
* @param workflowTracingEnabled This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder workflowTracingEnabled(final java.lang.Boolean workflowTracingEnabled) {
this.props.workflowTracingEnabled(workflowTracingEnabled);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.textract.idp.ComprehendGenericSyncSfnTask}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public software.amazon.textract.idp.ComprehendGenericSyncSfnTask build() {
return new software.amazon.textract.idp.ComprehendGenericSyncSfnTask(
this.scope,
this.id,
this.props.build()
);
}
}
}