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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.CreateDataSourceRequest.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

public class CreateDataSourceRequest 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
    /**
     * The data deletion policy for the data source.
     *
     * You can set the data deletion policy to:
     * + DELETE: Deletes all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the **vector store itself is not deleted**, only the data. This flag is ignored if an Amazon Web Services account is deleted.
     * + RETAIN: Retains all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the **vector store itself is not deleted** if you delete a knowledge base or data source resource.
     */
    public val dataDeletionPolicy: aws.sdk.kotlin.services.bedrockagent.model.DataDeletionPolicy? = builder.dataDeletionPolicy
    /**
     * The connection configuration for the data source.
     */
    public val dataSourceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.DataSourceConfiguration? = builder.dataSourceConfiguration
    /**
     * A description of the data source.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The unique identifier of the knowledge base to which to add the data source.
     */
    public val knowledgeBaseId: kotlin.String? = builder.knowledgeBaseId
    /**
     * The name of the data source.
     */
    public val name: kotlin.String? = builder.name
    /**
     * Contains details about the server-side encryption for the data source.
     */
    public val serverSideEncryptionConfiguration: aws.sdk.kotlin.services.bedrockagent.model.ServerSideEncryptionConfiguration? = builder.serverSideEncryptionConfiguration
    /**
     * Contains details about how to ingest the documents in the data source.
     */
    public val vectorIngestionConfiguration: aws.sdk.kotlin.services.bedrockagent.model.VectorIngestionConfiguration? = builder.vectorIngestionConfiguration

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

    override fun toString(): kotlin.String = buildString {
        append("CreateDataSourceRequest(")
        append("clientToken=$clientToken,")
        append("dataDeletionPolicy=$dataDeletionPolicy,")
        append("dataSourceConfiguration=$dataSourceConfiguration,")
        append("description=$description,")
        append("knowledgeBaseId=$knowledgeBaseId,")
        append("name=$name,")
        append("serverSideEncryptionConfiguration=$serverSideEncryptionConfiguration,")
        append("vectorIngestionConfiguration=$vectorIngestionConfiguration")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = clientToken?.hashCode() ?: 0
        result = 31 * result + (dataDeletionPolicy?.hashCode() ?: 0)
        result = 31 * result + (dataSourceConfiguration?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (knowledgeBaseId?.hashCode() ?: 0)
        result = 31 * result + (name?.hashCode() ?: 0)
        result = 31 * result + (serverSideEncryptionConfiguration?.hashCode() ?: 0)
        result = 31 * result + (vectorIngestionConfiguration?.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 CreateDataSourceRequest

        if (clientToken != other.clientToken) return false
        if (dataDeletionPolicy != other.dataDeletionPolicy) return false
        if (dataSourceConfiguration != other.dataSourceConfiguration) return false
        if (description != other.description) return false
        if (knowledgeBaseId != other.knowledgeBaseId) return false
        if (name != other.name) return false
        if (serverSideEncryptionConfiguration != other.serverSideEncryptionConfiguration) return false
        if (vectorIngestionConfiguration != other.vectorIngestionConfiguration) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.CreateDataSourceRequest = 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
        /**
         * The data deletion policy for the data source.
         *
         * You can set the data deletion policy to:
         * + DELETE: Deletes all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the **vector store itself is not deleted**, only the data. This flag is ignored if an Amazon Web Services account is deleted.
         * + RETAIN: Retains all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the **vector store itself is not deleted** if you delete a knowledge base or data source resource.
         */
        public var dataDeletionPolicy: aws.sdk.kotlin.services.bedrockagent.model.DataDeletionPolicy? = null
        /**
         * The connection configuration for the data source.
         */
        public var dataSourceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.DataSourceConfiguration? = null
        /**
         * A description of the data source.
         */
        public var description: kotlin.String? = null
        /**
         * The unique identifier of the knowledge base to which to add the data source.
         */
        public var knowledgeBaseId: kotlin.String? = null
        /**
         * The name of the data source.
         */
        public var name: kotlin.String? = null
        /**
         * Contains details about the server-side encryption for the data source.
         */
        public var serverSideEncryptionConfiguration: aws.sdk.kotlin.services.bedrockagent.model.ServerSideEncryptionConfiguration? = null
        /**
         * Contains details about how to ingest the documents in the data source.
         */
        public var vectorIngestionConfiguration: aws.sdk.kotlin.services.bedrockagent.model.VectorIngestionConfiguration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.CreateDataSourceRequest) : this() {
            this.clientToken = x.clientToken
            this.dataDeletionPolicy = x.dataDeletionPolicy
            this.dataSourceConfiguration = x.dataSourceConfiguration
            this.description = x.description
            this.knowledgeBaseId = x.knowledgeBaseId
            this.name = x.name
            this.serverSideEncryptionConfiguration = x.serverSideEncryptionConfiguration
            this.vectorIngestionConfiguration = x.vectorIngestionConfiguration
        }

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

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

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy