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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.AgentKnowledgeBase.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.bedrockagent.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

/**
 * Contains details about a knowledge base that is associated with an agent.
 */
public class AgentKnowledgeBase private constructor(builder: Builder) {
    /**
     * The unique identifier of the agent with which the knowledge base is associated.
     */
    public val agentId: kotlin.String = requireNotNull(builder.agentId) { "A non-null value must be provided for agentId" }
    /**
     * The version of the agent with which the knowledge base is associated.
     */
    public val agentVersion: kotlin.String = requireNotNull(builder.agentVersion) { "A non-null value must be provided for agentVersion" }
    /**
     * The time at which the association between the agent and the knowledge base was created.
     */
    public val createdAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdAt) { "A non-null value must be provided for createdAt" }
    /**
     * The description of the association between the agent and the knowledge base.
     */
    public val description: kotlin.String = requireNotNull(builder.description) { "A non-null value must be provided for description" }
    /**
     * The unique identifier of the association between the agent and the knowledge base.
     */
    public val knowledgeBaseId: kotlin.String = requireNotNull(builder.knowledgeBaseId) { "A non-null value must be provided for knowledgeBaseId" }
    /**
     * Specifies whether to use the knowledge base or not when sending an [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) request.
     */
    public val knowledgeBaseState: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseState = requireNotNull(builder.knowledgeBaseState) { "A non-null value must be provided for knowledgeBaseState" }
    /**
     * The time at which the association between the agent and the knowledge base was last updated.
     */
    public val updatedAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.updatedAt) { "A non-null value must be provided for updatedAt" }

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

    override fun toString(): kotlin.String = buildString {
        append("AgentKnowledgeBase(")
        append("agentId=$agentId,")
        append("agentVersion=$agentVersion,")
        append("createdAt=$createdAt,")
        append("description=$description,")
        append("knowledgeBaseId=$knowledgeBaseId,")
        append("knowledgeBaseState=$knowledgeBaseState,")
        append("updatedAt=$updatedAt")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = agentId.hashCode()
        result = 31 * result + (agentVersion.hashCode())
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (description.hashCode())
        result = 31 * result + (knowledgeBaseId.hashCode())
        result = 31 * result + (knowledgeBaseState.hashCode())
        result = 31 * result + (updatedAt.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 AgentKnowledgeBase

        if (agentId != other.agentId) return false
        if (agentVersion != other.agentVersion) return false
        if (createdAt != other.createdAt) return false
        if (description != other.description) return false
        if (knowledgeBaseId != other.knowledgeBaseId) return false
        if (knowledgeBaseState != other.knowledgeBaseState) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The unique identifier of the agent with which the knowledge base is associated.
         */
        public var agentId: kotlin.String? = null
        /**
         * The version of the agent with which the knowledge base is associated.
         */
        public var agentVersion: kotlin.String? = null
        /**
         * The time at which the association between the agent and the knowledge base was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The description of the association between the agent and the knowledge base.
         */
        public var description: kotlin.String? = null
        /**
         * The unique identifier of the association between the agent and the knowledge base.
         */
        public var knowledgeBaseId: kotlin.String? = null
        /**
         * Specifies whether to use the knowledge base or not when sending an [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) request.
         */
        public var knowledgeBaseState: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseState? = null
        /**
         * The time at which the association between the agent and the knowledge base was last updated.
         */
        public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.AgentKnowledgeBase) : this() {
            this.agentId = x.agentId
            this.agentVersion = x.agentVersion
            this.createdAt = x.createdAt
            this.description = x.description
            this.knowledgeBaseId = x.knowledgeBaseId
            this.knowledgeBaseState = x.knowledgeBaseState
            this.updatedAt = x.updatedAt
        }

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

        internal fun correctErrors(): Builder {
            if (agentId == null) agentId = ""
            if (agentVersion == null) agentVersion = ""
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (description == null) description = ""
            if (knowledgeBaseId == null) knowledgeBaseId = ""
            if (knowledgeBaseState == null) knowledgeBaseState = KnowledgeBaseState.SdkUnknown("no value provided")
            if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy