software.amazon.textract.idp.TextractClassificationConfigurator Maven / Gradle / Ivy
Show all versions of idp-cdk-constructs Show documentation
package software.amazon.textract.idp;
/**
* Looks for a matching DOCYMENT_TYPE in the configurationTableName and sets the CONFIG value (when found) to the context, so subsequent calls to Textract use those values.
*
* This is an entry from the default config
* AWS_PAYSTUBS,"{""queriesConfig"": [{""alias"": ""PAYSTUB_PERIOD_START_DATE"", ""text"": ""What is the Pay Period Start Date?""}, {""alias"": ""PAYSTUB_PERIOD_END_DATE"", ""text"": ""What is the Pay Period End Date?""}, {""alias"": ""PAYSTUB_PERIOD_PAY_DATE"", ""text"": ""What is the Pay Date?""}, {""alias"": ""PAYSTUB_PERIOD_EMPLOYEE_NAME"", ""text"": ""What is the Employee Name?""}, {""alias"": ""PAYSTUB_PERIOD_COMPANY_NAME"", ""text"": ""What is the company Name?""}, {""alias"": ""PAYSTUB_PERIOD_CURRENT_GROSS_PAY"", ""text"": ""What is the Current Gross Pay?""}, {""alias"": ""PAYSTUB_PERIOD_YTD_GROSS_PAY"", ""text"": ""What is the YTD Gross Pay?""}, {""alias"": ""PAYSTUB_PERIOD_REGULAR_HOURLY_RATE"", ""text"": ""What is the regular hourly rate?""}, {""alias"": ""PAYSTUB_PERIOD_HOLIDAY_RATE"", ""text"": ""What is the holiday rate?""}], ""textractFeatures"": [""QUERIES""]}"
*
* So, if the "classification"."documentType" in the Step Function Input is AWS_PAYSTUBS
* then it will set the queriesConfig in the manifest for the subsequent Textract Calls in the Step Function flow
*
* Input: "classification"."documentType"
* Output: config set to manifest
*
* Example (Python)
*
*
* configurator_task = tcdk.TextractClassificationConfigurator(
* self, f"{workflow_name}-Configurator",
* )
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.90.0 (build d6bdb4d)", date = "2023-10-26T15:43:30.342Z")
@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.TextractClassificationConfigurator")
public class TextractClassificationConfigurator extends software.amazon.awscdk.services.stepfunctions.StateMachineFragment {
protected TextractClassificationConfigurator(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected TextractClassificationConfigurator(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 TextractClassificationConfigurator(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.TextractClassificationConfiguratorProps 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") });
}
/**
* 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));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.dynamodb.ITable getConfigurationTable() {
return software.amazon.jsii.Kernel.get(this, "configurationTable", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.dynamodb.ITable.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void setConfigurationTable(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.dynamodb.ITable value) {
software.amazon.jsii.Kernel.set(this, "configurationTable", java.util.Objects.requireNonNull(value, "configurationTable is required"));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getConfigurationTableName() {
return software.amazon.jsii.Kernel.get(this, "configurationTableName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void setConfigurationTableName(final @org.jetbrains.annotations.NotNull java.lang.String value) {
software.amazon.jsii.Kernel.set(this, "configurationTableName", java.util.Objects.requireNonNull(value, "configurationTableName is required"));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction getConfiguratorFunction() {
return software.amazon.jsii.Kernel.get(this, "configuratorFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.IFunction.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void setConfiguratorFunction(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction value) {
software.amazon.jsii.Kernel.set(this, "configuratorFunction", java.util.Objects.requireNonNull(value, "configuratorFunction is required"));
}
/**
* A fluent builder for {@link software.amazon.textract.idp.TextractClassificationConfigurator}.
*/
@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.TextractClassificationConfiguratorProps.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.TextractClassificationConfiguratorProps.Builder();
}
/**
* @return {@code this}
* @param configurationTable This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder configurationTable(final software.amazon.awscdk.services.dynamodb.ITable configurationTable) {
this.props.configurationTable(configurationTable);
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 of Lambda function (may need to increase for larger documents).
*
* @return {@code this}
* @param lambdaMemoryMb 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 lambdaMemoryMb(final java.lang.Number lambdaMemoryMb) {
this.props.lambdaMemoryMb(lambdaMemoryMb);
return this;
}
/**
* @return {@code this}
* @param lambdaTimeout 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;
}
/**
* @return a newly built instance of {@link software.amazon.textract.idp.TextractClassificationConfigurator}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public software.amazon.textract.idp.TextractClassificationConfigurator build() {
return new software.amazon.textract.idp.TextractClassificationConfigurator(
this.parent,
this.id,
this.props.build()
);
}
}
}