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

commonMain.aws.sdk.kotlin.services.cloudsearchdomain.model.Hit.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudsearchdomain.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Information about a document that matches the search request.
 */
public class Hit private constructor(builder: Builder) {
    /**
     * The expressions returned from a document that matches the search request.
     */
    public val exprs: Map? = builder.exprs
    /**
     * The fields returned from a document that matches the search request.
     */
    public val fields: Map>? = builder.fields
    /**
     * The highlights returned from a document that matches the search request.
     */
    public val highlights: Map? = builder.highlights
    /**
     * The document ID of a document that matches the search request.
     */
    public val id: kotlin.String? = builder.id

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

    override fun toString(): kotlin.String = buildString {
        append("Hit(")
        append("exprs=$exprs,")
        append("fields=$fields,")
        append("highlights=$highlights,")
        append("id=$id")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = exprs?.hashCode() ?: 0
        result = 31 * result + (fields?.hashCode() ?: 0)
        result = 31 * result + (highlights?.hashCode() ?: 0)
        result = 31 * result + (id?.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 Hit

        if (exprs != other.exprs) return false
        if (fields != other.fields) return false
        if (highlights != other.highlights) return false
        if (id != other.id) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The expressions returned from a document that matches the search request.
         */
        public var exprs: Map? = null
        /**
         * The fields returned from a document that matches the search request.
         */
        public var fields: Map>? = null
        /**
         * The highlights returned from a document that matches the search request.
         */
        public var highlights: Map? = null
        /**
         * The document ID of a document that matches the search request.
         */
        public var id: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudsearchdomain.model.Hit) : this() {
            this.exprs = x.exprs
            this.fields = x.fields
            this.highlights = x.highlights
            this.id = x.id
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy