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

commonMain.aws.sdk.kotlin.services.wisdom.model.SearchContentRequest.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 SearchContentRequest private constructor(builder: Builder) {
    /**
     * The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. Can be either the ID or the ARN. URLs cannot contain the ARN.
     */
    public val knowledgeBaseId: kotlin.String = requireNotNull(builder.knowledgeBaseId) { "A non-null value must be provided for knowledgeBaseId" }
    /**
     * 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.SearchContentRequest = Builder().apply(block).build()
    }

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

    override fun hashCode(): kotlin.Int {
        var result = knowledgeBaseId.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 SearchContentRequest

        if (knowledgeBaseId != other.knowledgeBaseId) 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.SearchContentRequest = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. Can be either the ID or the ARN. URLs cannot contain the ARN.
         */
        public var knowledgeBaseId: 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.SearchContentRequest) : this() {
            this.knowledgeBaseId = x.knowledgeBaseId
            this.maxResults = x.maxResults
            this.nextToken = x.nextToken
            this.searchExpression = x.searchExpression
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.wisdom.model.SearchContentRequest = SearchContentRequest(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 (knowledgeBaseId == null) knowledgeBaseId = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy