All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.bedrockagent.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains the storage configuration of the knowledge base.
 */
public class StorageConfiguration private constructor(builder: Builder) {
    /**
     * Contains the storage configuration of the knowledge base in MongoDB Atlas.
     */
    public val mongoDbAtlasConfiguration: aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration? = builder.mongoDbAtlasConfiguration
    /**
     * Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.
     */
    public val opensearchServerlessConfiguration: aws.sdk.kotlin.services.bedrockagent.model.OpenSearchServerlessConfiguration? = builder.opensearchServerlessConfiguration
    /**
     * Contains the storage configuration of the knowledge base in Pinecone.
     */
    public val pineconeConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PineconeConfiguration? = builder.pineconeConfiguration
    /**
     * 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 val rdsConfiguration: aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration? = builder.rdsConfiguration
    /**
     * Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.
     */
    public val redisEnterpriseCloudConfiguration: aws.sdk.kotlin.services.bedrockagent.model.RedisEnterpriseCloudConfiguration? = builder.redisEnterpriseCloudConfiguration
    /**
     * The vector store service in which the knowledge base is stored.
     */
    public val type: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseStorageType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("StorageConfiguration(")
        append("mongoDbAtlasConfiguration=$mongoDbAtlasConfiguration,")
        append("opensearchServerlessConfiguration=$opensearchServerlessConfiguration,")
        append("pineconeConfiguration=$pineconeConfiguration,")
        append("rdsConfiguration=$rdsConfiguration,")
        append("redisEnterpriseCloudConfiguration=$redisEnterpriseCloudConfiguration,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = mongoDbAtlasConfiguration?.hashCode() ?: 0
        result = 31 * result + (opensearchServerlessConfiguration?.hashCode() ?: 0)
        result = 31 * result + (pineconeConfiguration?.hashCode() ?: 0)
        result = 31 * result + (rdsConfiguration?.hashCode() ?: 0)
        result = 31 * result + (redisEnterpriseCloudConfiguration?.hashCode() ?: 0)
        result = 31 * result + (type.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 StorageConfiguration

        if (mongoDbAtlasConfiguration != other.mongoDbAtlasConfiguration) return false
        if (opensearchServerlessConfiguration != other.opensearchServerlessConfiguration) return false
        if (pineconeConfiguration != other.pineconeConfiguration) return false
        if (rdsConfiguration != other.rdsConfiguration) return false
        if (redisEnterpriseCloudConfiguration != other.redisEnterpriseCloudConfiguration) return false
        if (type != other.type) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Contains the storage configuration of the knowledge base in MongoDB Atlas.
         */
        public var mongoDbAtlasConfiguration: aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration? = null
        /**
         * Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.
         */
        public var opensearchServerlessConfiguration: aws.sdk.kotlin.services.bedrockagent.model.OpenSearchServerlessConfiguration? = null
        /**
         * Contains the storage configuration of the knowledge base in Pinecone.
         */
        public var pineconeConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PineconeConfiguration? = null
        /**
         * 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 var rdsConfiguration: aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration? = null
        /**
         * Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.
         */
        public var redisEnterpriseCloudConfiguration: aws.sdk.kotlin.services.bedrockagent.model.RedisEnterpriseCloudConfiguration? = null
        /**
         * The vector store service in which the knowledge base is stored.
         */
        public var type: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseStorageType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration) : this() {
            this.mongoDbAtlasConfiguration = x.mongoDbAtlasConfiguration
            this.opensearchServerlessConfiguration = x.opensearchServerlessConfiguration
            this.pineconeConfiguration = x.pineconeConfiguration
            this.rdsConfiguration = x.rdsConfiguration
            this.redisEnterpriseCloudConfiguration = x.redisEnterpriseCloudConfiguration
            this.type = x.type
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.StorageConfiguration = StorageConfiguration(this)

        /**
         * construct an [aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration] inside the given [block]
         */
        public fun mongoDbAtlasConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration.Builder.() -> kotlin.Unit) {
            this.mongoDbAtlasConfiguration = aws.sdk.kotlin.services.bedrockagent.model.MongoDbAtlasConfiguration.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.bedrockagent.model.OpenSearchServerlessConfiguration] inside the given [block]
         */
        public fun opensearchServerlessConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.OpenSearchServerlessConfiguration.Builder.() -> kotlin.Unit) {
            this.opensearchServerlessConfiguration = aws.sdk.kotlin.services.bedrockagent.model.OpenSearchServerlessConfiguration.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.bedrockagent.model.PineconeConfiguration] inside the given [block]
         */
        public fun pineconeConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.PineconeConfiguration.Builder.() -> kotlin.Unit) {
            this.pineconeConfiguration = aws.sdk.kotlin.services.bedrockagent.model.PineconeConfiguration.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration] inside the given [block]
         */
        public fun rdsConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration.Builder.() -> kotlin.Unit) {
            this.rdsConfiguration = aws.sdk.kotlin.services.bedrockagent.model.RdsConfiguration.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.bedrockagent.model.RedisEnterpriseCloudConfiguration] inside the given [block]
         */
        public fun redisEnterpriseCloudConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.RedisEnterpriseCloudConfiguration.Builder.() -> kotlin.Unit) {
            this.redisEnterpriseCloudConfiguration = aws.sdk.kotlin.services.bedrockagent.model.RedisEnterpriseCloudConfiguration.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (type == null) type = KnowledgeBaseStorageType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy