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

commonMain.aws.sdk.kotlin.services.lightsail.model.UpdateBucketRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lightsail.model



public class UpdateBucketRequest private constructor(builder: Builder) {
    /**
     * An object that describes the access log configuration for the bucket.
     */
    public val accessLogConfig: aws.sdk.kotlin.services.lightsail.model.BucketAccessLogConfig? = builder.accessLogConfig
    /**
     * An object that sets the public accessibility of objects in the specified bucket.
     */
    public val accessRules: aws.sdk.kotlin.services.lightsail.model.AccessRules? = builder.accessRules
    /**
     * The name of the bucket to update.
     */
    public val bucketName: kotlin.String? = builder.bucketName
    /**
     * An array of strings to specify the Amazon Web Services account IDs that can access the bucket.
     *
     * You can give a maximum of 10 Amazon Web Services accounts access to a bucket.
     */
    public val readonlyAccessAccounts: List? = builder.readonlyAccessAccounts
    /**
     * Specifies whether to enable or suspend versioning of objects in the bucket.
     *
     * The following options can be specified:
     * + `Enabled` - Enables versioning of objects in the specified bucket.
     * + `Suspended` - Suspends versioning of objects in the specified bucket. Existing object versions are retained.
     */
    public val versioning: kotlin.String? = builder.versioning

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

    override fun toString(): kotlin.String = buildString {
        append("UpdateBucketRequest(")
        append("accessLogConfig=$accessLogConfig,")
        append("accessRules=$accessRules,")
        append("bucketName=$bucketName,")
        append("readonlyAccessAccounts=$readonlyAccessAccounts,")
        append("versioning=$versioning")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = accessLogConfig?.hashCode() ?: 0
        result = 31 * result + (accessRules?.hashCode() ?: 0)
        result = 31 * result + (bucketName?.hashCode() ?: 0)
        result = 31 * result + (readonlyAccessAccounts?.hashCode() ?: 0)
        result = 31 * result + (versioning?.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 UpdateBucketRequest

        if (accessLogConfig != other.accessLogConfig) return false
        if (accessRules != other.accessRules) return false
        if (bucketName != other.bucketName) return false
        if (readonlyAccessAccounts != other.readonlyAccessAccounts) return false
        if (versioning != other.versioning) return false

        return true
    }

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

    public class Builder {
        /**
         * An object that describes the access log configuration for the bucket.
         */
        public var accessLogConfig: aws.sdk.kotlin.services.lightsail.model.BucketAccessLogConfig? = null
        /**
         * An object that sets the public accessibility of objects in the specified bucket.
         */
        public var accessRules: aws.sdk.kotlin.services.lightsail.model.AccessRules? = null
        /**
         * The name of the bucket to update.
         */
        public var bucketName: kotlin.String? = null
        /**
         * An array of strings to specify the Amazon Web Services account IDs that can access the bucket.
         *
         * You can give a maximum of 10 Amazon Web Services accounts access to a bucket.
         */
        public var readonlyAccessAccounts: List? = null
        /**
         * Specifies whether to enable or suspend versioning of objects in the bucket.
         *
         * The following options can be specified:
         * + `Enabled` - Enables versioning of objects in the specified bucket.
         * + `Suspended` - Suspends versioning of objects in the specified bucket. Existing object versions are retained.
         */
        public var versioning: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lightsail.model.UpdateBucketRequest) : this() {
            this.accessLogConfig = x.accessLogConfig
            this.accessRules = x.accessRules
            this.bucketName = x.bucketName
            this.readonlyAccessAccounts = x.readonlyAccessAccounts
            this.versioning = x.versioning
        }

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy