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

commonMain.aws.sdk.kotlin.services.qbusiness.model.StringAttributeBoostingConfiguration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.qbusiness.model



/**
 * Provides information on boosting `STRING` type document attributes.
 *
 * For `STRING` and `STRING_LIST` type document attributes to be used for boosting on the console and the API, they must be enabled for search using the [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) object of the [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) API. If you haven't enabled searching on these attributes, you can't boost attributes of these data types on either the console or the API.
 *
 * For more information on how boosting document attributes work in Amazon Q Business, see [Boosting using document attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html).
 */
public class StringAttributeBoostingConfiguration private constructor(builder: Builder) {
    /**
     * Specifies specific values of a `STRING` type document attribute being boosted.
     */
    public val attributeValueBoosting: Map? = builder.attributeValueBoosting
    /**
     * Specifies how much a document attribute is boosted.
     */
    public val boostingLevel: aws.sdk.kotlin.services.qbusiness.model.DocumentAttributeBoostingLevel = requireNotNull(builder.boostingLevel) { "A non-null value must be provided for boostingLevel" }

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

    override fun toString(): kotlin.String = buildString {
        append("StringAttributeBoostingConfiguration(")
        append("attributeValueBoosting=$attributeValueBoosting,")
        append("boostingLevel=$boostingLevel")
        append(")")
    }

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

        if (attributeValueBoosting != other.attributeValueBoosting) return false
        if (boostingLevel != other.boostingLevel) return false

        return true
    }

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

    public class Builder {
        /**
         * Specifies specific values of a `STRING` type document attribute being boosted.
         */
        public var attributeValueBoosting: Map? = null
        /**
         * Specifies how much a document attribute is boosted.
         */
        public var boostingLevel: aws.sdk.kotlin.services.qbusiness.model.DocumentAttributeBoostingLevel? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qbusiness.model.StringAttributeBoostingConfiguration) : this() {
            this.attributeValueBoosting = x.attributeValueBoosting
            this.boostingLevel = x.boostingLevel
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy