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

commonMain.aws.sdk.kotlin.services.glue.model.ColumnStatistics.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.glue.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

/**
 * Represents the generated column-level statistics for a table or partition.
 */
public class ColumnStatistics private constructor(builder: Builder) {
    /**
     * The timestamp of when column statistics were generated.
     */
    public val analyzedTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.analyzedTime) { "A non-null value must be provided for analyzedTime" }
    /**
     * Name of column which statistics belong to.
     */
    public val columnName: kotlin.String = requireNotNull(builder.columnName) { "A non-null value must be provided for columnName" }
    /**
     * The data type of the column.
     */
    public val columnType: kotlin.String = requireNotNull(builder.columnType) { "A non-null value must be provided for columnType" }
    /**
     * A `ColumnStatisticData` object that contains the statistics data values.
     */
    public val statisticsData: aws.sdk.kotlin.services.glue.model.ColumnStatisticsData? = builder.statisticsData

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

    override fun toString(): kotlin.String = buildString {
        append("ColumnStatistics(")
        append("analyzedTime=$analyzedTime,")
        append("columnName=$columnName,")
        append("columnType=$columnType,")
        append("statisticsData=$statisticsData")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = analyzedTime.hashCode()
        result = 31 * result + (columnName.hashCode())
        result = 31 * result + (columnType.hashCode())
        result = 31 * result + (statisticsData?.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 ColumnStatistics

        if (analyzedTime != other.analyzedTime) return false
        if (columnName != other.columnName) return false
        if (columnType != other.columnType) return false
        if (statisticsData != other.statisticsData) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The timestamp of when column statistics were generated.
         */
        public var analyzedTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Name of column which statistics belong to.
         */
        public var columnName: kotlin.String? = null
        /**
         * The data type of the column.
         */
        public var columnType: kotlin.String? = null
        /**
         * A `ColumnStatisticData` object that contains the statistics data values.
         */
        public var statisticsData: aws.sdk.kotlin.services.glue.model.ColumnStatisticsData? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.ColumnStatistics) : this() {
            this.analyzedTime = x.analyzedTime
            this.columnName = x.columnName
            this.columnType = x.columnType
            this.statisticsData = x.statisticsData
        }

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

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

        internal fun correctErrors(): Builder {
            if (analyzedTime == null) analyzedTime = Instant.fromEpochSeconds(0)
            if (columnName == null) columnName = ""
            if (columnType == null) columnType = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy