commonMain.aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of comprehend-jvm Show documentation
Show all versions of comprehend-jvm Show documentation
The AWS SDK for Kotlin client for Comprehend
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.comprehend.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Configuration required for a document classification model.
*/
public class DocumentClassificationConfig private constructor(builder: Builder) {
/**
* One or more labels to associate with the custom classifier.
*/
public val labels: List? = builder.labels
/**
* Classification mode indicates whether the documents are `MULTI_CLASS` or `MULTI_LABEL`.
*/
public val mode: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierMode = requireNotNull(builder.mode) { "A non-null value must be provided for mode" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("DocumentClassificationConfig(")
append("labels=$labels,")
append("mode=$mode")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = labels?.hashCode() ?: 0
result = 31 * result + (mode.hashCode())
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 DocumentClassificationConfig
if (labels != other.labels) return false
if (mode != other.mode) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* One or more labels to associate with the custom classifier.
*/
public var labels: List? = null
/**
* Classification mode indicates whether the documents are `MULTI_CLASS` or `MULTI_LABEL`.
*/
public var mode: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierMode? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig) : this() {
this.labels = x.labels
this.mode = x.mode
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.comprehend.model.DocumentClassificationConfig = DocumentClassificationConfig(this)
internal fun correctErrors(): Builder {
if (mode == null) mode = DocumentClassifierMode.SdkUnknown("no value provided")
return this
}
}
}