commonMain.aws.sdk.kotlin.services.bedrockagent.model.CreateKnowledgeBaseRequest.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
public class CreateKnowledgeBaseRequest private constructor(builder: Builder) {
/**
* A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see [Ensuring idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
*/
public val clientToken: kotlin.String? = builder.clientToken
/**
* A description of the knowledge base.
*/
public val description: kotlin.String? = builder.description
/**
* Contains details about the embeddings model used for the knowledge base.
*/
public val knowledgeBaseConfiguration: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration? = builder.knowledgeBaseConfiguration
/**
* A name for the knowledge base.
*/
public val name: kotlin.String? = builder.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? = builder.roleArn
/**
* Contains details about the configuration of the vector database used for the knowledge base.
*/
public val storageConfiguration: aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration? = builder.storageConfiguration
/**
* Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.
*/
public val tags: Map? = builder.tags
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.CreateKnowledgeBaseRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateKnowledgeBaseRequest(")
append("clientToken=$clientToken,")
append("description=$description,")
append("knowledgeBaseConfiguration=$knowledgeBaseConfiguration,")
append("name=$name,")
append("roleArn=$roleArn,")
append("storageConfiguration=$storageConfiguration,")
append("tags=$tags")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = clientToken?.hashCode() ?: 0
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (knowledgeBaseConfiguration?.hashCode() ?: 0)
result = 31 * result + (name?.hashCode() ?: 0)
result = 31 * result + (roleArn?.hashCode() ?: 0)
result = 31 * result + (storageConfiguration?.hashCode() ?: 0)
result = 31 * result + (tags?.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 CreateKnowledgeBaseRequest
if (clientToken != other.clientToken) return false
if (description != other.description) return false
if (knowledgeBaseConfiguration != other.knowledgeBaseConfiguration) return false
if (name != other.name) return false
if (roleArn != other.roleArn) return false
if (storageConfiguration != other.storageConfiguration) return false
if (tags != other.tags) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.CreateKnowledgeBaseRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see [Ensuring idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
*/
public var clientToken: kotlin.String? = null
/**
* A description of the knowledge base.
*/
public var description: kotlin.String? = null
/**
* Contains details about the embeddings model used for the knowledge base.
*/
public var knowledgeBaseConfiguration: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration? = null
/**
* A name for 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
/**
* Contains details about the configuration of the vector database used for the knowledge base.
*/
public var storageConfiguration: aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration? = null
/**
* Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.
*/
public var tags: Map? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.CreateKnowledgeBaseRequest) : this() {
this.clientToken = x.clientToken
this.description = x.description
this.knowledgeBaseConfiguration = x.knowledgeBaseConfiguration
this.name = x.name
this.roleArn = x.roleArn
this.storageConfiguration = x.storageConfiguration
this.tags = x.tags
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.CreateKnowledgeBaseRequest = CreateKnowledgeBaseRequest(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 {
return this
}
}
}