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

com.pulumi.gcp.firebaserules.kotlin.Release.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.firebaserules.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 [Release].
 */
@PulumiTagMarker
public class ReleaseResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ReleaseArgs = ReleaseArgs()

    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 ReleaseArgsBuilder.() -> Unit) {
        val builder = ReleaseArgsBuilder()
        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(): Release {
        val builtJavaResource = com.pulumi.gcp.firebaserules.Release(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Release(builtJavaResource)
    }
}

/**
 * For more information, see:
 * * [Get started with Firebase Security Rules](https://firebase.google.com/docs/rules/get-started)
 * ## Example Usage
 * ## Import
 * Release can be imported using any of these accepted formats:
 * * `projects/{{project}}/releases/{{name}}`
 * When using the `pulumi import` command, Release can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:firebaserules/release:Release default projects/{{project}}/releases/{{name}}
 * ```
 */
public class Release internal constructor(
    override val javaResource: com.pulumi.gcp.firebaserules.Release,
) : KotlinCustomResource(javaResource, ReleaseMapper) {
    /**
     * Output only. Time the release was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
     */
    public val disabled: Output
        get() = javaResource.disabled().applyValue({ args0 -> args0 })

    /**
     * Format: `projects/{project_id}/releases/{release_id}`\Firestore Rules Releases will **always** have the name 'cloud.firestore'
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The project for the resource
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must exist for the `Release` to be created.
     * - - -
     */
    public val rulesetName: Output
        get() = javaResource.rulesetName().applyValue({ args0 -> args0 })

    /**
     * Output only. Time the release was updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object ReleaseMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.firebaserules.Release::class == javaResource::class

    override fun map(javaResource: Resource): Release = Release(
        javaResource as
            com.pulumi.gcp.firebaserules.Release,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy