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

commonMain.aws.sdk.kotlin.services.s3.model.ReplicationTime.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.s3.model



/**
 * A container specifying S3 Replication Time Control (S3 RTC) related information, including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with a `Metrics` block.
 */
public class ReplicationTime private constructor(builder: Builder) {
    /**
     * Specifies whether the replication time is enabled.
     */
    public val status: aws.sdk.kotlin.services.s3.model.ReplicationTimeStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
    /**
     * A container specifying the time by which replication should be complete for all objects and operations on objects.
     */
    public val time: aws.sdk.kotlin.services.s3.model.ReplicationTimeValue? = builder.time

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

    override fun toString(): kotlin.String = buildString {
        append("ReplicationTime(")
        append("status=$status,")
        append("time=$time")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = status.hashCode()
        result = 31 * result + (time?.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 ReplicationTime

        if (status != other.status) return false
        if (time != other.time) return false

        return true
    }

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

    public class Builder {
        /**
         * Specifies whether the replication time is enabled.
         */
        public var status: aws.sdk.kotlin.services.s3.model.ReplicationTimeStatus? = null
        /**
         * A container specifying the time by which replication should be complete for all objects and operations on objects.
         */
        public var time: aws.sdk.kotlin.services.s3.model.ReplicationTimeValue? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.s3.model.ReplicationTime) : this() {
            this.status = x.status
            this.time = x.time
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.s3.model.ReplicationTimeValue] inside the given [block]
         */
        public fun time(block: aws.sdk.kotlin.services.s3.model.ReplicationTimeValue.Builder.() -> kotlin.Unit) {
            this.time = aws.sdk.kotlin.services.s3.model.ReplicationTimeValue.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (status == null) status = ReplicationTimeStatus.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy