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

commonMain.aws.sdk.kotlin.services.timestreamwrite.model.CreateTableRequest.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.timestreamwrite.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateTableRequest private constructor(builder: Builder) {
    /**
     * The name of the Timestream database.
     */
    public val databaseName: kotlin.String? = builder.databaseName
    /**
     * Contains properties to set on the table when enabling magnetic store writes.
     */
    public val magneticStoreWriteProperties: aws.sdk.kotlin.services.timestreamwrite.model.MagneticStoreWriteProperties? = builder.magneticStoreWriteProperties
    /**
     * The duration for which your time-series data must be stored in the memory store and the magnetic store.
     */
    public val retentionProperties: aws.sdk.kotlin.services.timestreamwrite.model.RetentionProperties? = builder.retentionProperties
    /**
     * The schema of the table.
     */
    public val schema: aws.sdk.kotlin.services.timestreamwrite.model.Schema? = builder.schema
    /**
     * The name of the Timestream table.
     */
    public val tableName: kotlin.String? = builder.tableName
    /**
     * A list of key-value pairs to label the table.
     */
    public val tags: List? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("CreateTableRequest(")
        append("databaseName=$databaseName,")
        append("magneticStoreWriteProperties=$magneticStoreWriteProperties,")
        append("retentionProperties=$retentionProperties,")
        append("schema=$schema,")
        append("tableName=$tableName,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = databaseName?.hashCode() ?: 0
        result = 31 * result + (magneticStoreWriteProperties?.hashCode() ?: 0)
        result = 31 * result + (retentionProperties?.hashCode() ?: 0)
        result = 31 * result + (schema?.hashCode() ?: 0)
        result = 31 * result + (tableName?.hashCode() ?: 0)
        result = 31 * result + (tags?.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 CreateTableRequest

        if (databaseName != other.databaseName) return false
        if (magneticStoreWriteProperties != other.magneticStoreWriteProperties) return false
        if (retentionProperties != other.retentionProperties) return false
        if (schema != other.schema) return false
        if (tableName != other.tableName) return false
        if (tags != other.tags) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the Timestream database.
         */
        public var databaseName: kotlin.String? = null
        /**
         * Contains properties to set on the table when enabling magnetic store writes.
         */
        public var magneticStoreWriteProperties: aws.sdk.kotlin.services.timestreamwrite.model.MagneticStoreWriteProperties? = null
        /**
         * The duration for which your time-series data must be stored in the memory store and the magnetic store.
         */
        public var retentionProperties: aws.sdk.kotlin.services.timestreamwrite.model.RetentionProperties? = null
        /**
         * The schema of the table.
         */
        public var schema: aws.sdk.kotlin.services.timestreamwrite.model.Schema? = null
        /**
         * The name of the Timestream table.
         */
        public var tableName: kotlin.String? = null
        /**
         * A list of key-value pairs to label the table.
         */
        public var tags: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.timestreamwrite.model.CreateTableRequest) : this() {
            this.databaseName = x.databaseName
            this.magneticStoreWriteProperties = x.magneticStoreWriteProperties
            this.retentionProperties = x.retentionProperties
            this.schema = x.schema
            this.tableName = x.tableName
            this.tags = x.tags
        }

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

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

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy