commonMain.aws.sdk.kotlin.services.timestreamwrite.model.RetentionProperties.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timestreamwrite-jvm Show documentation
Show all versions of timestreamwrite-jvm Show documentation
The AWS SDK for Kotlin client for Timestream Write
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.timestreamwrite.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Retention properties contain the duration for which your time-series data must be stored in the magnetic store and the memory store.
*/
public class RetentionProperties private constructor(builder: Builder) {
/**
* The duration for which data must be stored in the magnetic store.
*/
public val magneticStoreRetentionPeriodInDays: kotlin.Long = requireNotNull(builder.magneticStoreRetentionPeriodInDays) { "A non-null value must be provided for magneticStoreRetentionPeriodInDays" }
/**
* The duration for which data must be stored in the memory store.
*/
public val memoryStoreRetentionPeriodInHours: kotlin.Long = requireNotNull(builder.memoryStoreRetentionPeriodInHours) { "A non-null value must be provided for memoryStoreRetentionPeriodInHours" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.timestreamwrite.model.RetentionProperties = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RetentionProperties(")
append("magneticStoreRetentionPeriodInDays=$magneticStoreRetentionPeriodInDays,")
append("memoryStoreRetentionPeriodInHours=$memoryStoreRetentionPeriodInHours")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = magneticStoreRetentionPeriodInDays.hashCode()
result = 31 * result + (memoryStoreRetentionPeriodInHours.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 RetentionProperties
if (magneticStoreRetentionPeriodInDays != other.magneticStoreRetentionPeriodInDays) return false
if (memoryStoreRetentionPeriodInHours != other.memoryStoreRetentionPeriodInHours) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.timestreamwrite.model.RetentionProperties = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The duration for which data must be stored in the magnetic store.
*/
public var magneticStoreRetentionPeriodInDays: kotlin.Long? = null
/**
* The duration for which data must be stored in the memory store.
*/
public var memoryStoreRetentionPeriodInHours: kotlin.Long? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.timestreamwrite.model.RetentionProperties) : this() {
this.magneticStoreRetentionPeriodInDays = x.magneticStoreRetentionPeriodInDays
this.memoryStoreRetentionPeriodInHours = x.memoryStoreRetentionPeriodInHours
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.timestreamwrite.model.RetentionProperties = RetentionProperties(this)
internal fun correctErrors(): Builder {
if (magneticStoreRetentionPeriodInDays == null) magneticStoreRetentionPeriodInDays = 0L
if (memoryStoreRetentionPeriodInHours == null) memoryStoreRetentionPeriodInHours = 0L
return this
}
}
}