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

commonMain.aws.sdk.kotlin.services.s3control.model.LifecycleExpiration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.s3control.model

import aws.smithy.kotlin.runtime.time.Instant

/**
 * The container of the Outposts bucket lifecycle expiration.
 */
public class LifecycleExpiration private constructor(builder: Builder) {
    /**
     * Indicates at what date the object is to be deleted. Should be in GMT ISO 8601 format.
     */
    public val date: aws.smithy.kotlin.runtime.time.Instant? = builder.date
    /**
     * Indicates the lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
     */
    public val days: kotlin.Int = builder.days
    /**
     * Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired. If set to false, the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
     */
    public val expiredObjectDeleteMarker: kotlin.Boolean = builder.expiredObjectDeleteMarker

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

    override fun toString(): kotlin.String = buildString {
        append("LifecycleExpiration(")
        append("date=$date,")
        append("days=$days,")
        append("expiredObjectDeleteMarker=$expiredObjectDeleteMarker")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = date?.hashCode() ?: 0
        result = 31 * result + (days)
        result = 31 * result + (expiredObjectDeleteMarker.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 LifecycleExpiration

        if (date != other.date) return false
        if (days != other.days) return false
        if (expiredObjectDeleteMarker != other.expiredObjectDeleteMarker) return false

        return true
    }

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

    public class Builder {
        /**
         * Indicates at what date the object is to be deleted. Should be in GMT ISO 8601 format.
         */
        public var date: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Indicates the lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
         */
        public var days: kotlin.Int = 0
        /**
         * Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired. If set to false, the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
         */
        public var expiredObjectDeleteMarker: kotlin.Boolean = false

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.s3control.model.LifecycleExpiration) : this() {
            this.date = x.date
            this.days = x.days
            this.expiredObjectDeleteMarker = x.expiredObjectDeleteMarker
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy