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

commonMain.aws.sdk.kotlin.services.comprehend.model.TaskConfig.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.comprehend.model



/**
 * Configuration about the custom classifier associated with the flywheel.
 */
public class TaskConfig private constructor(builder: Builder) {
    /**
     * Configuration required for a classification model.
     */
    public val documentClassificationConfig: aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig? = builder.documentClassificationConfig
    /**
     * Configuration required for an entity recognition model.
     */
    public val entityRecognitionConfig: aws.sdk.kotlin.services.comprehend.model.EntityRecognitionConfig? = builder.entityRecognitionConfig
    /**
     * Language code for the language that the model supports.
     */
    public val languageCode: aws.sdk.kotlin.services.comprehend.model.LanguageCode? = builder.languageCode

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

    override fun toString(): kotlin.String = buildString {
        append("TaskConfig(")
        append("documentClassificationConfig=$documentClassificationConfig,")
        append("entityRecognitionConfig=$entityRecognitionConfig,")
        append("languageCode=$languageCode")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = documentClassificationConfig?.hashCode() ?: 0
        result = 31 * result + (entityRecognitionConfig?.hashCode() ?: 0)
        result = 31 * result + (languageCode?.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 TaskConfig

        if (documentClassificationConfig != other.documentClassificationConfig) return false
        if (entityRecognitionConfig != other.entityRecognitionConfig) return false
        if (languageCode != other.languageCode) return false

        return true
    }

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

    public class Builder {
        /**
         * Configuration required for a classification model.
         */
        public var documentClassificationConfig: aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig? = null
        /**
         * Configuration required for an entity recognition model.
         */
        public var entityRecognitionConfig: aws.sdk.kotlin.services.comprehend.model.EntityRecognitionConfig? = null
        /**
         * Language code for the language that the model supports.
         */
        public var languageCode: aws.sdk.kotlin.services.comprehend.model.LanguageCode? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.comprehend.model.TaskConfig) : this() {
            this.documentClassificationConfig = x.documentClassificationConfig
            this.entityRecognitionConfig = x.entityRecognitionConfig
            this.languageCode = x.languageCode
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig] inside the given [block]
         */
        public fun documentClassificationConfig(block: aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig.Builder.() -> kotlin.Unit) {
            this.documentClassificationConfig = aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.comprehend.model.EntityRecognitionConfig] inside the given [block]
         */
        public fun entityRecognitionConfig(block: aws.sdk.kotlin.services.comprehend.model.EntityRecognitionConfig.Builder.() -> kotlin.Unit) {
            this.entityRecognitionConfig = aws.sdk.kotlin.services.comprehend.model.EntityRecognitionConfig.invoke(block)
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy