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

commonMain.aws.sdk.kotlin.services.wisdom.model.ResultData.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.wisdom.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Information about the result.
 */
public class ResultData private constructor(builder: Builder) {
    /**
     * The document.
     */
    public val document: aws.sdk.kotlin.services.wisdom.model.Document? = builder.document
    /**
     * The relevance score of the results.
     */
    public val relevanceScore: kotlin.Double = builder.relevanceScore
    /**
     * The identifier of the result data.
     */
    public val resultId: kotlin.String = requireNotNull(builder.resultId) { "A non-null value must be provided for resultId" }

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

    override fun toString(): kotlin.String = buildString {
        append("ResultData(")
        append("document=$document,")
        append("relevanceScore=$relevanceScore,")
        append("resultId=$resultId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = document?.hashCode() ?: 0
        result = 31 * result + (relevanceScore.hashCode())
        result = 31 * result + (resultId.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 ResultData

        if (document != other.document) return false
        if (!(relevanceScore?.equals(other.relevanceScore) ?: (other.relevanceScore == null))) return false
        if (resultId != other.resultId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The document.
         */
        public var document: aws.sdk.kotlin.services.wisdom.model.Document? = null
        /**
         * The relevance score of the results.
         */
        public var relevanceScore: kotlin.Double = 0.0
        /**
         * The identifier of the result data.
         */
        public var resultId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wisdom.model.ResultData) : this() {
            this.document = x.document
            this.relevanceScore = x.relevanceScore
            this.resultId = x.resultId
        }

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

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

        internal fun correctErrors(): Builder {
            if (resultId == null) resultId = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy