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

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

@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.ObjectIamPolicyBindingsItemResponse
import com.pulumi.googlenative.storage.v1.kotlin.outputs.ObjectIamPolicyBindingsItemResponse.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 [ObjectIamPolicy].
 */
@PulumiTagMarker
public class ObjectIamPolicyResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ObjectIamPolicyArgs = ObjectIamPolicyArgs()

    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 ObjectIamPolicyArgsBuilder.() -> Unit) {
        val builder = ObjectIamPolicyArgsBuilder()
        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(): ObjectIamPolicy {
        val builtJavaResource =
            com.pulumi.googlenative.storage.v1.ObjectIamPolicy(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return ObjectIamPolicy(builtJavaResource)
    }
}

/**
 * Updates an IAM policy for the specified object.
 * 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 ObjectIamPolicy internal constructor(
    override val javaResource: com.pulumi.googlenative.storage.v1.ObjectIamPolicy,
) : KotlinCustomResource(javaResource, ObjectIamPolicyMapper) {
    /**
     * 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 })

    /**
     * If present, selects a specific revision of this object (as opposed to the latest version, the default).
     */
    public val generation: Output?
        get() = javaResource.generation().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * 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 })

    public val `object`: Output
        get() = javaResource.`object`().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 ObjectIamPolicyMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.storage.v1.ObjectIamPolicy::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy