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

com.pulumi.googlenative.firebasehosting.v1beta1.kotlin.Site.kt Maven / Gradle / Ivy

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

package com.pulumi.googlenative.firebasehosting.v1beta1.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
import kotlin.collections.Map

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

    public var args: SiteArgs = SiteArgs()

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

/**
 * Creates a new Hosting Site in the specified parent Firebase project. Note that Hosting sites can take several minutes to propagate through Firebase systems.
 * Auto-naming is currently not supported for this resource.
 */
public class Site internal constructor(
    override val javaResource: com.pulumi.googlenative.firebasehosting.v1beta1.Site,
) : KotlinCustomResource(javaResource, SiteMapper) {
    /**
     * Optional. The [ID of a Web App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps#WebApp.FIELDS.app_id) associated with the Hosting site.
     */
    public val appId: Output
        get() = javaResource.appId().applyValue({ args0 -> args0 })

    /**
     * The default URL for the Hosting site.
     */
    public val defaultUrl: Output
        get() = javaResource.defaultUrl().applyValue({ args0 -> args0 })

    /**
     * Optional. User-specified labels for the Hosting site.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The fully-qualified resource name of the Hosting site, in the format: projects/PROJECT_IDENTIFIER/sites/SITE_ID PROJECT_IDENTIFIER: the Firebase project's [`ProjectNumber`](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google's [AIP 2510 standard](https://google.aip.dev/cloud/2510).
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

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

    /**
     * Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.
     */
    public val siteId: Output
        get() = javaResource.siteId().applyValue({ args0 -> args0 })

    /**
     * The type of Hosting site. Every Firebase project has a `DEFAULT_SITE`, which is created when Hosting is provisioned for the project. All additional sites are `USER_SITE`.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy