commonMain.aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBase.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.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* Contains information about a knowledge base.
*/
public class KnowledgeBase private constructor(builder: Builder) {
/**
* The time at which 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 knowledge base.
*/
public val description: kotlin.String? = builder.description
/**
* A list of reasons that the API operation on the knowledge base failed.
*/
public val failureReasons: List? = builder.failureReasons
/**
* The Amazon Resource Name (ARN) of the knowledge base.
*/
public val knowledgeBaseArn: kotlin.String = requireNotNull(builder.knowledgeBaseArn) { "A non-null value must be provided for knowledgeBaseArn" }
/**
* Contains details about the embeddings configuration of the knowledge base.
*/
public val knowledgeBaseConfiguration: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration? = builder.knowledgeBaseConfiguration
/**
* The unique identifier of the knowledge base.
*/
public val knowledgeBaseId: kotlin.String = requireNotNull(builder.knowledgeBaseId) { "A non-null value must be provided for knowledgeBaseId" }
/**
* The name of the knowledge base.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.
*/
public val roleArn: kotlin.String = requireNotNull(builder.roleArn) { "A non-null value must be provided for roleArn" }
/**
* The status of the knowledge base. The following statuses are possible:
* + CREATING – The knowledge base is being created.
* + ACTIVE – The knowledge base is ready to be queried.
* + DELETING – The knowledge base is being deleted.
* + UPDATING – The knowledge base is being updated.
* + FAILED – The knowledge base API operation failed.
*/
public val status: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
/**
* Contains details about the storage configuration of the knowledge base.
*/
public val storageConfiguration: aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration? = builder.storageConfiguration
/**
* The time at which 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.KnowledgeBase = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("KnowledgeBase(")
append("createdAt=$createdAt,")
append("description=$description,")
append("failureReasons=$failureReasons,")
append("knowledgeBaseArn=$knowledgeBaseArn,")
append("knowledgeBaseConfiguration=$knowledgeBaseConfiguration,")
append("knowledgeBaseId=$knowledgeBaseId,")
append("name=$name,")
append("roleArn=$roleArn,")
append("status=$status,")
append("storageConfiguration=$storageConfiguration,")
append("updatedAt=$updatedAt")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = createdAt.hashCode()
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (failureReasons?.hashCode() ?: 0)
result = 31 * result + (knowledgeBaseArn.hashCode())
result = 31 * result + (knowledgeBaseConfiguration?.hashCode() ?: 0)
result = 31 * result + (knowledgeBaseId.hashCode())
result = 31 * result + (name.hashCode())
result = 31 * result + (roleArn.hashCode())
result = 31 * result + (status.hashCode())
result = 31 * result + (storageConfiguration?.hashCode() ?: 0)
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 KnowledgeBase
if (createdAt != other.createdAt) return false
if (description != other.description) return false
if (failureReasons != other.failureReasons) return false
if (knowledgeBaseArn != other.knowledgeBaseArn) return false
if (knowledgeBaseConfiguration != other.knowledgeBaseConfiguration) return false
if (knowledgeBaseId != other.knowledgeBaseId) return false
if (name != other.name) return false
if (roleArn != other.roleArn) return false
if (status != other.status) return false
if (storageConfiguration != other.storageConfiguration) return false
if (updatedAt != other.updatedAt) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBase = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The time at which the knowledge base was created.
*/
public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The description of the knowledge base.
*/
public var description: kotlin.String? = null
/**
* A list of reasons that the API operation on the knowledge base failed.
*/
public var failureReasons: List? = null
/**
* The Amazon Resource Name (ARN) of the knowledge base.
*/
public var knowledgeBaseArn: kotlin.String? = null
/**
* Contains details about the embeddings configuration of the knowledge base.
*/
public var knowledgeBaseConfiguration: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration? = null
/**
* The unique identifier of the knowledge base.
*/
public var knowledgeBaseId: kotlin.String? = null
/**
* The name of the knowledge base.
*/
public var name: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.
*/
public var roleArn: kotlin.String? = null
/**
* The status of the knowledge base. The following statuses are possible:
* + CREATING – The knowledge base is being created.
* + ACTIVE – The knowledge base is ready to be queried.
* + DELETING – The knowledge base is being deleted.
* + UPDATING – The knowledge base is being updated.
* + FAILED – The knowledge base API operation failed.
*/
public var status: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseStatus? = null
/**
* Contains details about the storage configuration of the knowledge base.
*/
public var storageConfiguration: aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration? = null
/**
* The time at which 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.KnowledgeBase) : this() {
this.createdAt = x.createdAt
this.description = x.description
this.failureReasons = x.failureReasons
this.knowledgeBaseArn = x.knowledgeBaseArn
this.knowledgeBaseConfiguration = x.knowledgeBaseConfiguration
this.knowledgeBaseId = x.knowledgeBaseId
this.name = x.name
this.roleArn = x.roleArn
this.status = x.status
this.storageConfiguration = x.storageConfiguration
this.updatedAt = x.updatedAt
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBase = KnowledgeBase(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration] inside the given [block]
*/
public fun knowledgeBaseConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration.Builder.() -> kotlin.Unit) {
this.knowledgeBaseConfiguration = aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration] inside the given [block]
*/
public fun storageConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration.Builder.() -> kotlin.Unit) {
this.storageConfiguration = aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration.invoke(block)
}
internal fun correctErrors(): Builder {
if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
if (knowledgeBaseArn == null) knowledgeBaseArn = ""
if (knowledgeBaseId == null) knowledgeBaseId = ""
if (name == null) name = ""
if (roleArn == null) roleArn = ""
if (status == null) status = KnowledgeBaseStatus.SdkUnknown("no value provided")
if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
return this
}
}
}