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

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

/**
 * The connection configuration for the data source.
 */
public class DataSourceConfiguration private constructor(builder: Builder) {
    /**
     * The configuration information to connect to Confluence as your data source.
     *
     * Confluence data source connector is in preview release and is subject to change.
     */
    public val confluenceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.ConfluenceDataSourceConfiguration? = builder.confluenceConfiguration
    /**
     * The configuration information to connect to Amazon S3 as your data source.
     */
    public val s3Configuration: aws.sdk.kotlin.services.bedrockagent.model.S3DataSourceConfiguration? = builder.s3Configuration
    /**
     * The configuration information to connect to Salesforce as your data source.
     *
     * Salesforce data source connector is in preview release and is subject to change.
     */
    public val salesforceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.SalesforceDataSourceConfiguration? = builder.salesforceConfiguration
    /**
     * The configuration information to connect to SharePoint as your data source.
     *
     * SharePoint data source connector is in preview release and is subject to change.
     */
    public val sharePointConfiguration: aws.sdk.kotlin.services.bedrockagent.model.SharePointDataSourceConfiguration? = builder.sharePointConfiguration
    /**
     * The type of data source.
     */
    public val type: aws.sdk.kotlin.services.bedrockagent.model.DataSourceType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
    /**
     * The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.
     *
     * Crawling web URLs as your data source is in preview release and is subject to change.
     */
    public val webConfiguration: aws.sdk.kotlin.services.bedrockagent.model.WebDataSourceConfiguration? = builder.webConfiguration

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

    override fun toString(): kotlin.String = buildString {
        append("DataSourceConfiguration(")
        append("confluenceConfiguration=$confluenceConfiguration,")
        append("s3Configuration=$s3Configuration,")
        append("salesforceConfiguration=$salesforceConfiguration,")
        append("sharePointConfiguration=$sharePointConfiguration,")
        append("type=$type,")
        append("webConfiguration=$webConfiguration")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = confluenceConfiguration?.hashCode() ?: 0
        result = 31 * result + (s3Configuration?.hashCode() ?: 0)
        result = 31 * result + (salesforceConfiguration?.hashCode() ?: 0)
        result = 31 * result + (sharePointConfiguration?.hashCode() ?: 0)
        result = 31 * result + (type.hashCode())
        result = 31 * result + (webConfiguration?.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 DataSourceConfiguration

        if (confluenceConfiguration != other.confluenceConfiguration) return false
        if (s3Configuration != other.s3Configuration) return false
        if (salesforceConfiguration != other.salesforceConfiguration) return false
        if (sharePointConfiguration != other.sharePointConfiguration) return false
        if (type != other.type) return false
        if (webConfiguration != other.webConfiguration) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The configuration information to connect to Confluence as your data source.
         *
         * Confluence data source connector is in preview release and is subject to change.
         */
        public var confluenceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.ConfluenceDataSourceConfiguration? = null
        /**
         * The configuration information to connect to Amazon S3 as your data source.
         */
        public var s3Configuration: aws.sdk.kotlin.services.bedrockagent.model.S3DataSourceConfiguration? = null
        /**
         * The configuration information to connect to Salesforce as your data source.
         *
         * Salesforce data source connector is in preview release and is subject to change.
         */
        public var salesforceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.SalesforceDataSourceConfiguration? = null
        /**
         * The configuration information to connect to SharePoint as your data source.
         *
         * SharePoint data source connector is in preview release and is subject to change.
         */
        public var sharePointConfiguration: aws.sdk.kotlin.services.bedrockagent.model.SharePointDataSourceConfiguration? = null
        /**
         * The type of data source.
         */
        public var type: aws.sdk.kotlin.services.bedrockagent.model.DataSourceType? = null
        /**
         * The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.
         *
         * Crawling web URLs as your data source is in preview release and is subject to change.
         */
        public var webConfiguration: aws.sdk.kotlin.services.bedrockagent.model.WebDataSourceConfiguration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.DataSourceConfiguration) : this() {
            this.confluenceConfiguration = x.confluenceConfiguration
            this.s3Configuration = x.s3Configuration
            this.salesforceConfiguration = x.salesforceConfiguration
            this.sharePointConfiguration = x.sharePointConfiguration
            this.type = x.type
            this.webConfiguration = x.webConfiguration
        }

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy