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

commonMain.aws.sdk.kotlin.services.timestreamwrite.model.DataSourceConfiguration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.timestreamwrite.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Defines configuration details about the data source.
 */
public class DataSourceConfiguration private constructor(builder: Builder) {
    /**
     * A delimited data format where the column separator can be a comma and the record separator is a newline character.
     */
    public val csvConfiguration: aws.sdk.kotlin.services.timestreamwrite.model.CsvConfiguration? = builder.csvConfiguration
    /**
     * This is currently CSV.
     */
    public val dataFormat: aws.sdk.kotlin.services.timestreamwrite.model.BatchLoadDataFormat = requireNotNull(builder.dataFormat) { "A non-null value must be provided for dataFormat" }
    /**
     * Configuration of an S3 location for a file which contains data to load.
     */
    public val dataSourceS3Configuration: aws.sdk.kotlin.services.timestreamwrite.model.DataSourceS3Configuration? = builder.dataSourceS3Configuration

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

    override fun toString(): kotlin.String = buildString {
        append("DataSourceConfiguration(")
        append("csvConfiguration=$csvConfiguration,")
        append("dataFormat=$dataFormat,")
        append("dataSourceS3Configuration=$dataSourceS3Configuration")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = csvConfiguration?.hashCode() ?: 0
        result = 31 * result + (dataFormat.hashCode())
        result = 31 * result + (dataSourceS3Configuration?.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 (csvConfiguration != other.csvConfiguration) return false
        if (dataFormat != other.dataFormat) return false
        if (dataSourceS3Configuration != other.dataSourceS3Configuration) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A delimited data format where the column separator can be a comma and the record separator is a newline character.
         */
        public var csvConfiguration: aws.sdk.kotlin.services.timestreamwrite.model.CsvConfiguration? = null
        /**
         * This is currently CSV.
         */
        public var dataFormat: aws.sdk.kotlin.services.timestreamwrite.model.BatchLoadDataFormat? = null
        /**
         * Configuration of an S3 location for a file which contains data to load.
         */
        public var dataSourceS3Configuration: aws.sdk.kotlin.services.timestreamwrite.model.DataSourceS3Configuration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.timestreamwrite.model.DataSourceConfiguration) : this() {
            this.csvConfiguration = x.csvConfiguration
            this.dataFormat = x.dataFormat
            this.dataSourceS3Configuration = x.dataSourceS3Configuration
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy