commonMain.aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration.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 MongoDB Atlas.
*/
public class MongoDbAtlasConfiguration private constructor(builder: Builder) {
/**
* The collection name of the knowledge base in MongoDB Atlas.
*/
public val collectionName: kotlin.String = requireNotNull(builder.collectionName) { "A non-null value must be provided for collectionName" }
/**
* The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.
*/
public val credentialsSecretArn: kotlin.String = requireNotNull(builder.credentialsSecretArn) { "A non-null value must be provided for credentialsSecretArn" }
/**
* The database name in your MongoDB Atlas cluster for your knowledge base.
*/
public val databaseName: kotlin.String = requireNotNull(builder.databaseName) { "A non-null value must be provided for databaseName" }
/**
* The endpoint URL of your MongoDB Atlas cluster for your knowledge base.
*/
public val endpoint: kotlin.String = requireNotNull(builder.endpoint) { "A non-null value must be provided for endpoint" }
/**
* The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.
*/
public val endpointServiceName: kotlin.String? = builder.endpointServiceName
/**
* Contains the names of the fields to which to map information about the vector store.
*/
public val fieldMapping: aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasFieldMapping? = builder.fieldMapping
/**
* The name of the MongoDB Atlas vector search index.
*/
public val vectorIndexName: kotlin.String = requireNotNull(builder.vectorIndexName) { "A non-null value must be provided for vectorIndexName" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("MongoDbAtlasConfiguration(")
append("collectionName=$collectionName,")
append("credentialsSecretArn=$credentialsSecretArn,")
append("databaseName=$databaseName,")
append("endpoint=$endpoint,")
append("endpointServiceName=$endpointServiceName,")
append("fieldMapping=$fieldMapping,")
append("vectorIndexName=$vectorIndexName")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = collectionName.hashCode()
result = 31 * result + (credentialsSecretArn.hashCode())
result = 31 * result + (databaseName.hashCode())
result = 31 * result + (endpoint.hashCode())
result = 31 * result + (endpointServiceName?.hashCode() ?: 0)
result = 31 * result + (fieldMapping?.hashCode() ?: 0)
result = 31 * result + (vectorIndexName.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 MongoDbAtlasConfiguration
if (collectionName != other.collectionName) return false
if (credentialsSecretArn != other.credentialsSecretArn) return false
if (databaseName != other.databaseName) return false
if (endpoint != other.endpoint) return false
if (endpointServiceName != other.endpointServiceName) return false
if (fieldMapping != other.fieldMapping) return false
if (vectorIndexName != other.vectorIndexName) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The collection name of the knowledge base in MongoDB Atlas.
*/
public var collectionName: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.
*/
public var credentialsSecretArn: kotlin.String? = null
/**
* The database name in your MongoDB Atlas cluster for your knowledge base.
*/
public var databaseName: kotlin.String? = null
/**
* The endpoint URL of your MongoDB Atlas cluster for your knowledge base.
*/
public var endpoint: kotlin.String? = null
/**
* The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.
*/
public var endpointServiceName: 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.MongoDbAtlasFieldMapping? = null
/**
* The name of the MongoDB Atlas vector search index.
*/
public var vectorIndexName: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration) : this() {
this.collectionName = x.collectionName
this.credentialsSecretArn = x.credentialsSecretArn
this.databaseName = x.databaseName
this.endpoint = x.endpoint
this.endpointServiceName = x.endpointServiceName
this.fieldMapping = x.fieldMapping
this.vectorIndexName = x.vectorIndexName
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration = MongoDbAtlasConfiguration(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasFieldMapping] inside the given [block]
*/
public fun fieldMapping(block: aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasFieldMapping.Builder.() -> kotlin.Unit) {
this.fieldMapping = aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasFieldMapping.invoke(block)
}
internal fun correctErrors(): Builder {
if (collectionName == null) collectionName = ""
if (credentialsSecretArn == null) credentialsSecretArn = ""
if (databaseName == null) databaseName = ""
if (endpoint == null) endpoint = ""
if (vectorIndexName == null) vectorIndexName = ""
return this
}
}
}