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

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



/**
 * Options for text field. Present if `IndexFieldType` specifies the field is of type `text`. A `text` field is always searchable. All options are enabled by default.
 */
public class TextOptions private constructor(builder: Builder) {
    /**
     * The name of an analysis scheme for a `text` field.
     */
    public val analysisScheme: kotlin.String? = builder.analysisScheme
    /**
     * A value to use for the field if the field isn't specified for a document.
     */
    public val defaultValue: kotlin.String? = builder.defaultValue
    /**
     * Whether highlights can be returned for the field.
     */
    public val highlightEnabled: kotlin.Boolean? = builder.highlightEnabled
    /**
     * Whether the contents of the field can be returned in the search results.
     */
    public val returnEnabled: kotlin.Boolean? = builder.returnEnabled
    /**
     * Whether the field can be used to sort the search results.
     */
    public val sortEnabled: kotlin.Boolean? = builder.sortEnabled
    /**
     * A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.
     *
     * Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.
     *
     * The name `score` is reserved and cannot be used as a field name. To reference a document's ID, you can use the name `_id`.
     */
    public val sourceField: kotlin.String? = builder.sourceField

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

    override fun toString(): kotlin.String = buildString {
        append("TextOptions(")
        append("analysisScheme=$analysisScheme,")
        append("defaultValue=$defaultValue,")
        append("highlightEnabled=$highlightEnabled,")
        append("returnEnabled=$returnEnabled,")
        append("sortEnabled=$sortEnabled,")
        append("sourceField=$sourceField")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = analysisScheme?.hashCode() ?: 0
        result = 31 * result + (defaultValue?.hashCode() ?: 0)
        result = 31 * result + (highlightEnabled?.hashCode() ?: 0)
        result = 31 * result + (returnEnabled?.hashCode() ?: 0)
        result = 31 * result + (sortEnabled?.hashCode() ?: 0)
        result = 31 * result + (sourceField?.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 TextOptions

        if (analysisScheme != other.analysisScheme) return false
        if (defaultValue != other.defaultValue) return false
        if (highlightEnabled != other.highlightEnabled) return false
        if (returnEnabled != other.returnEnabled) return false
        if (sortEnabled != other.sortEnabled) return false
        if (sourceField != other.sourceField) return false

        return true
    }

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

    public class Builder {
        /**
         * The name of an analysis scheme for a `text` field.
         */
        public var analysisScheme: kotlin.String? = null
        /**
         * A value to use for the field if the field isn't specified for a document.
         */
        public var defaultValue: kotlin.String? = null
        /**
         * Whether highlights can be returned for the field.
         */
        public var highlightEnabled: kotlin.Boolean? = null
        /**
         * Whether the contents of the field can be returned in the search results.
         */
        public var returnEnabled: kotlin.Boolean? = null
        /**
         * Whether the field can be used to sort the search results.
         */
        public var sortEnabled: kotlin.Boolean? = null
        /**
         * A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.
         *
         * Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.
         *
         * The name `score` is reserved and cannot be used as a field name. To reference a document's ID, you can use the name `_id`.
         */
        public var sourceField: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudsearch.model.TextOptions) : this() {
            this.analysisScheme = x.analysisScheme
            this.defaultValue = x.defaultValue
            this.highlightEnabled = x.highlightEnabled
            this.returnEnabled = x.returnEnabled
            this.sortEnabled = x.sortEnabled
            this.sourceField = x.sourceField
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy