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

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

/**
 * Specifies the set of parameters needed to perform aggregation in the aggregate transform.
 */
public class AggregateOperation private constructor(builder: Builder) {
    /**
     * Specifies the aggregation function to apply.
     *
     * Possible aggregation functions include: avg countDistinct, count, first, last, kurtosis, max, min, skewness, stddev_samp, stddev_pop, sum, sumDistinct, var_samp, var_pop
     */
    public val aggFunc: aws.sdk.kotlin.services.glue.model.AggFunction = requireNotNull(builder.aggFunc) { "A non-null value must be provided for aggFunc" }
    /**
     * Specifies the column on the data set on which the aggregation function will be applied.
     */
    public val column: List = requireNotNull(builder.column) { "A non-null value must be provided for column" }

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

    override fun toString(): kotlin.String = buildString {
        append("AggregateOperation(")
        append("aggFunc=$aggFunc,")
        append("column=$column")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = aggFunc.hashCode()
        result = 31 * result + (column.hashCode())
        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 AggregateOperation

        if (aggFunc != other.aggFunc) return false
        if (column != other.column) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifies the aggregation function to apply.
         *
         * Possible aggregation functions include: avg countDistinct, count, first, last, kurtosis, max, min, skewness, stddev_samp, stddev_pop, sum, sumDistinct, var_samp, var_pop
         */
        public var aggFunc: aws.sdk.kotlin.services.glue.model.AggFunction? = null
        /**
         * Specifies the column on the data set on which the aggregation function will be applied.
         */
        public var column: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.AggregateOperation) : this() {
            this.aggFunc = x.aggFunc
            this.column = x.column
        }

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

        internal fun correctErrors(): Builder {
            if (aggFunc == null) aggFunc = AggFunction.SdkUnknown("no value provided")
            if (column == null) column = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy