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

commonMain.aws.sdk.kotlin.services.dynamodb.model.TimeToLiveSpecification.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.dynamodb.model



/**
 * Represents the settings used to enable or disable Time to Live (TTL) for the specified table.
 */
public class TimeToLiveSpecification private constructor(builder: Builder) {
    /**
     * The name of the TTL attribute used to store the expiration time for items in the table.
     */
    public val attributeName: kotlin.String = requireNotNull(builder.attributeName) { "A non-null value must be provided for attributeName" }
    /**
     * Indicates whether TTL is to be enabled (true) or disabled (false) on the table.
     */
    public val enabled: kotlin.Boolean = requireNotNull(builder.enabled) { "A non-null value must be provided for enabled" }

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

    override fun toString(): kotlin.String = buildString {
        append("TimeToLiveSpecification(")
        append("attributeName=$attributeName,")
        append("enabled=$enabled")
        append(")")
    }

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

        if (attributeName != other.attributeName) return false
        if (enabled != other.enabled) return false

        return true
    }

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

    public class Builder {
        /**
         * The name of the TTL attribute used to store the expiration time for items in the table.
         */
        public var attributeName: kotlin.String? = null
        /**
         * Indicates whether TTL is to be enabled (true) or disabled (false) on the table.
         */
        public var enabled: kotlin.Boolean? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dynamodb.model.TimeToLiveSpecification) : this() {
            this.attributeName = x.attributeName
            this.enabled = x.enabled
        }

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

        internal fun correctErrors(): Builder {
            if (attributeName == null) attributeName = ""
            if (enabled == null) enabled = false
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy