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

commonMain.aws.sdk.kotlin.services.cloudsearchdomain.model.Hits.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 collection of documents that match the search request.
 */
public class Hits private constructor(builder: Builder) {
    /**
     * A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.
     */
    public val cursor: kotlin.String? = builder.cursor
    /**
     * The total number of documents that match the search request.
     */
    public val found: kotlin.Long = builder.found
    /**
     * A document that matches the search request.
     */
    public val hit: List? = builder.hit
    /**
     * The index of the first matching document.
     */
    public val start: kotlin.Long = builder.start

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

    override fun toString(): kotlin.String = buildString {
        append("Hits(")
        append("cursor=$cursor,")
        append("found=$found,")
        append("hit=$hit,")
        append("start=$start")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = cursor?.hashCode() ?: 0
        result = 31 * result + (found.hashCode())
        result = 31 * result + (hit?.hashCode() ?: 0)
        result = 31 * result + (start.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 Hits

        if (cursor != other.cursor) return false
        if (found != other.found) return false
        if (hit != other.hit) return false
        if (start != other.start) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.
         */
        public var cursor: kotlin.String? = null
        /**
         * The total number of documents that match the search request.
         */
        public var found: kotlin.Long = 0L
        /**
         * A document that matches the search request.
         */
        public var hit: List? = null
        /**
         * The index of the first matching document.
         */
        public var start: kotlin.Long = 0L

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudsearchdomain.model.Hits) : this() {
            this.cursor = x.cursor
            this.found = x.found
            this.hit = x.hit
            this.start = x.start
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy