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

commonMain.aws.sdk.kotlin.services.s3control.model.RegionalBucket.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 for the regional bucket.
 */
public class RegionalBucket private constructor(builder: Builder) {
    /**
     *
     */
    public val bucket: kotlin.String = requireNotNull(builder.bucket) { "A non-null value must be provided for bucket" }
    /**
     * The Amazon Resource Name (ARN) for the regional bucket.
     */
    public val bucketArn: kotlin.String? = builder.bucketArn
    /**
     * The creation date of the regional bucket
     */
    public val creationDate: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.creationDate) { "A non-null value must be provided for creationDate" }
    /**
     * The Outposts ID of the regional bucket.
     */
    public val outpostId: kotlin.String? = builder.outpostId
    /**
     *
     */
    public val publicAccessBlockEnabled: kotlin.Boolean = builder.publicAccessBlockEnabled

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

    override fun toString(): kotlin.String = buildString {
        append("RegionalBucket(")
        append("bucket=$bucket,")
        append("bucketArn=$bucketArn,")
        append("creationDate=$creationDate,")
        append("outpostId=$outpostId,")
        append("publicAccessBlockEnabled=$publicAccessBlockEnabled")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = bucket.hashCode()
        result = 31 * result + (bucketArn?.hashCode() ?: 0)
        result = 31 * result + (creationDate.hashCode())
        result = 31 * result + (outpostId?.hashCode() ?: 0)
        result = 31 * result + (publicAccessBlockEnabled.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 RegionalBucket

        if (bucket != other.bucket) return false
        if (bucketArn != other.bucketArn) return false
        if (creationDate != other.creationDate) return false
        if (outpostId != other.outpostId) return false
        if (publicAccessBlockEnabled != other.publicAccessBlockEnabled) return false

        return true
    }

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

    public class Builder {
        /**
         *
         */
        public var bucket: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) for the regional bucket.
         */
        public var bucketArn: kotlin.String? = null
        /**
         * The creation date of the regional bucket
         */
        public var creationDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The Outposts ID of the regional bucket.
         */
        public var outpostId: kotlin.String? = null
        /**
         *
         */
        public var publicAccessBlockEnabled: kotlin.Boolean = false

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.s3control.model.RegionalBucket) : this() {
            this.bucket = x.bucket
            this.bucketArn = x.bucketArn
            this.creationDate = x.creationDate
            this.outpostId = x.outpostId
            this.publicAccessBlockEnabled = x.publicAccessBlockEnabled
        }

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

        internal fun correctErrors(): Builder {
            if (bucket == null) bucket = ""
            if (creationDate == null) creationDate = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy