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

commonMain.aws.sdk.kotlin.services.cloudsearch.model.AnalysisScheme.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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Configuration information for an analysis scheme. Each analysis scheme has a unique name and specifies the language of the text to be processed. The following options can be configured for an analysis scheme: `Synonyms`, `Stopwords`, `StemmingDictionary`, `JapaneseTokenizationDictionary` and `AlgorithmicStemming`.
 */
public class AnalysisScheme private constructor(builder: Builder) {
    /**
     * Synonyms, stopwords, and stemming options for an analysis scheme. Includes tokenization dictionary for Japanese.
     */
    public val analysisOptions: aws.sdk.kotlin.services.cloudsearch.model.AnalysisOptions? = builder.analysisOptions
    /**
     * An [IETF RFC 4646](http://tools.ietf.org/html/rfc4646) language code or `mul` for multiple languages.
     */
    public val analysisSchemeLanguage: aws.sdk.kotlin.services.cloudsearch.model.AnalysisSchemeLanguage = requireNotNull(builder.analysisSchemeLanguage) { "A non-null value must be provided for analysisSchemeLanguage" }
    /**
     * Names must begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore).
     */
    public val analysisSchemeName: kotlin.String = requireNotNull(builder.analysisSchemeName) { "A non-null value must be provided for analysisSchemeName" }

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

    override fun toString(): kotlin.String = buildString {
        append("AnalysisScheme(")
        append("analysisOptions=$analysisOptions,")
        append("analysisSchemeLanguage=$analysisSchemeLanguage,")
        append("analysisSchemeName=$analysisSchemeName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = analysisOptions?.hashCode() ?: 0
        result = 31 * result + (analysisSchemeLanguage.hashCode())
        result = 31 * result + (analysisSchemeName.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 AnalysisScheme

        if (analysisOptions != other.analysisOptions) return false
        if (analysisSchemeLanguage != other.analysisSchemeLanguage) return false
        if (analysisSchemeName != other.analysisSchemeName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Synonyms, stopwords, and stemming options for an analysis scheme. Includes tokenization dictionary for Japanese.
         */
        public var analysisOptions: aws.sdk.kotlin.services.cloudsearch.model.AnalysisOptions? = null
        /**
         * An [IETF RFC 4646](http://tools.ietf.org/html/rfc4646) language code or `mul` for multiple languages.
         */
        public var analysisSchemeLanguage: aws.sdk.kotlin.services.cloudsearch.model.AnalysisSchemeLanguage? = null
        /**
         * Names must begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore).
         */
        public var analysisSchemeName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudsearch.model.AnalysisScheme) : this() {
            this.analysisOptions = x.analysisOptions
            this.analysisSchemeLanguage = x.analysisSchemeLanguage
            this.analysisSchemeName = x.analysisSchemeName
        }

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

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

        internal fun correctErrors(): Builder {
            if (analysisSchemeLanguage == null) analysisSchemeLanguage = AnalysisSchemeLanguage.SdkUnknown("no value provided")
            if (analysisSchemeName == null) analysisSchemeName = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy