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

commonMain.aws.sdk.kotlin.services.cloudsearchdomain.model.SearchResponse.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

/**
 * The result of a `Search` request. Contains the documents that match the specified search criteria and any requested fields, highlights, and facet information.
 */
public class SearchResponse private constructor(builder: Builder) {
    /**
     * The requested facet information.
     */
    public val facets: Map? = builder.facets
    /**
     * The documents that match the search criteria.
     */
    public val hits: aws.sdk.kotlin.services.cloudsearchdomain.model.Hits? = builder.hits
    /**
     * The requested field statistics information.
     */
    public val stats: Map? = builder.stats
    /**
     * The status information returned for the search request.
     */
    public val status: aws.sdk.kotlin.services.cloudsearchdomain.model.SearchStatus? = builder.status

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

    override fun toString(): kotlin.String = buildString {
        append("SearchResponse(")
        append("facets=$facets,")
        append("hits=$hits,")
        append("stats=$stats,")
        append("status=$status")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = facets?.hashCode() ?: 0
        result = 31 * result + (hits?.hashCode() ?: 0)
        result = 31 * result + (stats?.hashCode() ?: 0)
        result = 31 * result + (status?.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 SearchResponse

        if (facets != other.facets) return false
        if (hits != other.hits) return false
        if (stats != other.stats) return false
        if (status != other.status) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The requested facet information.
         */
        public var facets: Map? = null
        /**
         * The documents that match the search criteria.
         */
        public var hits: aws.sdk.kotlin.services.cloudsearchdomain.model.Hits? = null
        /**
         * The requested field statistics information.
         */
        public var stats: Map? = null
        /**
         * The status information returned for the search request.
         */
        public var status: aws.sdk.kotlin.services.cloudsearchdomain.model.SearchStatus? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudsearchdomain.model.SearchResponse) : this() {
            this.facets = x.facets
            this.hits = x.hits
            this.stats = x.stats
            this.status = x.status
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy