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

commonMain.aws.sdk.kotlin.services.cleanrooms.model.AggregateColumn.kt Maven / Gradle / Ivy

There is a newer version: 1.3.31
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.cleanrooms.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Column in configured table that can be used in aggregate function in query.
 */
public class AggregateColumn private constructor(builder: Builder) {
    /**
     * Column names in configured table of aggregate columns.
     */
    public val columnNames: List = requireNotNull(builder.columnNames) { "A non-null value must be provided for columnNames" }
    /**
     * Aggregation function that can be applied to aggregate column in query.
     */
    public val function: aws.sdk.kotlin.services.cleanrooms.model.AggregateFunctionName = requireNotNull(builder.function) { "A non-null value must be provided for function" }

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

    override fun toString(): kotlin.String = buildString {
        append("AggregateColumn(")
        append("columnNames=$columnNames,")
        append("function=$function")
        append(")")
    }

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

        if (columnNames != other.columnNames) return false
        if (function != other.function) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Column names in configured table of aggregate columns.
         */
        public var columnNames: List? = null
        /**
         * Aggregation function that can be applied to aggregate column in query.
         */
        public var function: aws.sdk.kotlin.services.cleanrooms.model.AggregateFunctionName? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cleanrooms.model.AggregateColumn) : this() {
            this.columnNames = x.columnNames
            this.function = x.function
        }

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

        internal fun correctErrors(): Builder {
            if (columnNames == null) columnNames = emptyList()
            if (function == null) function = AggregateFunctionName.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy