commonMain.aws.sdk.kotlin.services.bedrockagent.model.AgentKnowledgeBaseSummary.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockagent-jvm Show documentation
Show all versions of bedrockagent-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Agent
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent.model
import aws.smithy.kotlin.runtime.time.Instant
/**
* Contains details about a knowledge base associated with an agent.
*/
public class AgentKnowledgeBaseSummary private constructor(builder: Builder) {
/**
* The description of the knowledge base associated with an agent.
*/
public val description: kotlin.String? = builder.description
/**
* The unique identifier of the knowledge base associated with an agent.
*/
public val knowledgeBaseId: kotlin.String = requireNotNull(builder.knowledgeBaseId) { "A non-null value must be provided for knowledgeBaseId" }
/**
* Specifies whether the agent uses 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 knowledge base associated with an agent 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.AgentKnowledgeBaseSummary = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AgentKnowledgeBaseSummary(")
append("description=$description,")
append("knowledgeBaseId=$knowledgeBaseId,")
append("knowledgeBaseState=$knowledgeBaseState,")
append("updatedAt=$updatedAt")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = description?.hashCode() ?: 0
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 AgentKnowledgeBaseSummary
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.AgentKnowledgeBaseSummary = Builder(this).apply(block).build()
public class Builder {
/**
* The description of the knowledge base associated with an agent.
*/
public var description: kotlin.String? = null
/**
* The unique identifier of the knowledge base associated with an agent.
*/
public var knowledgeBaseId: kotlin.String? = null
/**
* Specifies whether the agent uses 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 knowledge base associated with an agent 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.AgentKnowledgeBaseSummary) : this() {
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.AgentKnowledgeBaseSummary = AgentKnowledgeBaseSummary(this)
internal fun correctErrors(): Builder {
if (knowledgeBaseId == null) knowledgeBaseId = ""
if (knowledgeBaseState == null) knowledgeBaseState = KnowledgeBaseState.SdkUnknown("no value provided")
if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
return this
}
}
}