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

commonMain.aws.sdk.kotlin.services.kendra.model.FacetResult.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kendra.model



/**
 * The facet values for the documents in the response.
 */
public class FacetResult private constructor(builder: Builder) {
    /**
     * The key for the facet values. This is the same as the `DocumentAttributeKey` provided in the query.
     */
    public val documentAttributeKey: kotlin.String? = builder.documentAttributeKey
    /**
     * An array of key/value pairs, where the key is the value of the attribute and the count is the number of documents that share the key value.
     */
    public val documentAttributeValueCountPairs: List? = builder.documentAttributeValueCountPairs
    /**
     * The data type of the facet value. This is the same as the type defined for the index field when it was created.
     */
    public val documentAttributeValueType: aws.sdk.kotlin.services.kendra.model.DocumentAttributeValueType? = builder.documentAttributeValueType

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

    override fun toString(): kotlin.String = buildString {
        append("FacetResult(")
        append("documentAttributeKey=$documentAttributeKey,")
        append("documentAttributeValueCountPairs=$documentAttributeValueCountPairs,")
        append("documentAttributeValueType=$documentAttributeValueType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = documentAttributeKey?.hashCode() ?: 0
        result = 31 * result + (documentAttributeValueCountPairs?.hashCode() ?: 0)
        result = 31 * result + (documentAttributeValueType?.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 FacetResult

        if (documentAttributeKey != other.documentAttributeKey) return false
        if (documentAttributeValueCountPairs != other.documentAttributeValueCountPairs) return false
        if (documentAttributeValueType != other.documentAttributeValueType) return false

        return true
    }

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

    public class Builder {
        /**
         * The key for the facet values. This is the same as the `DocumentAttributeKey` provided in the query.
         */
        public var documentAttributeKey: kotlin.String? = null
        /**
         * An array of key/value pairs, where the key is the value of the attribute and the count is the number of documents that share the key value.
         */
        public var documentAttributeValueCountPairs: List? = null
        /**
         * The data type of the facet value. This is the same as the type defined for the index field when it was created.
         */
        public var documentAttributeValueType: aws.sdk.kotlin.services.kendra.model.DocumentAttributeValueType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.kendra.model.FacetResult) : this() {
            this.documentAttributeKey = x.documentAttributeKey
            this.documentAttributeValueCountPairs = x.documentAttributeValueCountPairs
            this.documentAttributeValueType = x.documentAttributeValueType
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy