commonMain.aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see [Create a vector index in Amazon RDS](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-rds.html).
*/
public class RdsConfiguration private constructor(builder: Builder) {
/**
* The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.
*/
public val credentialsSecretArn: kotlin.String = requireNotNull(builder.credentialsSecretArn) { "A non-null value must be provided for credentialsSecretArn" }
/**
* The name of your Amazon RDS database.
*/
public val databaseName: kotlin.String = requireNotNull(builder.databaseName) { "A non-null value must be provided for databaseName" }
/**
* Contains the names of the fields to which to map information about the vector store.
*/
public val fieldMapping: aws.sdk.kotlin.services.bedrockagent.model.RdsFieldMapping? = builder.fieldMapping
/**
* The Amazon Resource Name (ARN) of the vector store.
*/
public val resourceArn: kotlin.String = requireNotNull(builder.resourceArn) { "A non-null value must be provided for resourceArn" }
/**
* The name of the table in the database.
*/
public val tableName: kotlin.String = requireNotNull(builder.tableName) { "A non-null value must be provided for tableName" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RdsConfiguration(")
append("credentialsSecretArn=$credentialsSecretArn,")
append("databaseName=$databaseName,")
append("fieldMapping=$fieldMapping,")
append("resourceArn=$resourceArn,")
append("tableName=$tableName")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = credentialsSecretArn.hashCode()
result = 31 * result + (databaseName.hashCode())
result = 31 * result + (fieldMapping?.hashCode() ?: 0)
result = 31 * result + (resourceArn.hashCode())
result = 31 * result + (tableName.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 RdsConfiguration
if (credentialsSecretArn != other.credentialsSecretArn) return false
if (databaseName != other.databaseName) return false
if (fieldMapping != other.fieldMapping) return false
if (resourceArn != other.resourceArn) return false
if (tableName != other.tableName) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.
*/
public var credentialsSecretArn: kotlin.String? = null
/**
* The name of your Amazon RDS database.
*/
public var databaseName: kotlin.String? = null
/**
* Contains the names of the fields to which to map information about the vector store.
*/
public var fieldMapping: aws.sdk.kotlin.services.bedrockagent.model.RdsFieldMapping? = null
/**
* The Amazon Resource Name (ARN) of the vector store.
*/
public var resourceArn: kotlin.String? = null
/**
* The name of the table in the database.
*/
public var tableName: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration) : this() {
this.credentialsSecretArn = x.credentialsSecretArn
this.databaseName = x.databaseName
this.fieldMapping = x.fieldMapping
this.resourceArn = x.resourceArn
this.tableName = x.tableName
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration = RdsConfiguration(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.RdsFieldMapping] inside the given [block]
*/
public fun fieldMapping(block: aws.sdk.kotlin.services.bedrockagent.model.RdsFieldMapping.Builder.() -> kotlin.Unit) {
this.fieldMapping = aws.sdk.kotlin.services.bedrockagent.model.RdsFieldMapping.invoke(block)
}
internal fun correctErrors(): Builder {
if (credentialsSecretArn == null) credentialsSecretArn = ""
if (databaseName == null) databaseName = ""
if (resourceArn == null) resourceArn = ""
if (tableName == null) tableName = ""
return this
}
}
}