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

commonMain.aws.sdk.kotlin.services.kinesisanalytics.model.SourceSchema.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kinesisanalytics.model



/**
 * Describes the format of the data in the streaming source, and how each data element maps to corresponding columns created in the in-application stream.
 */
public class SourceSchema private constructor(builder: Builder) {
    /**
     * A list of `RecordColumn` objects.
     */
    public val recordColumns: List = requireNotNull(builder.recordColumns) { "A non-null value must be provided for recordColumns" }
    /**
     * Specifies the encoding of the records in the streaming source. For example, UTF-8.
     */
    public val recordEncoding: kotlin.String? = builder.recordEncoding
    /**
     * Specifies the format of the records on the streaming source.
     */
    public val recordFormat: aws.sdk.kotlin.services.kinesisanalytics.model.RecordFormat? = builder.recordFormat

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

    override fun toString(): kotlin.String = buildString {
        append("SourceSchema(")
        append("recordColumns=$recordColumns,")
        append("recordEncoding=$recordEncoding,")
        append("recordFormat=$recordFormat")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = recordColumns.hashCode()
        result = 31 * result + (recordEncoding?.hashCode() ?: 0)
        result = 31 * result + (recordFormat?.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 SourceSchema

        if (recordColumns != other.recordColumns) return false
        if (recordEncoding != other.recordEncoding) return false
        if (recordFormat != other.recordFormat) return false

        return true
    }

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

    public class Builder {
        /**
         * A list of `RecordColumn` objects.
         */
        public var recordColumns: List? = null
        /**
         * Specifies the encoding of the records in the streaming source. For example, UTF-8.
         */
        public var recordEncoding: kotlin.String? = null
        /**
         * Specifies the format of the records on the streaming source.
         */
        public var recordFormat: aws.sdk.kotlin.services.kinesisanalytics.model.RecordFormat? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.kinesisanalytics.model.SourceSchema) : this() {
            this.recordColumns = x.recordColumns
            this.recordEncoding = x.recordEncoding
            this.recordFormat = x.recordFormat
        }

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

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

        internal fun correctErrors(): Builder {
            if (recordColumns == null) recordColumns = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy