commonMain.aws.sdk.kotlin.services.backup.model.CalculatedLifecycle.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.backup.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* Contains `DeleteAt` and `MoveToColdStorageAt` timestamps, which are used to specify a lifecycle for a recovery point.
*
* The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. Backup transitions and expires backups automatically according to the lifecycle that you define.
*
* Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “retention” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
*
* Resource types that can transition to cold storage are listed in the [Feature availability by resource](https://docs.aws.amazon.com/aws-backup/latest/devguide/backup-feature-availability.html#features-by-resource) table. Backup ignores this expression for other resource types.
*/
public class CalculatedLifecycle private constructor(builder: Builder) {
/**
* A timestamp that specifies when to delete a recovery point.
*/
public val deleteAt: aws.smithy.kotlin.runtime.time.Instant? = builder.deleteAt
/**
* A timestamp that specifies when to transition a recovery point to cold storage.
*/
public val moveToColdStorageAt: aws.smithy.kotlin.runtime.time.Instant? = builder.moveToColdStorageAt
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.backup.model.CalculatedLifecycle = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CalculatedLifecycle(")
append("deleteAt=$deleteAt,")
append("moveToColdStorageAt=$moveToColdStorageAt")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = deleteAt?.hashCode() ?: 0
result = 31 * result + (moveToColdStorageAt?.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 CalculatedLifecycle
if (deleteAt != other.deleteAt) return false
if (moveToColdStorageAt != other.moveToColdStorageAt) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.backup.model.CalculatedLifecycle = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A timestamp that specifies when to delete a recovery point.
*/
public var deleteAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* A timestamp that specifies when to transition a recovery point to cold storage.
*/
public var moveToColdStorageAt: aws.smithy.kotlin.runtime.time.Instant? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.backup.model.CalculatedLifecycle) : this() {
this.deleteAt = x.deleteAt
this.moveToColdStorageAt = x.moveToColdStorageAt
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.backup.model.CalculatedLifecycle = CalculatedLifecycle(this)
internal fun correctErrors(): Builder {
return this
}
}
}