software.amazon.textract.idp.TextractAsyncToJSONProps Maven / Gradle / Ivy
Show all versions of idp-cdk-constructs Show documentation
package software.amazon.textract.idp;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.90.0 (build d6bdb4d)", date = "2023-10-26T15:43:30.339Z")
@software.amazon.jsii.Jsii(module = software.amazon.textract.idp.$Module.class, fqn = "amazon-textract-idp-cdk-constructs.TextractAsyncToJSONProps")
@software.amazon.jsii.Jsii.Proxy(TextractAsyncToJSONProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface TextractAsyncToJSONProps extends software.amazon.jsii.JsiiSerializable {
/**
* Bucketname to output data to.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getS3OutputBucket();
/**
* The prefix to use for the output files.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getS3OutputPrefix();
/**
* List of PolicyStatements to attach to the Lambda function.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getInputPolicyStatements() {
return null;
}
/**
* log level for Lambda function, supports DEBUG|INFO|WARNING|ERROR|FATAL.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getLambdaLogLevel() {
return null;
}
/**
* memory of Lambda function (may need to increase for larger documents), set to 10240 (max) atm, decrease for smaller workloads.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getLambdaMemoryMB() {
return null;
}
/**
* memory of Lambda function (may need to increase for larger documents).
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getLambdaTimeout() {
return null;
}
/**
* List of PolicyStatements to attach to the Lambda function.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getOutputPolicyStatements() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getS3InputBucket() {
return null;
}
/**
* prefix for input S3 objects - if left empty will generate rule for s3 access to all in bucket.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getS3InputPrefix() {
return null;
}
/**
* Which Textract API was used to create the OutputConfig?
*
* GENERIC and LENDING are supported.
*
* Default: - GENERIC
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getTextractAPI() {
return null;
}
/**
* retyr backoff rate.
*
* Default: is 1.1
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getTextractAsyncToJSONBackoffRate() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getTextractAsyncToJSONInterval() {
return null;
}
/**
* number of retries in Step Function flow.
*
* Default: is 100
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getTextractAsyncToJSONMaxRetries() {
return null;
}
/**
* @return a {@link Builder} of {@link TextractAsyncToJSONProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link TextractAsyncToJSONProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String s3OutputBucket;
java.lang.String s3OutputPrefix;
java.util.List inputPolicyStatements;
java.lang.String lambdaLogLevel;
java.lang.Number lambdaMemoryMb;
java.lang.Number lambdaTimeout;
java.util.List outputPolicyStatements;
java.lang.String s3InputBucket;
java.lang.String s3InputPrefix;
java.lang.String textractApi;
java.lang.Number textractAsyncToJsonBackoffRate;
java.lang.Number textractAsyncToJsonInterval;
java.lang.Number textractAsyncToJsonMaxRetries;
/**
* Sets the value of {@link TextractAsyncToJSONProps#getS3OutputBucket}
* @param s3OutputBucket Bucketname to output data to. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder s3OutputBucket(java.lang.String s3OutputBucket) {
this.s3OutputBucket = s3OutputBucket;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getS3OutputPrefix}
* @param s3OutputPrefix The prefix to use for the output files. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder s3OutputPrefix(java.lang.String s3OutputPrefix) {
this.s3OutputPrefix = s3OutputPrefix;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getInputPolicyStatements}
* @param inputPolicyStatements List of PolicyStatements to attach to the Lambda function.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder inputPolicyStatements(java.util.List extends software.amazon.awscdk.services.iam.PolicyStatement> inputPolicyStatements) {
this.inputPolicyStatements = (java.util.List)inputPolicyStatements;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getLambdaLogLevel}
* @param lambdaLogLevel log level for Lambda function, supports DEBUG|INFO|WARNING|ERROR|FATAL.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaLogLevel(java.lang.String lambdaLogLevel) {
this.lambdaLogLevel = lambdaLogLevel;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getLambdaMemoryMb}
* @param lambdaMemoryMb memory of Lambda function (may need to increase for larger documents), set to 10240 (max) atm, decrease for smaller workloads.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaMemoryMb(java.lang.Number lambdaMemoryMb) {
this.lambdaMemoryMb = lambdaMemoryMb;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getLambdaTimeout}
* @param lambdaTimeout memory of Lambda function (may need to increase for larger documents).
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaTimeout(java.lang.Number lambdaTimeout) {
this.lambdaTimeout = lambdaTimeout;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getOutputPolicyStatements}
* @param outputPolicyStatements List of PolicyStatements to attach to the Lambda function.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder outputPolicyStatements(java.util.List extends software.amazon.awscdk.services.iam.PolicyStatement> outputPolicyStatements) {
this.outputPolicyStatements = (java.util.List)outputPolicyStatements;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getS3InputBucket}
* @param s3InputBucket the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder s3InputBucket(java.lang.String s3InputBucket) {
this.s3InputBucket = s3InputBucket;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getS3InputPrefix}
* @param s3InputPrefix prefix for input S3 objects - if left empty will generate rule for s3 access to all in bucket.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder s3InputPrefix(java.lang.String s3InputPrefix) {
this.s3InputPrefix = s3InputPrefix;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getTextractApi}
* @param textractApi Which Textract API was used to create the OutputConfig?.
* GENERIC and LENDING are supported.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractApi(java.lang.String textractApi) {
this.textractApi = textractApi;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getTextractAsyncToJsonBackoffRate}
* @param textractAsyncToJsonBackoffRate retyr backoff rate.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractAsyncToJsonBackoffRate(java.lang.Number textractAsyncToJsonBackoffRate) {
this.textractAsyncToJsonBackoffRate = textractAsyncToJsonBackoffRate;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getTextractAsyncToJsonInterval}
* @param textractAsyncToJsonInterval the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractAsyncToJsonInterval(java.lang.Number textractAsyncToJsonInterval) {
this.textractAsyncToJsonInterval = textractAsyncToJsonInterval;
return this;
}
/**
* Sets the value of {@link TextractAsyncToJSONProps#getTextractAsyncToJsonMaxRetries}
* @param textractAsyncToJsonMaxRetries number of retries in Step Function flow.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder textractAsyncToJsonMaxRetries(java.lang.Number textractAsyncToJsonMaxRetries) {
this.textractAsyncToJsonMaxRetries = textractAsyncToJsonMaxRetries;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link TextractAsyncToJSONProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public TextractAsyncToJSONProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link TextractAsyncToJSONProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements TextractAsyncToJSONProps {
private final java.lang.String s3OutputBucket;
private final java.lang.String s3OutputPrefix;
private final java.util.List inputPolicyStatements;
private final java.lang.String lambdaLogLevel;
private final java.lang.Number lambdaMemoryMb;
private final java.lang.Number lambdaTimeout;
private final java.util.List outputPolicyStatements;
private final java.lang.String s3InputBucket;
private final java.lang.String s3InputPrefix;
private final java.lang.String textractApi;
private final java.lang.Number textractAsyncToJsonBackoffRate;
private final java.lang.Number textractAsyncToJsonInterval;
private final java.lang.Number textractAsyncToJsonMaxRetries;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.s3OutputBucket = software.amazon.jsii.Kernel.get(this, "s3OutputBucket", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.s3OutputPrefix = software.amazon.jsii.Kernel.get(this, "s3OutputPrefix", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.inputPolicyStatements = software.amazon.jsii.Kernel.get(this, "inputPolicyStatements", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.PolicyStatement.class)));
this.lambdaLogLevel = software.amazon.jsii.Kernel.get(this, "lambdaLogLevel", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.lambdaMemoryMb = software.amazon.jsii.Kernel.get(this, "lambdaMemoryMB", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.lambdaTimeout = software.amazon.jsii.Kernel.get(this, "lambdaTimeout", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.outputPolicyStatements = software.amazon.jsii.Kernel.get(this, "outputPolicyStatements", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.PolicyStatement.class)));
this.s3InputBucket = software.amazon.jsii.Kernel.get(this, "s3InputBucket", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.s3InputPrefix = software.amazon.jsii.Kernel.get(this, "s3InputPrefix", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.textractApi = software.amazon.jsii.Kernel.get(this, "textractAPI", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.textractAsyncToJsonBackoffRate = software.amazon.jsii.Kernel.get(this, "textractAsyncToJSONBackoffRate", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.textractAsyncToJsonInterval = software.amazon.jsii.Kernel.get(this, "textractAsyncToJSONInterval", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.textractAsyncToJsonMaxRetries = software.amazon.jsii.Kernel.get(this, "textractAsyncToJSONMaxRetries", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.s3OutputBucket = java.util.Objects.requireNonNull(builder.s3OutputBucket, "s3OutputBucket is required");
this.s3OutputPrefix = java.util.Objects.requireNonNull(builder.s3OutputPrefix, "s3OutputPrefix is required");
this.inputPolicyStatements = (java.util.List)builder.inputPolicyStatements;
this.lambdaLogLevel = builder.lambdaLogLevel;
this.lambdaMemoryMb = builder.lambdaMemoryMb;
this.lambdaTimeout = builder.lambdaTimeout;
this.outputPolicyStatements = (java.util.List)builder.outputPolicyStatements;
this.s3InputBucket = builder.s3InputBucket;
this.s3InputPrefix = builder.s3InputPrefix;
this.textractApi = builder.textractApi;
this.textractAsyncToJsonBackoffRate = builder.textractAsyncToJsonBackoffRate;
this.textractAsyncToJsonInterval = builder.textractAsyncToJsonInterval;
this.textractAsyncToJsonMaxRetries = builder.textractAsyncToJsonMaxRetries;
}
@Override
public final java.lang.String getS3OutputBucket() {
return this.s3OutputBucket;
}
@Override
public final java.lang.String getS3OutputPrefix() {
return this.s3OutputPrefix;
}
@Override
public final java.util.List getInputPolicyStatements() {
return this.inputPolicyStatements;
}
@Override
public final java.lang.String getLambdaLogLevel() {
return this.lambdaLogLevel;
}
@Override
public final java.lang.Number getLambdaMemoryMB() {
return this.lambdaMemoryMb;
}
@Override
public final java.lang.Number getLambdaTimeout() {
return this.lambdaTimeout;
}
@Override
public final java.util.List getOutputPolicyStatements() {
return this.outputPolicyStatements;
}
@Override
public final java.lang.String getS3InputBucket() {
return this.s3InputBucket;
}
@Override
public final java.lang.String getS3InputPrefix() {
return this.s3InputPrefix;
}
@Override
public final java.lang.String getTextractAPI() {
return this.textractApi;
}
@Override
public final java.lang.Number getTextractAsyncToJSONBackoffRate() {
return this.textractAsyncToJsonBackoffRate;
}
@Override
public final java.lang.Number getTextractAsyncToJSONInterval() {
return this.textractAsyncToJsonInterval;
}
@Override
public final java.lang.Number getTextractAsyncToJSONMaxRetries() {
return this.textractAsyncToJsonMaxRetries;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("s3OutputBucket", om.valueToTree(this.getS3OutputBucket()));
data.set("s3OutputPrefix", om.valueToTree(this.getS3OutputPrefix()));
if (this.getInputPolicyStatements() != null) {
data.set("inputPolicyStatements", om.valueToTree(this.getInputPolicyStatements()));
}
if (this.getLambdaLogLevel() != null) {
data.set("lambdaLogLevel", om.valueToTree(this.getLambdaLogLevel()));
}
if (this.getLambdaMemoryMB() != null) {
data.set("lambdaMemoryMB", om.valueToTree(this.getLambdaMemoryMB()));
}
if (this.getLambdaTimeout() != null) {
data.set("lambdaTimeout", om.valueToTree(this.getLambdaTimeout()));
}
if (this.getOutputPolicyStatements() != null) {
data.set("outputPolicyStatements", om.valueToTree(this.getOutputPolicyStatements()));
}
if (this.getS3InputBucket() != null) {
data.set("s3InputBucket", om.valueToTree(this.getS3InputBucket()));
}
if (this.getS3InputPrefix() != null) {
data.set("s3InputPrefix", om.valueToTree(this.getS3InputPrefix()));
}
if (this.getTextractAPI() != null) {
data.set("textractAPI", om.valueToTree(this.getTextractAPI()));
}
if (this.getTextractAsyncToJSONBackoffRate() != null) {
data.set("textractAsyncToJSONBackoffRate", om.valueToTree(this.getTextractAsyncToJSONBackoffRate()));
}
if (this.getTextractAsyncToJSONInterval() != null) {
data.set("textractAsyncToJSONInterval", om.valueToTree(this.getTextractAsyncToJSONInterval()));
}
if (this.getTextractAsyncToJSONMaxRetries() != null) {
data.set("textractAsyncToJSONMaxRetries", om.valueToTree(this.getTextractAsyncToJSONMaxRetries()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("amazon-textract-idp-cdk-constructs.TextractAsyncToJSONProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TextractAsyncToJSONProps.Jsii$Proxy that = (TextractAsyncToJSONProps.Jsii$Proxy) o;
if (!s3OutputBucket.equals(that.s3OutputBucket)) return false;
if (!s3OutputPrefix.equals(that.s3OutputPrefix)) return false;
if (this.inputPolicyStatements != null ? !this.inputPolicyStatements.equals(that.inputPolicyStatements) : that.inputPolicyStatements != null) return false;
if (this.lambdaLogLevel != null ? !this.lambdaLogLevel.equals(that.lambdaLogLevel) : that.lambdaLogLevel != null) return false;
if (this.lambdaMemoryMb != null ? !this.lambdaMemoryMb.equals(that.lambdaMemoryMb) : that.lambdaMemoryMb != null) return false;
if (this.lambdaTimeout != null ? !this.lambdaTimeout.equals(that.lambdaTimeout) : that.lambdaTimeout != null) return false;
if (this.outputPolicyStatements != null ? !this.outputPolicyStatements.equals(that.outputPolicyStatements) : that.outputPolicyStatements != null) return false;
if (this.s3InputBucket != null ? !this.s3InputBucket.equals(that.s3InputBucket) : that.s3InputBucket != null) return false;
if (this.s3InputPrefix != null ? !this.s3InputPrefix.equals(that.s3InputPrefix) : that.s3InputPrefix != null) return false;
if (this.textractApi != null ? !this.textractApi.equals(that.textractApi) : that.textractApi != null) return false;
if (this.textractAsyncToJsonBackoffRate != null ? !this.textractAsyncToJsonBackoffRate.equals(that.textractAsyncToJsonBackoffRate) : that.textractAsyncToJsonBackoffRate != null) return false;
if (this.textractAsyncToJsonInterval != null ? !this.textractAsyncToJsonInterval.equals(that.textractAsyncToJsonInterval) : that.textractAsyncToJsonInterval != null) return false;
return this.textractAsyncToJsonMaxRetries != null ? this.textractAsyncToJsonMaxRetries.equals(that.textractAsyncToJsonMaxRetries) : that.textractAsyncToJsonMaxRetries == null;
}
@Override
public final int hashCode() {
int result = this.s3OutputBucket.hashCode();
result = 31 * result + (this.s3OutputPrefix.hashCode());
result = 31 * result + (this.inputPolicyStatements != null ? this.inputPolicyStatements.hashCode() : 0);
result = 31 * result + (this.lambdaLogLevel != null ? this.lambdaLogLevel.hashCode() : 0);
result = 31 * result + (this.lambdaMemoryMb != null ? this.lambdaMemoryMb.hashCode() : 0);
result = 31 * result + (this.lambdaTimeout != null ? this.lambdaTimeout.hashCode() : 0);
result = 31 * result + (this.outputPolicyStatements != null ? this.outputPolicyStatements.hashCode() : 0);
result = 31 * result + (this.s3InputBucket != null ? this.s3InputBucket.hashCode() : 0);
result = 31 * result + (this.s3InputPrefix != null ? this.s3InputPrefix.hashCode() : 0);
result = 31 * result + (this.textractApi != null ? this.textractApi.hashCode() : 0);
result = 31 * result + (this.textractAsyncToJsonBackoffRate != null ? this.textractAsyncToJsonBackoffRate.hashCode() : 0);
result = 31 * result + (this.textractAsyncToJsonInterval != null ? this.textractAsyncToJsonInterval.hashCode() : 0);
result = 31 * result + (this.textractAsyncToJsonMaxRetries != null ? this.textractAsyncToJsonMaxRetries.hashCode() : 0);
return result;
}
}
}