
commonMain.aws.sdk.kotlin.services.s3.model.NoncurrentVersionExpiration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.s3.model
/**
* Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object's lifetime.
*/
public class NoncurrentVersionExpiration private constructor(builder: Builder) {
/**
* Specifies how many newer noncurrent versions must exist before Amazon S3 can perform the associated action on a given version. If there are this many more recent noncurrent versions, Amazon S3 will take the associated action. For more information about noncurrent versions, see [Lifecycle configuration elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 User Guide*.
*/
public val newerNoncurrentVersions: kotlin.Int? = builder.newerNoncurrentVersions
/**
* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) in the *Amazon S3 User Guide*.
*/
public val noncurrentDays: kotlin.Int? = builder.noncurrentDays
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.s3.model.NoncurrentVersionExpiration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("NoncurrentVersionExpiration(")
append("newerNoncurrentVersions=$newerNoncurrentVersions,")
append("noncurrentDays=$noncurrentDays")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = newerNoncurrentVersions ?: 0
result = 31 * result + (noncurrentDays ?: 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 NoncurrentVersionExpiration
if (newerNoncurrentVersions != other.newerNoncurrentVersions) return false
if (noncurrentDays != other.noncurrentDays) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.s3.model.NoncurrentVersionExpiration = Builder(this).apply(block).build()
public class Builder {
/**
* Specifies how many newer noncurrent versions must exist before Amazon S3 can perform the associated action on a given version. If there are this many more recent noncurrent versions, Amazon S3 will take the associated action. For more information about noncurrent versions, see [Lifecycle configuration elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 User Guide*.
*/
public var newerNoncurrentVersions: kotlin.Int? = null
/**
* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) in the *Amazon S3 User Guide*.
*/
public var noncurrentDays: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.s3.model.NoncurrentVersionExpiration) : this() {
this.newerNoncurrentVersions = x.newerNoncurrentVersions
this.noncurrentDays = x.noncurrentDays
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.s3.model.NoncurrentVersionExpiration = NoncurrentVersionExpiration(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy