commonMain.aws.sdk.kotlin.services.timestreaminfluxdb.model.Duration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timestreaminfluxdb-jvm Show documentation
Show all versions of timestreaminfluxdb-jvm Show documentation
The AWS SDK for Kotlin client for Timestream InfluxDB
// 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