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

com.pulumi.googlenative.storage.v1.kotlin.BucketIamPolicy.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.storage.v1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.storage.v1.kotlin.outputs.BucketIamPolicyBindingsItemResponse
import com.pulumi.googlenative.storage.v1.kotlin.outputs.BucketIamPolicyBindingsItemResponse.Companion.toKotlin
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [BucketIamPolicy].
 */
@PulumiTagMarker
public class BucketIamPolicyResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: BucketIamPolicyArgs = BucketIamPolicyArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend BucketIamPolicyArgsBuilder.() -> Unit) {
        val builder = BucketIamPolicyArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): BucketIamPolicy {
        val builtJavaResource =
            com.pulumi.googlenative.storage.v1.BucketIamPolicy(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return BucketIamPolicy(builtJavaResource)
    }
}

/**
 * Updates an IAM policy for the specified bucket.
 * Note - this resource's API doesn't support deletion. When deleted, the resource will persist
 * on Google Cloud even though it will be deleted from Pulumi state.
 */
public class BucketIamPolicy internal constructor(
    override val javaResource: com.pulumi.googlenative.storage.v1.BucketIamPolicy,
) : KotlinCustomResource(javaResource, BucketIamPolicyMapper) {
    /**
     * An association between a role, which comes with a set of permissions, and members who may assume that role.
     */
    public val bindings: Output>
        get() = javaResource.bindings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            })
        })

    public val bucket: Output
        get() = javaResource.bucket().applyValue({ args0 -> args0 })

    /**
     * HTTP 1.1  Entity tag for the policy.
     */
    public val etag: Output
        get() = javaResource.etag().applyValue({ args0 -> args0 })

    /**
     * The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
     */
    public val kind: Output
        get() = javaResource.kind().applyValue({ args0 -> args0 })

    /**
     * The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
     */
    public val resourceId: Output
        get() = javaResource.resourceId().applyValue({ args0 -> args0 })

    /**
     * The project to be billed for this request. Required for Requester Pays buckets.
     */
    public val userProject: Output?
        get() = javaResource.userProject().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The IAM policy format version.
     */
    public val version: Output
        get() = javaResource.version().applyValue({ args0 -> args0 })
}

public object BucketIamPolicyMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.storage.v1.BucketIamPolicy::class == javaResource::class

    override fun map(javaResource: Resource): BucketIamPolicy = BucketIamPolicy(
        javaResource as
            com.pulumi.googlenative.storage.v1.BucketIamPolicy,
    )
}

/**
 * @see [BucketIamPolicy].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [BucketIamPolicy].
 */
public suspend fun bucketIamPolicy(
    name: String,
    block: suspend BucketIamPolicyResourceBuilder.() -> Unit,
): BucketIamPolicy {
    val builder = BucketIamPolicyResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [BucketIamPolicy].
 * @param name The _unique_ name of the resulting resource.
 */
public fun bucketIamPolicy(name: String): BucketIamPolicy {
    val builder = BucketIamPolicyResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy