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

commonMain.aws.sdk.kotlin.services.comprehendmedical.model.DetectEntitiesV2Response.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.comprehendmedical.model



public class DetectEntitiesV2Response private constructor(builder: Builder) {
    /**
     * The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence in the detection and analysis. Attributes and traits of the entity are also returned.
     */
    public val entities: List = requireNotNull(builder.entities) { "A non-null value must be provided for entities" }
    /**
     * The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.
     */
    public val modelVersion: kotlin.String = requireNotNull(builder.modelVersion) { "A non-null value must be provided for modelVersion" }
    /**
     * If the result to the `DetectEntitiesV2` operation was truncated, include the `PaginationToken` to fetch the next page of entities.
     */
    public val paginationToken: kotlin.String? = builder.paginationToken
    /**
     * Attributes extracted from the input text that couldn't be related to an entity.
     */
    public val unmappedAttributes: List? = builder.unmappedAttributes

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

    override fun toString(): kotlin.String = buildString {
        append("DetectEntitiesV2Response(")
        append("entities=$entities,")
        append("modelVersion=$modelVersion,")
        append("paginationToken=$paginationToken,")
        append("unmappedAttributes=$unmappedAttributes")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = entities.hashCode()
        result = 31 * result + (modelVersion.hashCode())
        result = 31 * result + (paginationToken?.hashCode() ?: 0)
        result = 31 * result + (unmappedAttributes?.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 DetectEntitiesV2Response

        if (entities != other.entities) return false
        if (modelVersion != other.modelVersion) return false
        if (paginationToken != other.paginationToken) return false
        if (unmappedAttributes != other.unmappedAttributes) return false

        return true
    }

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

    public class Builder {
        /**
         * The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence in the detection and analysis. Attributes and traits of the entity are also returned.
         */
        public var entities: List? = null
        /**
         * The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.
         */
        public var modelVersion: kotlin.String? = null
        /**
         * If the result to the `DetectEntitiesV2` operation was truncated, include the `PaginationToken` to fetch the next page of entities.
         */
        public var paginationToken: kotlin.String? = null
        /**
         * Attributes extracted from the input text that couldn't be related to an entity.
         */
        public var unmappedAttributes: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.comprehendmedical.model.DetectEntitiesV2Response) : this() {
            this.entities = x.entities
            this.modelVersion = x.modelVersion
            this.paginationToken = x.paginationToken
            this.unmappedAttributes = x.unmappedAttributes
        }

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

        internal fun correctErrors(): Builder {
            if (entities == null) entities = emptyList()
            if (modelVersion == null) modelVersion = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy