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

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

There is a newer version: 1.3.35
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

/**
 * Data model for a batch load task.
 */
public class DataModel private constructor(builder: Builder) {
    /**
     * Source to target mappings for dimensions.
     */
    public val dimensionMappings: List = requireNotNull(builder.dimensionMappings) { "A non-null value must be provided for dimensionMappings" }
    /**
     *
     */
    public val measureNameColumn: kotlin.String? = builder.measureNameColumn
    /**
     * Source to target mappings for measures.
     */
    public val mixedMeasureMappings: List? = builder.mixedMeasureMappings
    /**
     * Source to target mappings for multi-measure records.
     */
    public val multiMeasureMappings: aws.sdk.kotlin.services.timestreamwrite.model.MultiMeasureMappings? = builder.multiMeasureMappings
    /**
     * Source column to be mapped to time.
     */
    public val timeColumn: kotlin.String? = builder.timeColumn
    /**
     * The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds, nanoseconds, or other supported values. Default is `MILLISECONDS`.
     */
    public val timeUnit: aws.sdk.kotlin.services.timestreamwrite.model.TimeUnit? = builder.timeUnit

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

    override fun toString(): kotlin.String = buildString {
        append("DataModel(")
        append("dimensionMappings=$dimensionMappings,")
        append("measureNameColumn=$measureNameColumn,")
        append("mixedMeasureMappings=$mixedMeasureMappings,")
        append("multiMeasureMappings=$multiMeasureMappings,")
        append("timeColumn=$timeColumn,")
        append("timeUnit=$timeUnit")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dimensionMappings.hashCode()
        result = 31 * result + (measureNameColumn?.hashCode() ?: 0)
        result = 31 * result + (mixedMeasureMappings?.hashCode() ?: 0)
        result = 31 * result + (multiMeasureMappings?.hashCode() ?: 0)
        result = 31 * result + (timeColumn?.hashCode() ?: 0)
        result = 31 * result + (timeUnit?.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 DataModel

        if (dimensionMappings != other.dimensionMappings) return false
        if (measureNameColumn != other.measureNameColumn) return false
        if (mixedMeasureMappings != other.mixedMeasureMappings) return false
        if (multiMeasureMappings != other.multiMeasureMappings) return false
        if (timeColumn != other.timeColumn) return false
        if (timeUnit != other.timeUnit) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Source to target mappings for dimensions.
         */
        public var dimensionMappings: List? = null
        /**
         *
         */
        public var measureNameColumn: kotlin.String? = null
        /**
         * Source to target mappings for measures.
         */
        public var mixedMeasureMappings: List? = null
        /**
         * Source to target mappings for multi-measure records.
         */
        public var multiMeasureMappings: aws.sdk.kotlin.services.timestreamwrite.model.MultiMeasureMappings? = null
        /**
         * Source column to be mapped to time.
         */
        public var timeColumn: kotlin.String? = null
        /**
         * The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds, nanoseconds, or other supported values. Default is `MILLISECONDS`.
         */
        public var timeUnit: aws.sdk.kotlin.services.timestreamwrite.model.TimeUnit? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.timestreamwrite.model.DataModel) : this() {
            this.dimensionMappings = x.dimensionMappings
            this.measureNameColumn = x.measureNameColumn
            this.mixedMeasureMappings = x.mixedMeasureMappings
            this.multiMeasureMappings = x.multiMeasureMappings
            this.timeColumn = x.timeColumn
            this.timeUnit = x.timeUnit
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy