commonMain.aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestResponse.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
/**
* Contains the response to a `Suggest` request.
*/
public class SuggestResponse private constructor(builder: Builder) {
/**
* The status of a `SuggestRequest`. Contains the resource ID (`rid`) and how long it took to process the request (`timems`).
*/
public val status: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestStatus? = builder.status
/**
* Container for the matching search suggestion information.
*/
public val suggest: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel? = builder.suggest
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("SuggestResponse(")
append("status=$status,")
append("suggest=$suggest")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = status?.hashCode() ?: 0
result = 31 * result + (suggest?.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 SuggestResponse
if (status != other.status) return false
if (suggest != other.suggest) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestResponse = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The status of a `SuggestRequest`. Contains the resource ID (`rid`) and how long it took to process the request (`timems`).
*/
public var status: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestStatus? = null
/**
* Container for the matching search suggestion information.
*/
public var suggest: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestResponse) : this() {
this.status = x.status
this.suggest = x.suggest
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestResponse = SuggestResponse(this)
/**
* construct an [aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestStatus] inside the given [block]
*/
public fun status(block: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestStatus.Builder.() -> kotlin.Unit) {
this.status = aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestStatus.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel] inside the given [block]
*/
public fun suggest(block: aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel.Builder.() -> kotlin.Unit) {
this.suggest = aws.sdk.kotlin.services.cloudsearchdomain.model.SuggestModel.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}