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

com.pulumi.googlenative.accesscontextmanager.v1beta.kotlin.AccessPolicy.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.accesscontextmanager.v1beta.kotlin

import com.pulumi.core.Output
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.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: AccessPolicyArgs = AccessPolicyArgs()

    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 AccessPolicyArgsBuilder.() -> Unit) {
        val builder = AccessPolicyArgsBuilder()
        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(): AccessPolicy {
        val builtJavaResource =
            com.pulumi.googlenative.accesscontextmanager.v1beta.AccessPolicy(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return AccessPolicy(builtJavaResource)
    }
}

/**
 * Create an `AccessPolicy`. Fails if this organization already has a `AccessPolicy`. The longrunning Operation will have a successful status once the `AccessPolicy` has propagated to long-lasting storage. Syntactic and basic semantic errors will be returned in `metadata` as a BadRequest proto.
 * Auto-naming is currently not supported for this resource.
 */
public class AccessPolicy internal constructor(
    override val javaResource: com.pulumi.googlenative.accesscontextmanager.v1beta.AccessPolicy,
) : KotlinCustomResource(javaResource, AccessPolicyMapper) {
    /**
     * Resource name of the `AccessPolicy`. Format: `accessPolicies/{policy_id}`
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The parent of this `AccessPolicy` in the Cloud Resource Hierarchy. Currently immutable once created. Format: `organizations/{organization_id}`
     */
    public val parent: Output
        get() = javaResource.parent().applyValue({ args0 -> args0 })

    /**
     * Human readable title. Does not affect behavior.
     */
    public val title: Output
        get() = javaResource.title().applyValue({ args0 -> args0 })
}

public object AccessPolicyMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.accesscontextmanager.v1beta.AccessPolicy::class == javaResource::class

    override fun map(javaResource: Resource): AccessPolicy = AccessPolicy(
        javaResource as
            com.pulumi.googlenative.accesscontextmanager.v1beta.AccessPolicy,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy