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

com.pulumi.googlenative.firebasehosting.v1beta1.kotlin.Version.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.firebasehosting.v1beta1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.firebasehosting.v1beta1.kotlin.outputs.ActingUserResponse
import com.pulumi.googlenative.firebasehosting.v1beta1.kotlin.outputs.ServingConfigResponse
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
import kotlin.collections.Map
import com.pulumi.googlenative.firebasehosting.v1beta1.kotlin.outputs.ActingUserResponse.Companion.toKotlin as actingUserResponseToKotlin
import com.pulumi.googlenative.firebasehosting.v1beta1.kotlin.outputs.ServingConfigResponse.Companion.toKotlin as servingConfigResponseToKotlin

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

    public var args: VersionArgs = VersionArgs()

    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 VersionArgsBuilder.() -> Unit) {
        val builder = VersionArgsBuilder()
        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(): Version {
        val builtJavaResource =
            com.pulumi.googlenative.firebasehosting.v1beta1.Version(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return Version(builtJavaResource)
    }
}

/**
 * Creates a new version for the specified site.
 */
public class Version internal constructor(
    override val javaResource: com.pulumi.googlenative.firebasehosting.v1beta1.Version,
) : KotlinCustomResource(javaResource, VersionMapper) {
    /**
     * The configuration for the behavior of the site. This configuration exists in the [`firebase.json`](https://firebase.google.com/docs/cli/#the_firebasejson_file) file.
     */
    public val config: Output
        get() = javaResource.config().applyValue({ args0 ->
            args0.let({ args0 ->
                servingConfigResponseToKotlin(args0)
            })
        })

    /**
     * The time at which the version was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Identifies the user who created the version.
     */
    public val createUser: Output
        get() = javaResource.createUser().applyValue({ args0 ->
            args0.let({ args0 ->
                actingUserResponseToKotlin(args0)
            })
        })

    /**
     * The time at which the version was `DELETED`.
     */
    public val deleteTime: Output
        get() = javaResource.deleteTime().applyValue({ args0 -> args0 })

    /**
     * Identifies the user who `DELETED` the version.
     */
    public val deleteUser: Output
        get() = javaResource.deleteUser().applyValue({ args0 ->
            args0.let({ args0 ->
                actingUserResponseToKotlin(args0)
            })
        })

    /**
     * The total number of files associated with the version. This value is calculated after a version is `FINALIZED`.
     */
    public val fileCount: Output
        get() = javaResource.fileCount().applyValue({ args0 -> args0 })

    /**
     * The time at which the version was `FINALIZED`.
     */
    public val finalizeTime: Output
        get() = javaResource.finalizeTime().applyValue({ args0 -> args0 })

    /**
     * Identifies the user who `FINALIZED` the version.
     */
    public val finalizeUser: Output
        get() = javaResource.finalizeUser().applyValue({ args0 ->
            args0.let({ args0 ->
                actingUserResponseToKotlin(args0)
            })
        })

    /**
     * The labels used for extra metadata and/or filtering.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The fully-qualified resource name for the version, in the format: sites/ SITE_ID/versions/VERSION_ID This name is provided in the response body when you call [`CreateVersion`](sites.versions/create).
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

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

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

    /**
     * The self-reported size of the version. This value is used for a pre-emptive quota check for legacy version uploads.
     */
    public val sizeBytes: Output?
        get() = javaResource.sizeBytes().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The deploy status of the version. For a successful deploy, call [`CreateVersion`](sites.versions/create) to make a new version (`CREATED` status), [upload all desired files](sites.versions/populateFiles) to the version, then [update](sites.versions/patch) the version to the `FINALIZED` status. Note that if you leave the version in the `CREATED` state for more than 12 hours, the system will automatically mark the version as `ABANDONED`. You can also change the status of a version to `DELETED` by calling [`DeleteVersion`](sites.versions/delete).
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * The total stored bytesize of the version. This value is calculated after a version is `FINALIZED`.
     */
    public val versionBytes: Output
        get() = javaResource.versionBytes().applyValue({ args0 -> args0 })

    /**
     * A unique id for the new version. This is was only specified for legacy version creations, and should be blank.
     */
    public val versionId: Output?
        get() = javaResource.versionId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object VersionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.firebasehosting.v1beta1.Version::class == javaResource::class

    override fun map(javaResource: Resource): Version = Version(
        javaResource as
            com.pulumi.googlenative.firebasehosting.v1beta1.Version,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy