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

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

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

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



public class SetResourceAccessForBucketRequest private constructor(builder: Builder) {
    /**
     * The access setting.
     *
     * The following access settings are available:
     * + `allow` - Allows access to the bucket and its objects.
     * + `deny` - Denies access to the bucket and its objects. Use this setting to remove access for a resource previously set to `allow`.
     */
    public val access: aws.sdk.kotlin.services.lightsail.model.ResourceBucketAccess? = builder.access
    /**
     * The name of the bucket for which to set access to another Lightsail resource.
     */
    public val bucketName: kotlin.String? = builder.bucketName
    /**
     * The name of the Lightsail instance for which to set bucket access. The instance must be in a running or stopped state.
     */
    public val resourceName: kotlin.String? = builder.resourceName

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

    override fun toString(): kotlin.String = buildString {
        append("SetResourceAccessForBucketRequest(")
        append("access=$access,")
        append("bucketName=$bucketName,")
        append("resourceName=$resourceName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = access?.hashCode() ?: 0
        result = 31 * result + (bucketName?.hashCode() ?: 0)
        result = 31 * result + (resourceName?.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 SetResourceAccessForBucketRequest

        if (access != other.access) return false
        if (bucketName != other.bucketName) return false
        if (resourceName != other.resourceName) return false

        return true
    }

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

    public class Builder {
        /**
         * The access setting.
         *
         * The following access settings are available:
         * + `allow` - Allows access to the bucket and its objects.
         * + `deny` - Denies access to the bucket and its objects. Use this setting to remove access for a resource previously set to `allow`.
         */
        public var access: aws.sdk.kotlin.services.lightsail.model.ResourceBucketAccess? = null
        /**
         * The name of the bucket for which to set access to another Lightsail resource.
         */
        public var bucketName: kotlin.String? = null
        /**
         * The name of the Lightsail instance for which to set bucket access. The instance must be in a running or stopped state.
         */
        public var resourceName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lightsail.model.SetResourceAccessForBucketRequest) : this() {
            this.access = x.access
            this.bucketName = x.bucketName
            this.resourceName = x.resourceName
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy