commonMain.aws.sdk.kotlin.services.comprehend.model.ToxicLabels.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
/**
* Toxicity analysis result for one string. For more information about toxicity detection, see [Toxicity detection](https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html) in the *Amazon Comprehend Developer Guide*.
*/
public class ToxicLabels private constructor(builder: Builder) {
/**
* Array of toxic content types identified in the string.
*/
public val labels: List? = builder.labels
/**
* Overall toxicity score for the string. Value range is zero to one, where one is the highest confidence.
*/
public val toxicity: kotlin.Float? = builder.toxicity
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.comprehend.model.ToxicLabels = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ToxicLabels(")
append("labels=$labels,")
append("toxicity=$toxicity")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = labels?.hashCode() ?: 0
result = 31 * result + (toxicity?.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 ToxicLabels
if (labels != other.labels) return false
if (!(toxicity?.equals(other.toxicity) ?: (other.toxicity == null))) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.comprehend.model.ToxicLabels = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Array of toxic content types identified in the string.
*/
public var labels: List? = null
/**
* Overall toxicity score for the string. Value range is zero to one, where one is the highest confidence.
*/
public var toxicity: kotlin.Float? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.comprehend.model.ToxicLabels) : this() {
this.labels = x.labels
this.toxicity = x.toxicity
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.comprehend.model.ToxicLabels = ToxicLabels(this)
internal fun correctErrors(): Builder {
return this
}
}
}