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

commonMain.aws.sdk.kotlin.services.timestreaminfluxdb.model.Duration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.timestreaminfluxdb.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Duration for InfluxDB parameters in Timestream for InfluxDB.
 */
public class Duration private constructor(builder: Builder) {
    /**
     * The type of duration for InfluxDB parameters.
     */
    public val durationType: aws.sdk.kotlin.services.timestreaminfluxdb.model.DurationType = requireNotNull(builder.durationType) { "A non-null value must be provided for durationType" }
    /**
     * The value of duration for InfluxDB parameters.
     */
    public val value: kotlin.Long = requireNotNull(builder.value) { "A non-null value must be provided for value" }

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

    override fun toString(): kotlin.String = buildString {
        append("Duration(")
        append("durationType=$durationType,")
        append("value=$value")
        append(")")
    }

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

        if (durationType != other.durationType) return false
        if (value != other.value) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The type of duration for InfluxDB parameters.
         */
        public var durationType: aws.sdk.kotlin.services.timestreaminfluxdb.model.DurationType? = null
        /**
         * The value of duration for InfluxDB parameters.
         */
        public var value: kotlin.Long? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.timestreaminfluxdb.model.Duration) : this() {
            this.durationType = x.durationType
            this.value = x.value
        }

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

        internal fun correctErrors(): Builder {
            if (durationType == null) durationType = DurationType.SdkUnknown("no value provided")
            if (value == null) value = 0L
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy