software.amazon.textract.idp.TextractAsyncToJSON Maven / Gradle / Ivy
Show all versions of idp-cdk-constructs Show documentation
package software.amazon.textract.idp;
/**
* combines the potentially paginated response from async Textract calls and stores as one combines JSON.
*
* This construct is not memory optimzed (yet) and will combine all JSON by loading them to memory.
* Large responses could exceed the memory potentially, the memory size is set to Lambda max.
*
* Reduce the memory size to your needs if your processing does not yield large responses to save Lamda cost.
*
* Input: "textract_result"."TextractTempOutputJsonPath"
* Output: "TextractOutputJsonPath"
*
* Example (Python)
*
*
* textract_async_to_json = tcdk.TextractAsyncToJSON(
* self,
* "TextractAsyncToJSON2",
* s3_output_prefix=s3_output_prefix,
* s3_output_bucket=s3_output_bucket)
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.90.0 (build d6bdb4d)", date = "2023-10-26T15:43:30.337Z")
@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.TextractAsyncToJSON")
public class TextractAsyncToJSON extends software.amazon.awscdk.services.stepfunctions.StateMachineFragment {
protected TextractAsyncToJSON(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected TextractAsyncToJSON(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param parent 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 TextractAsyncToJSON(final @org.jetbrains.annotations.NotNull software.constructs.Construct parent, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.textract.idp.TextractAsyncToJSONProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(parent, "parent is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction getAsyncToJSONFunction() {
return software.amazon.jsii.Kernel.get(this, "asyncToJSONFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.IFunction.class));
}
/**
* The states to chain onto if this fragment is used.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.util.List getEndStates() {
return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.get(this, "endStates", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.stepfunctions.INextable.class))));
}
/**
* The start state of this state machine fragment.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.stepfunctions.State getStartState() {
return software.amazon.jsii.Kernel.get(this, "startState", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.stepfunctions.State.class));
}
/**
* A fluent builder for {@link software.amazon.textract.idp.TextractAsyncToJSON}.
*/
@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 parent 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 parent, final java.lang.String id) {
return new Builder(parent, id);
}
private final software.constructs.Construct parent;
private final java.lang.String id;
private final software.amazon.textract.idp.TextractAsyncToJSONProps.Builder props;
private Builder(final software.constructs.Construct parent, final java.lang.String id) {
this.parent = parent;
this.id = id;
this.props = new software.amazon.textract.idp.TextractAsyncToJSONProps.Builder();
}
/**
* 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 output files.
*
* @return {@code this}
* @param s3OutputPrefix The prefix to use for the output files. 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;
}
/**
* 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;
}
/**
* log level for Lambda function, supports DEBUG|INFO|WARNING|ERROR|FATAL.
*
* @return {@code this}
* @param lambdaLogLevel log level for Lambda function, supports DEBUG|INFO|WARNING|ERROR|FATAL. 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 of Lambda function (may need to increase for larger documents), set to 10240 (max) atm, decrease for smaller workloads.
*
* @return {@code this}
* @param lambdaMemoryMb memory of Lambda function (may need to increase for larger documents), set to 10240 (max) atm, decrease for smaller workloads. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaMemoryMb(final java.lang.Number lambdaMemoryMb) {
this.props.lambdaMemoryMb(lambdaMemoryMb);
return this;
}
/**
* memory of Lambda function (may need to increase for larger documents).
*
* @return {@code this}
* @param lambdaTimeout memory of Lambda function (may need to increase for larger documents). 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;
}
/**
* 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;
}
/**
* @return {@code this}
* @param s3InputBucket 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;
}
/**
* Which Textract API was used to create the OutputConfig?
*
* GENERIC and LENDING are supported.
*
* Default: - GENERIC
*
* @return {@code this}
* @param textractApi Which Textract API was used to create the OutputConfig?. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractApi(final java.lang.String textractApi) {
this.props.textractApi(textractApi);
return this;
}
/**
* retyr backoff rate.
*
* Default: is 1.1
*
* @return {@code this}
* @param textractAsyncToJsonBackoffRate retyr backoff rate. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractAsyncToJsonBackoffRate(final java.lang.Number textractAsyncToJsonBackoffRate) {
this.props.textractAsyncToJsonBackoffRate(textractAsyncToJsonBackoffRate);
return this;
}
/**
* @return {@code this}
* @param textractAsyncToJsonInterval This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractAsyncToJsonInterval(final java.lang.Number textractAsyncToJsonInterval) {
this.props.textractAsyncToJsonInterval(textractAsyncToJsonInterval);
return this;
}
/**
* number of retries in Step Function flow.
*
* Default: is 100
*
* @return {@code this}
* @param textractAsyncToJsonMaxRetries number of retries in Step Function flow. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractAsyncToJsonMaxRetries(final java.lang.Number textractAsyncToJsonMaxRetries) {
this.props.textractAsyncToJsonMaxRetries(textractAsyncToJsonMaxRetries);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.textract.idp.TextractAsyncToJSON}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public software.amazon.textract.idp.TextractAsyncToJSON build() {
return new software.amazon.textract.idp.TextractAsyncToJSON(
this.parent,
this.id,
this.props.build()
);
}
}
}