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

commonMain.aws.sdk.kotlin.services.cloudsearch.model.Suggester.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudsearch.model



/**
 * Configuration information for a search suggester. Each suggester has a unique name and specifies the text field you want to use for suggestions. The following options can be configured for a suggester: `FuzzyMatching`, `SortExpression`.
 */
public class Suggester private constructor(builder: Builder) {
    /**
     * Options for a search suggester.
     */
    public val documentSuggesterOptions: aws.sdk.kotlin.services.cloudsearch.model.DocumentSuggesterOptions? = builder.documentSuggesterOptions
    /**
     * Names must begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore).
     */
    public val suggesterName: kotlin.String? = builder.suggesterName

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

    override fun toString(): kotlin.String = buildString {
        append("Suggester(")
        append("documentSuggesterOptions=$documentSuggesterOptions,")
        append("suggesterName=$suggesterName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = documentSuggesterOptions?.hashCode() ?: 0
        result = 31 * result + (suggesterName?.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 Suggester

        if (documentSuggesterOptions != other.documentSuggesterOptions) return false
        if (suggesterName != other.suggesterName) return false

        return true
    }

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

    public class Builder {
        /**
         * Options for a search suggester.
         */
        public var documentSuggesterOptions: aws.sdk.kotlin.services.cloudsearch.model.DocumentSuggesterOptions? = null
        /**
         * Names must begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore).
         */
        public var suggesterName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudsearch.model.Suggester) : this() {
            this.documentSuggesterOptions = x.documentSuggesterOptions
            this.suggesterName = x.suggesterName
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy