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

commonMain.aws.sdk.kotlin.services.glue.model.DirectKafkaSource.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Specifies an Apache Kafka data store.
 */
public class DirectKafkaSource private constructor(builder: Builder) {
    /**
     * Specifies options related to data preview for viewing a sample of your data.
     */
    public val dataPreviewOptions: aws.sdk.kotlin.services.glue.model.StreamingDataPreviewOptions? = builder.dataPreviewOptions
    /**
     * Whether to automatically determine the schema from the incoming data.
     */
    public val detectSchema: kotlin.Boolean? = builder.detectSchema
    /**
     * The name of the data store.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * Specifies the streaming options.
     */
    public val streamingOptions: aws.sdk.kotlin.services.glue.model.KafkaStreamingSourceOptions? = builder.streamingOptions
    /**
     * The amount of time to spend processing each micro batch.
     */
    public val windowSize: kotlin.Int? = builder.windowSize

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

    override fun toString(): kotlin.String = buildString {
        append("DirectKafkaSource(")
        append("dataPreviewOptions=$dataPreviewOptions,")
        append("detectSchema=$detectSchema,")
        append("name=$name,")
        append("streamingOptions=$streamingOptions,")
        append("windowSize=$windowSize")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dataPreviewOptions?.hashCode() ?: 0
        result = 31 * result + (detectSchema?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (streamingOptions?.hashCode() ?: 0)
        result = 31 * result + (windowSize ?: 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 DirectKafkaSource

        if (dataPreviewOptions != other.dataPreviewOptions) return false
        if (detectSchema != other.detectSchema) return false
        if (name != other.name) return false
        if (streamingOptions != other.streamingOptions) return false
        if (windowSize != other.windowSize) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifies options related to data preview for viewing a sample of your data.
         */
        public var dataPreviewOptions: aws.sdk.kotlin.services.glue.model.StreamingDataPreviewOptions? = null
        /**
         * Whether to automatically determine the schema from the incoming data.
         */
        public var detectSchema: kotlin.Boolean? = null
        /**
         * The name of the data store.
         */
        public var name: kotlin.String? = null
        /**
         * Specifies the streaming options.
         */
        public var streamingOptions: aws.sdk.kotlin.services.glue.model.KafkaStreamingSourceOptions? = null
        /**
         * The amount of time to spend processing each micro batch.
         */
        public var windowSize: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.DirectKafkaSource) : this() {
            this.dataPreviewOptions = x.dataPreviewOptions
            this.detectSchema = x.detectSchema
            this.name = x.name
            this.streamingOptions = x.streamingOptions
            this.windowSize = x.windowSize
        }

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

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

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy