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

commonMain.aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestionMatch.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudsearchdomain.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An autocomplete suggestion that matches the query string specified in a `SuggestRequest`.
 */
public class SuggestionMatch private constructor(builder: Builder) {
    /**
     * The document ID of the suggested document.
     */
    public val id: kotlin.String? = builder.id
    /**
     * The relevance score of a suggested match.
     */
    public val score: kotlin.Long = builder.score
    /**
     * The string that matches the query string specified in the `SuggestRequest`.
     */
    public val suggestion: kotlin.String? = builder.suggestion

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

    override fun toString(): kotlin.String = buildString {
        append("SuggestionMatch(")
        append("id=$id,")
        append("score=$score,")
        append("suggestion=$suggestion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = id?.hashCode() ?: 0
        result = 31 * result + (score.hashCode())
        result = 31 * result + (suggestion?.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 SuggestionMatch

        if (id != other.id) return false
        if (score != other.score) return false
        if (suggestion != other.suggestion) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The document ID of the suggested document.
         */
        public var id: kotlin.String? = null
        /**
         * The relevance score of a suggested match.
         */
        public var score: kotlin.Long = 0L
        /**
         * The string that matches the query string specified in the `SuggestRequest`.
         */
        public var suggestion: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestionMatch) : this() {
            this.id = x.id
            this.score = x.score
            this.suggestion = x.suggestion
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy