Class RedactionLambdaProps.Builder
- java.lang.Object
-
- io.github.hsiehshujeng.cdk.comprehend.s3olap.RedactionLambdaProps.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<RedactionLambdaProps>
- Enclosing interface:
- RedactionLambdaProps
@Stability(Stable) public static final class RedactionLambdaProps.Builder extends Object implements software.amazon.jsii.Builder<RedactionLambdaProps>
A builder forRedactionLambdaProps
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
confidenceThreshold
@Stability(Stable) public RedactionLambdaProps.Builder confidenceThreshold(String confidenceThreshold)
Sets the value ofRedactionLambdaProps.getConfidenceThreshold()- Parameters:
confidenceThreshold- The minimum prediction confidence score above which PII classification and detection would be considered as final answer. Valid range (0.5 to 1.0).- Returns:
this
-
containsPiiEntitiesThreadCount
@Stability(Stable) public RedactionLambdaProps.Builder containsPiiEntitiesThreadCount(String containsPiiEntitiesThreadCount)
Sets the value ofRedactionLambdaProps.getContainsPiiEntitiesThreadCount()- Parameters:
containsPiiEntitiesThreadCount- Number of threads to use for calling Comprehend's ContainsPiiEntities API. This controls the number of simultaneous calls that will be made from this Lambda.- Returns:
this
-
defaultLanguageCode
@Stability(Stable) public RedactionLambdaProps.Builder defaultLanguageCode(String defaultLanguageCode)
Sets the value ofRedactionLambdaProps.getDefaultLanguageCode()- Parameters:
defaultLanguageCode- Default language of the text to be processed. This code will be used for interacting with Comprehend.- Returns:
this
-
detectPiiEntitiesThreadCount
@Stability(Stable) public RedactionLambdaProps.Builder detectPiiEntitiesThreadCount(String detectPiiEntitiesThreadCount)
Sets the value ofRedactionLambdaProps.getDetectPiiEntitiesThreadCount()- Parameters:
detectPiiEntitiesThreadCount- Number of threads to use for calling Comprehend's DetectPiiEntities API. This controls the number of simultaneous calls that will be made from this Lambda.- Returns:
this
-
documentMaxSize
@Stability(Stable) public RedactionLambdaProps.Builder documentMaxSize(String documentMaxSize)
Sets the value ofRedactionLambdaProps.getDocumentMaxSize()- Parameters:
documentMaxSize- Default maximum document size (in bytes) that this function can process otherwise will throw exception for too large document size.- Returns:
this
-
documentMaxSizeContainsPiiEntities
@Stability(Stable) public RedactionLambdaProps.Builder documentMaxSizeContainsPiiEntities(String documentMaxSizeContainsPiiEntities)
Sets the value ofRedactionLambdaProps.getDocumentMaxSizeContainsPiiEntities()- Parameters:
documentMaxSizeContainsPiiEntities- Maximum document size (in bytes) to be used for making calls to Comprehend's ContainsPiiEntities API.- Returns:
this
-
documentMaxSizeDetectPiiEntities
@Stability(Stable) public RedactionLambdaProps.Builder documentMaxSizeDetectPiiEntities(String documentMaxSizeDetectPiiEntities)
Sets the value ofRedactionLambdaProps.getDocumentMaxSizeDetectPiiEntities()- Parameters:
documentMaxSizeDetectPiiEntities- Maximum document size (in bytes) to be used for making calls to Comprehend's DetectPiiEntities API.- Returns:
this
-
isPartialObjectSupported
@Stability(Stable) public RedactionLambdaProps.Builder isPartialObjectSupported(String isPartialObjectSupported)
Sets the value ofRedactionLambdaProps.getIsPartialObjectSupported()- Parameters:
isPartialObjectSupported- Whether to support partial objects or not. Accessing partial object through http headers such byte-range can corrupt the object and/or affect PII detection accuracy.- Returns:
this
-
logLevel
@Stability(Stable) public RedactionLambdaProps.Builder logLevel(String logLevel)
Sets the value ofRedactionLambdaProps.getLogLevel()- Parameters:
logLevel- Log level for Lambda function logging, e.g., ERROR, INFO, DEBUG, etc.- Returns:
this
-
maskCharacter
@Stability(Stable) public RedactionLambdaProps.Builder maskCharacter(String maskCharacter)
Sets the value ofRedactionLambdaProps.getMaskCharacter()- Parameters:
maskCharacter- A character that replaces each character in the redacted PII entity.- Returns:
this
-
maskMode
@Stability(Stable) public RedactionLambdaProps.Builder maskMode(String maskMode)
Sets the value ofRedactionLambdaProps.getMaskMode()- Parameters:
maskMode- Specifies whether the PII entity is redacted with the mask character or the entity type. Valid values - REPLACE_WITH_PII_ENTITY_TYPE and MASK.- Returns:
this
-
maxCharsOverlap
@Stability(Stable) public RedactionLambdaProps.Builder maxCharsOverlap(String maxCharsOverlap)
Sets the value ofRedactionLambdaProps.getMaxCharsOverlap()- Parameters:
maxCharsOverlap- Maximum characters to overlap among segments of a document in case chunking is needed because of maximum document size limit.- Returns:
this
-
piiEntityTypes
@Stability(Stable) public RedactionLambdaProps.Builder piiEntityTypes(String piiEntityTypes)
Sets the value ofRedactionLambdaProps.getPiiEntityTypes()- Parameters:
piiEntityTypes- List of comma separated PII entity types to be considered for redaction. Refer Comprehend's documentation page for list of supported PII entity types.- Returns:
this
-
publishCloudWatchMetrics
@Stability(Stable) public RedactionLambdaProps.Builder publishCloudWatchMetrics(String publishCloudWatchMetrics)
Sets the value ofRedactionLambdaProps.getPublishCloudWatchMetrics()- Parameters:
publishCloudWatchMetrics- True if publish metrics to Cloudwatch, false otherwise. See README.md for details on CloudWatch metrics.- Returns:
this
-
semanticVersion
@Stability(Stable) public RedactionLambdaProps.Builder semanticVersion(String semanticVersion)
Sets the value ofRedactionLambdaProps.getSemanticVersion()- Parameters:
semanticVersion- The version of the serverless application.- Returns:
this
-
subsegmentOverlappingTokens
@Stability(Stable) public RedactionLambdaProps.Builder subsegmentOverlappingTokens(String subsegmentOverlappingTokens)
Sets the value ofRedactionLambdaProps.getSubsegmentOverlappingTokens()- Parameters:
subsegmentOverlappingTokens- Number of tokens/words to overlap among segments of a document in case chunking is needed because of maximum document size limit.- Returns:
this
-
unsupportedFileHandling
@Stability(Stable) public RedactionLambdaProps.Builder unsupportedFileHandling(String unsupportedFileHandling)
Sets the value ofRedactionLambdaProps.getUnsupportedFileHandling()- Parameters:
unsupportedFileHandling- Handling logic for Unsupported files. Valid values are PASS and FAIL.- Returns:
this
-
build
@Stability(Stable) public RedactionLambdaProps build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<RedactionLambdaProps>- Returns:
- a new instance of
RedactionLambdaProps - Throws:
NullPointerException- if any required attribute was not provided
-
-