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

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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



/**
 * Specifies a raw data source location to ingest.
 */
public class DataSourceConfiguration private constructor(builder: Builder) {
    /**
     * Configures an S3 data source location.
     */
    public val s3Configuration: aws.sdk.kotlin.services.bedrockagent.model.S3DataSourceConfiguration? = builder.s3Configuration
    /**
     * The type of the data source location.
     */
    public val type: aws.sdk.kotlin.services.bedrockagent.model.DataSourceType = 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.DataSourceConfiguration = Builder().apply(block).build()
    }

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

    override fun hashCode(): kotlin.Int {
        var result = s3Configuration?.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 DataSourceConfiguration

        if (s3Configuration != other.s3Configuration) return false
        if (type != other.type) return false

        return true
    }

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

    public class Builder {
        /**
         * Configures an S3 data source location.
         */
        public var s3Configuration: aws.sdk.kotlin.services.bedrockagent.model.S3DataSourceConfiguration? = null
        /**
         * The type of the data source location.
         */
        public var type: aws.sdk.kotlin.services.bedrockagent.model.DataSourceType? = null

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

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

        /**
         * 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)
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy