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

commonMain.aws.sdk.kotlin.services.kendra.model.GetQuerySuggestionsRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kendra.model



public class GetQuerySuggestionsRequest private constructor(builder: Builder) {
    /**
     * Configuration information for the document fields/attributes that you want to base query suggestions on.
     */
    public val attributeSuggestionsConfig: aws.sdk.kotlin.services.kendra.model.AttributeSuggestionsGetConfig? = builder.attributeSuggestionsConfig
    /**
     * The identifier of the index you want to get query suggestions from.
     */
    public val indexId: kotlin.String? = builder.indexId
    /**
     * The maximum number of query suggestions you want to show to your users.
     */
    public val maxSuggestionsCount: kotlin.Int? = builder.maxSuggestionsCount
    /**
     * The text of a user's query to generate query suggestions.
     *
     * A query is suggested if the query prefix matches what a user starts to type as their query.
     *
     * Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 characters. A query must also have at least one search result and contain at least one word of more than four characters.
     */
    public val queryText: kotlin.String? = builder.queryText
    /**
     * The suggestions type to base query suggestions on. The suggestion types are query history or document fields/attributes. You can set one type or the other.
     *
     * If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users based on popular queries in the query history.
     *
     * If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to your users based on the contents of document fields.
     */
    public val suggestionTypes: List? = builder.suggestionTypes

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

    override fun toString(): kotlin.String = buildString {
        append("GetQuerySuggestionsRequest(")
        append("attributeSuggestionsConfig=$attributeSuggestionsConfig,")
        append("indexId=$indexId,")
        append("maxSuggestionsCount=$maxSuggestionsCount,")
        append("queryText=$queryText,")
        append("suggestionTypes=$suggestionTypes")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = attributeSuggestionsConfig?.hashCode() ?: 0
        result = 31 * result + (indexId?.hashCode() ?: 0)
        result = 31 * result + (maxSuggestionsCount ?: 0)
        result = 31 * result + (queryText?.hashCode() ?: 0)
        result = 31 * result + (suggestionTypes?.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 GetQuerySuggestionsRequest

        if (attributeSuggestionsConfig != other.attributeSuggestionsConfig) return false
        if (indexId != other.indexId) return false
        if (maxSuggestionsCount != other.maxSuggestionsCount) return false
        if (queryText != other.queryText) return false
        if (suggestionTypes != other.suggestionTypes) return false

        return true
    }

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

    public class Builder {
        /**
         * Configuration information for the document fields/attributes that you want to base query suggestions on.
         */
        public var attributeSuggestionsConfig: aws.sdk.kotlin.services.kendra.model.AttributeSuggestionsGetConfig? = null
        /**
         * The identifier of the index you want to get query suggestions from.
         */
        public var indexId: kotlin.String? = null
        /**
         * The maximum number of query suggestions you want to show to your users.
         */
        public var maxSuggestionsCount: kotlin.Int? = null
        /**
         * The text of a user's query to generate query suggestions.
         *
         * A query is suggested if the query prefix matches what a user starts to type as their query.
         *
         * Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 characters. A query must also have at least one search result and contain at least one word of more than four characters.
         */
        public var queryText: kotlin.String? = null
        /**
         * The suggestions type to base query suggestions on. The suggestion types are query history or document fields/attributes. You can set one type or the other.
         *
         * If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users based on popular queries in the query history.
         *
         * If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to your users based on the contents of document fields.
         */
        public var suggestionTypes: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.kendra.model.GetQuerySuggestionsRequest) : this() {
            this.attributeSuggestionsConfig = x.attributeSuggestionsConfig
            this.indexId = x.indexId
            this.maxSuggestionsCount = x.maxSuggestionsCount
            this.queryText = x.queryText
            this.suggestionTypes = x.suggestionTypes
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy