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

commonMain.aws.sdk.kotlin.services.wisdom.model.SearchSessionsRequest.kt Maven / Gradle / Ivy

There is a newer version: 1.3.80
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.wisdom.model

import aws.smithy.kotlin.runtime.SdkDsl

public class SearchSessionsRequest private constructor(builder: Builder) {
    /**
     * The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
     */
    public val assistantId: kotlin.String = requireNotNull(builder.assistantId) { "A non-null value must be provided for assistantId" }
    /**
     * The maximum number of results to return per page.
     */
    public val maxResults: kotlin.Int? = builder.maxResults
    /**
     * The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
     */
    public val nextToken: kotlin.String? = builder.nextToken
    /**
     * The search expression to filter results.
     */
    public val searchExpression: aws.sdk.kotlin.services.wisdom.model.SearchExpression? = builder.searchExpression

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

    override fun toString(): kotlin.String = buildString {
        append("SearchSessionsRequest(")
        append("assistantId=$assistantId,")
        append("maxResults=$maxResults,")
        append("nextToken=$nextToken,")
        append("searchExpression=$searchExpression")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = assistantId.hashCode()
        result = 31 * result + (maxResults ?: 0)
        result = 31 * result + (nextToken?.hashCode() ?: 0)
        result = 31 * result + (searchExpression?.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 SearchSessionsRequest

        if (assistantId != other.assistantId) return false
        if (maxResults != other.maxResults) return false
        if (nextToken != other.nextToken) return false
        if (searchExpression != other.searchExpression) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
         */
        public var assistantId: kotlin.String? = null
        /**
         * The maximum number of results to return per page.
         */
        public var maxResults: kotlin.Int? = null
        /**
         * The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
         */
        public var nextToken: kotlin.String? = null
        /**
         * The search expression to filter results.
         */
        public var searchExpression: aws.sdk.kotlin.services.wisdom.model.SearchExpression? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wisdom.model.SearchSessionsRequest) : this() {
            this.assistantId = x.assistantId
            this.maxResults = x.maxResults
            this.nextToken = x.nextToken
            this.searchExpression = x.searchExpression
        }

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

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

        internal fun correctErrors(): Builder {
            if (assistantId == null) assistantId = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy