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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Container for the parameters to the `DefineSuggester` operation. Specifies the name of the domain you want to update and the suggester configuration.
 */
public class DefineSuggesterRequest private constructor(builder: Builder) {
    /**
     * A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
     */
    public val domainName: kotlin.String? = builder.domainName
    /**
     * 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 val suggester: aws.sdk.kotlin.services.cloudsearch.model.Suggester? = builder.suggester

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

    override fun toString(): kotlin.String = buildString {
        append("DefineSuggesterRequest(")
        append("domainName=$domainName,")
        append("suggester=$suggester")
        append(")")
    }

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

        if (domainName != other.domainName) return false
        if (suggester != other.suggester) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
         */
        public var domainName: kotlin.String? = null
        /**
         * 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 var suggester: aws.sdk.kotlin.services.cloudsearch.model.Suggester? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudsearch.model.DefineSuggesterRequest) : this() {
            this.domainName = x.domainName
            this.suggester = x.suggester
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy