All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.glue.model.PiiDetection.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Specifies a transform that identifies, removes or masks PII data.
 */
public class PiiDetection private constructor(builder: Builder) {
    /**
     * Indicates the types of entities the PIIDetection transform will identify as PII data.
     *
     *  PII type entities include: PERSON_NAME, DATE, USA_SNN, EMAIL, USA_ITIN, USA_PASSPORT_NUMBER, PHONE_NUMBER, BANK_ACCOUNT, IP_ADDRESS, MAC_ADDRESS, USA_CPT_CODE, USA_HCPCS_CODE, USA_NATIONAL_DRUG_CODE, USA_MEDICARE_BENEFICIARY_IDENTIFIER, USA_HEALTH_INSURANCE_CLAIM_NUMBER,CREDIT_CARD,USA_NATIONAL_PROVIDER_IDENTIFIER,USA_DEA_NUMBER,USA_DRIVING_LICENSE
     */
    public val entityTypesToDetect: List = requireNotNull(builder.entityTypesToDetect) { "A non-null value must be provided for entityTypesToDetect" }
    /**
     * The node ID inputs to the transform.
     */
    public val inputs: List = requireNotNull(builder.inputs) { "A non-null value must be provided for inputs" }
    /**
     * Indicates the value that will replace the detected entity.
     */
    public val maskValue: kotlin.String? = builder.maskValue
    /**
     * The name of the transform node.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * Indicates the output column name that will contain any entity type detected in that row.
     */
    public val outputColumnName: kotlin.String? = builder.outputColumnName
    /**
     * Indicates the type of PIIDetection transform.
     */
    public val piiType: aws.sdk.kotlin.services.glue.model.PiiType = requireNotNull(builder.piiType) { "A non-null value must be provided for piiType" }
    /**
     * Indicates the fraction of the data to sample when scanning for PII entities.
     */
    public val sampleFraction: kotlin.Double? = builder.sampleFraction
    /**
     * Indicates the fraction of the data that must be met in order for a column to be identified as PII data.
     */
    public val thresholdFraction: kotlin.Double? = builder.thresholdFraction

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.PiiDetection = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("PiiDetection(")
        append("entityTypesToDetect=$entityTypesToDetect,")
        append("inputs=$inputs,")
        append("maskValue=$maskValue,")
        append("name=$name,")
        append("outputColumnName=$outputColumnName,")
        append("piiType=$piiType,")
        append("sampleFraction=$sampleFraction,")
        append("thresholdFraction=$thresholdFraction")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = entityTypesToDetect.hashCode()
        result = 31 * result + (inputs.hashCode())
        result = 31 * result + (maskValue?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (outputColumnName?.hashCode() ?: 0)
        result = 31 * result + (piiType.hashCode())
        result = 31 * result + (sampleFraction?.hashCode() ?: 0)
        result = 31 * result + (thresholdFraction?.hashCode() ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as PiiDetection

        if (entityTypesToDetect != other.entityTypesToDetect) return false
        if (inputs != other.inputs) return false
        if (maskValue != other.maskValue) return false
        if (name != other.name) return false
        if (outputColumnName != other.outputColumnName) return false
        if (piiType != other.piiType) return false
        if (!(sampleFraction?.equals(other.sampleFraction) ?: (other.sampleFraction == null))) return false
        if (!(thresholdFraction?.equals(other.thresholdFraction) ?: (other.thresholdFraction == null))) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.PiiDetection = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Indicates the types of entities the PIIDetection transform will identify as PII data.
         *
         *  PII type entities include: PERSON_NAME, DATE, USA_SNN, EMAIL, USA_ITIN, USA_PASSPORT_NUMBER, PHONE_NUMBER, BANK_ACCOUNT, IP_ADDRESS, MAC_ADDRESS, USA_CPT_CODE, USA_HCPCS_CODE, USA_NATIONAL_DRUG_CODE, USA_MEDICARE_BENEFICIARY_IDENTIFIER, USA_HEALTH_INSURANCE_CLAIM_NUMBER,CREDIT_CARD,USA_NATIONAL_PROVIDER_IDENTIFIER,USA_DEA_NUMBER,USA_DRIVING_LICENSE
         */
        public var entityTypesToDetect: List? = null
        /**
         * The node ID inputs to the transform.
         */
        public var inputs: List? = null
        /**
         * Indicates the value that will replace the detected entity.
         */
        public var maskValue: kotlin.String? = null
        /**
         * The name of the transform node.
         */
        public var name: kotlin.String? = null
        /**
         * Indicates the output column name that will contain any entity type detected in that row.
         */
        public var outputColumnName: kotlin.String? = null
        /**
         * Indicates the type of PIIDetection transform.
         */
        public var piiType: aws.sdk.kotlin.services.glue.model.PiiType? = null
        /**
         * Indicates the fraction of the data to sample when scanning for PII entities.
         */
        public var sampleFraction: kotlin.Double? = null
        /**
         * Indicates the fraction of the data that must be met in order for a column to be identified as PII data.
         */
        public var thresholdFraction: kotlin.Double? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.PiiDetection) : this() {
            this.entityTypesToDetect = x.entityTypesToDetect
            this.inputs = x.inputs
            this.maskValue = x.maskValue
            this.name = x.name
            this.outputColumnName = x.outputColumnName
            this.piiType = x.piiType
            this.sampleFraction = x.sampleFraction
            this.thresholdFraction = x.thresholdFraction
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.glue.model.PiiDetection = PiiDetection(this)

        internal fun correctErrors(): Builder {
            if (entityTypesToDetect == null) entityTypesToDetect = emptyList()
            if (inputs == null) inputs = emptyList()
            if (name == null) name = ""
            if (piiType == null) piiType = PiiType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy