commonMain.aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel.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
/**
* Container for the suggestion information returned in a `SuggestResponse`.
*/
public class SuggestModel private constructor(builder: Builder) {
/**
* The number of documents that were found to match the query string.
*/
public val found: kotlin.Long = builder.found
/**
* The query string specified in the suggest request.
*/
public val query: kotlin.String? = builder.query
/**
* The documents that match the query string.
*/
public val suggestions: List? = builder.suggestions
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("SuggestModel(")
append("found=$found,")
append("query=$query,")
append("suggestions=$suggestions")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = found.hashCode()
result = 31 * result + (query?.hashCode() ?: 0)
result = 31 * result + (suggestions?.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 SuggestModel
if (found != other.found) return false
if (query != other.query) return false
if (suggestions != other.suggestions) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The number of documents that were found to match the query string.
*/
public var found: kotlin.Long = 0L
/**
* The query string specified in the suggest request.
*/
public var query: kotlin.String? = null
/**
* The documents that match the query string.
*/
public var suggestions: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel) : this() {
this.found = x.found
this.query = x.query
this.suggestions = x.suggestions
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel = SuggestModel(this)
internal fun correctErrors(): Builder {
return this
}
}
}