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

com.pulumi.digitalocean.kotlin.inputs.AppSpecStaticSiteArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.digitalocean.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.inputs.AppSpecStaticSiteArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property buildCommand An optional build command to run while building this component from source.
 * @property catchallDocument The name of the document to use as the fallback for any requests to documents that are not found when serving this static site.
 * @property cors The [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policies of the app.
 * @property dockerfilePath The path to a Dockerfile relative to the root of the repo. If set, overrides usage of buildpacks.
 * @property environmentSlug An environment slug describing the type of this app.
 * @property envs Describes an environment variable made available to an app competent.
 * @property errorDocument The name of the error document to use when serving this static site.
 * @property git A Git repo to use as the component's source. The repository must be able to be cloned without authentication.  Only one of `git`, `github` or `gitlab`  may be set.
 * @property github A GitHub repo to use as the component's source. DigitalOcean App Platform must have [access to the repository](https://cloud.digitalocean.com/apps/github/install). Only one of `git`, `github`, `gitlab`, or `image` may be set.
 * @property gitlab A Gitlab repo to use as the component's source. DigitalOcean App Platform must have [access to the repository](https://cloud.digitalocean.com/apps/gitlab/install). Only one of `git`, `github`, `gitlab`, or `image` may be set.
 * @property indexDocument The name of the index document to use when serving this static site.
 * @property name The name of the component.
 * @property outputDir An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: `_static`, `dist`, `public`.
 * @property routes An HTTP paths that should be routed to this component.
 * @property sourceDir An optional path to the working directory to use for the build.
 */
public data class AppSpecStaticSiteArgs(
    public val buildCommand: Output? = null,
    public val catchallDocument: Output? = null,
    @Deprecated(
        message = """
  Service level CORS rules are deprecated in favor of ingresses
  """,
    )
    public val cors: Output? = null,
    public val dockerfilePath: Output? = null,
    public val environmentSlug: Output? = null,
    public val envs: Output>? = null,
    public val errorDocument: Output? = null,
    public val git: Output? = null,
    public val github: Output? = null,
    public val gitlab: Output? = null,
    public val indexDocument: Output? = null,
    public val name: Output,
    public val outputDir: Output? = null,
    @Deprecated(
        message = """
  Service level routes are deprecated in favor of ingresses
  """,
    )
    public val routes: Output>? = null,
    public val sourceDir: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.digitalocean.inputs.AppSpecStaticSiteArgs =
        com.pulumi.digitalocean.inputs.AppSpecStaticSiteArgs.builder()
            .buildCommand(buildCommand?.applyValue({ args0 -> args0 }))
            .catchallDocument(catchallDocument?.applyValue({ args0 -> args0 }))
            .cors(cors?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .dockerfilePath(dockerfilePath?.applyValue({ args0 -> args0 }))
            .environmentSlug(environmentSlug?.applyValue({ args0 -> args0 }))
            .envs(envs?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .errorDocument(errorDocument?.applyValue({ args0 -> args0 }))
            .git(git?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .github(github?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .gitlab(gitlab?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .indexDocument(indexDocument?.applyValue({ args0 -> args0 }))
            .name(name.applyValue({ args0 -> args0 }))
            .outputDir(outputDir?.applyValue({ args0 -> args0 }))
            .routes(routes?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .sourceDir(sourceDir?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AppSpecStaticSiteArgs].
 */
@PulumiTagMarker
public class AppSpecStaticSiteArgsBuilder internal constructor() {
    private var buildCommand: Output? = null

    private var catchallDocument: Output? = null

    private var cors: Output? = null

    private var dockerfilePath: Output? = null

    private var environmentSlug: Output? = null

    private var envs: Output>? = null

    private var errorDocument: Output? = null

    private var git: Output? = null

    private var github: Output? = null

    private var gitlab: Output? = null

    private var indexDocument: Output? = null

    private var name: Output? = null

    private var outputDir: Output? = null

    private var routes: Output>? = null

    private var sourceDir: Output? = null

    /**
     * @param value An optional build command to run while building this component from source.
     */
    @JvmName("abwsydufrkygmggp")
    public suspend fun buildCommand(`value`: Output) {
        this.buildCommand = value
    }

    /**
     * @param value The name of the document to use as the fallback for any requests to documents that are not found when serving this static site.
     */
    @JvmName("hhrljuepaxctffcb")
    public suspend fun catchallDocument(`value`: Output) {
        this.catchallDocument = value
    }

    /**
     * @param value The [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policies of the app.
     */
    @Deprecated(
        message = """
  Service level CORS rules are deprecated in favor of ingresses
  """,
    )
    @JvmName("ewysuoljxneylmmb")
    public suspend fun cors(`value`: Output) {
        this.cors = value
    }

    /**
     * @param value The path to a Dockerfile relative to the root of the repo. If set, overrides usage of buildpacks.
     */
    @JvmName("mbtcbxqnuikssmxe")
    public suspend fun dockerfilePath(`value`: Output) {
        this.dockerfilePath = value
    }

    /**
     * @param value An environment slug describing the type of this app.
     */
    @JvmName("enojmcdvyxnssquv")
    public suspend fun environmentSlug(`value`: Output) {
        this.environmentSlug = value
    }

    /**
     * @param value Describes an environment variable made available to an app competent.
     */
    @JvmName("llavfbsxqhnwbopq")
    public suspend fun envs(`value`: Output>) {
        this.envs = value
    }

    @JvmName("hdgyxspsfylaikqd")
    public suspend fun envs(vararg values: Output) {
        this.envs = Output.all(values.asList())
    }

    /**
     * @param values Describes an environment variable made available to an app competent.
     */
    @JvmName("mldkhvufieeyohdp")
    public suspend fun envs(values: List>) {
        this.envs = Output.all(values)
    }

    /**
     * @param value The name of the error document to use when serving this static site.
     */
    @JvmName("uooafieudfwlfcwq")
    public suspend fun errorDocument(`value`: Output) {
        this.errorDocument = value
    }

    /**
     * @param value A Git repo to use as the component's source. The repository must be able to be cloned without authentication.  Only one of `git`, `github` or `gitlab`  may be set.
     */
    @JvmName("ymxjnbxvhhyyjsof")
    public suspend fun git(`value`: Output) {
        this.git = value
    }

    /**
     * @param value A GitHub repo to use as the component's source. DigitalOcean App Platform must have [access to the repository](https://cloud.digitalocean.com/apps/github/install). Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("rdsvboilmqhbvhku")
    public suspend fun github(`value`: Output) {
        this.github = value
    }

    /**
     * @param value A Gitlab repo to use as the component's source. DigitalOcean App Platform must have [access to the repository](https://cloud.digitalocean.com/apps/gitlab/install). Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("ocwsqfrbiqrgjheg")
    public suspend fun gitlab(`value`: Output) {
        this.gitlab = value
    }

    /**
     * @param value The name of the index document to use when serving this static site.
     */
    @JvmName("wkhmhckukqdsrbem")
    public suspend fun indexDocument(`value`: Output) {
        this.indexDocument = value
    }

    /**
     * @param value The name of the component.
     */
    @JvmName("rcfjymdnjwmioweu")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: `_static`, `dist`, `public`.
     */
    @JvmName("hltdyhfvalxuybdi")
    public suspend fun outputDir(`value`: Output) {
        this.outputDir = value
    }

    /**
     * @param value An HTTP paths that should be routed to this component.
     */
    @Deprecated(
        message = """
  Service level routes are deprecated in favor of ingresses
  """,
    )
    @JvmName("utqmsybdlydvtksx")
    public suspend fun routes(`value`: Output>) {
        this.routes = value
    }

    @JvmName("kpdvdynqgxeqlieh")
    public suspend fun routes(vararg values: Output) {
        this.routes = Output.all(values.asList())
    }

    /**
     * @param values An HTTP paths that should be routed to this component.
     */
    @Deprecated(
        message = """
  Service level routes are deprecated in favor of ingresses
  """,
    )
    @JvmName("vwhdtnybcjcthkkp")
    public suspend fun routes(values: List>) {
        this.routes = Output.all(values)
    }

    /**
     * @param value An optional path to the working directory to use for the build.
     */
    @JvmName("oclrsybqltlppxdu")
    public suspend fun sourceDir(`value`: Output) {
        this.sourceDir = value
    }

    /**
     * @param value An optional build command to run while building this component from source.
     */
    @JvmName("hqptuhcusfkwxdmu")
    public suspend fun buildCommand(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.buildCommand = mapped
    }

    /**
     * @param value The name of the document to use as the fallback for any requests to documents that are not found when serving this static site.
     */
    @JvmName("npputphqccpyrtjd")
    public suspend fun catchallDocument(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.catchallDocument = mapped
    }

    /**
     * @param value The [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policies of the app.
     */
    @Deprecated(
        message = """
  Service level CORS rules are deprecated in favor of ingresses
  """,
    )
    @JvmName("jeutucuyisfmbffu")
    public suspend fun cors(`value`: AppSpecStaticSiteCorsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cors = mapped
    }

    /**
     * @param argument The [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policies of the app.
     */
    @Deprecated(
        message = """
  Service level CORS rules are deprecated in favor of ingresses
  """,
    )
    @JvmName("jehfngumlxwsddvr")
    public suspend fun cors(argument: suspend AppSpecStaticSiteCorsArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecStaticSiteCorsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.cors = mapped
    }

    /**
     * @param value The path to a Dockerfile relative to the root of the repo. If set, overrides usage of buildpacks.
     */
    @JvmName("pdsikcxgseolcdde")
    public suspend fun dockerfilePath(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dockerfilePath = mapped
    }

    /**
     * @param value An environment slug describing the type of this app.
     */
    @JvmName("upifuhsbelwfmjtu")
    public suspend fun environmentSlug(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environmentSlug = mapped
    }

    /**
     * @param value Describes an environment variable made available to an app competent.
     */
    @JvmName("gwsfhpygpbsbfqvc")
    public suspend fun envs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.envs = mapped
    }

    /**
     * @param argument Describes an environment variable made available to an app competent.
     */
    @JvmName("cmvvcauatimkdwrp")
    public suspend fun envs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AppSpecStaticSiteEnvArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.envs = mapped
    }

    /**
     * @param argument Describes an environment variable made available to an app competent.
     */
    @JvmName("vyiaodixqncqsdxq")
    public suspend fun envs(vararg argument: suspend AppSpecStaticSiteEnvArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AppSpecStaticSiteEnvArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.envs = mapped
    }

    /**
     * @param argument Describes an environment variable made available to an app competent.
     */
    @JvmName("qvroqayintvuueow")
    public suspend fun envs(argument: suspend AppSpecStaticSiteEnvArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AppSpecStaticSiteEnvArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.envs = mapped
    }

    /**
     * @param values Describes an environment variable made available to an app competent.
     */
    @JvmName("xvihcnsrjwwunxjy")
    public suspend fun envs(vararg values: AppSpecStaticSiteEnvArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.envs = mapped
    }

    /**
     * @param value The name of the error document to use when serving this static site.
     */
    @JvmName("aerpvcsqumnvqact")
    public suspend fun errorDocument(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.errorDocument = mapped
    }

    /**
     * @param value A Git repo to use as the component's source. The repository must be able to be cloned without authentication.  Only one of `git`, `github` or `gitlab`  may be set.
     */
    @JvmName("sjyyfdgeuodbxuyw")
    public suspend fun git(`value`: AppSpecStaticSiteGitArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.git = mapped
    }

    /**
     * @param argument A Git repo to use as the component's source. The repository must be able to be cloned without authentication.  Only one of `git`, `github` or `gitlab`  may be set.
     */
    @JvmName("qtbacrhxnubmndar")
    public suspend fun git(argument: suspend AppSpecStaticSiteGitArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecStaticSiteGitArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.git = mapped
    }

    /**
     * @param value A GitHub repo to use as the component's source. DigitalOcean App Platform must have [access to the repository](https://cloud.digitalocean.com/apps/github/install). Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("pcgmtirjxmoebrnv")
    public suspend fun github(`value`: AppSpecStaticSiteGithubArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.github = mapped
    }

    /**
     * @param argument A GitHub repo to use as the component's source. DigitalOcean App Platform must have [access to the repository](https://cloud.digitalocean.com/apps/github/install). Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("kcpjfhkytoqkoaww")
    public suspend fun github(argument: suspend AppSpecStaticSiteGithubArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecStaticSiteGithubArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.github = mapped
    }

    /**
     * @param value A Gitlab repo to use as the component's source. DigitalOcean App Platform must have [access to the repository](https://cloud.digitalocean.com/apps/gitlab/install). Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("qrksbrrctqtmtxgp")
    public suspend fun gitlab(`value`: AppSpecStaticSiteGitlabArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.gitlab = mapped
    }

    /**
     * @param argument A Gitlab repo to use as the component's source. DigitalOcean App Platform must have [access to the repository](https://cloud.digitalocean.com/apps/gitlab/install). Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("wmvvtsbnyckpncup")
    public suspend fun gitlab(argument: suspend AppSpecStaticSiteGitlabArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecStaticSiteGitlabArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.gitlab = mapped
    }

    /**
     * @param value The name of the index document to use when serving this static site.
     */
    @JvmName("agfoxmspqyoiccfn")
    public suspend fun indexDocument(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.indexDocument = mapped
    }

    /**
     * @param value The name of the component.
     */
    @JvmName("sfehjouyrhkpyxkt")
    public suspend fun name(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: `_static`, `dist`, `public`.
     */
    @JvmName("ylpkocihnwnyefun")
    public suspend fun outputDir(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.outputDir = mapped
    }

    /**
     * @param value An HTTP paths that should be routed to this component.
     */
    @Deprecated(
        message = """
  Service level routes are deprecated in favor of ingresses
  """,
    )
    @JvmName("vnalwdxvpjpghndk")
    public suspend fun routes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routes = mapped
    }

    /**
     * @param argument An HTTP paths that should be routed to this component.
     */
    @Deprecated(
        message = """
  Service level routes are deprecated in favor of ingresses
  """,
    )
    @JvmName("okiwcxwuoiwhdbwp")
    public suspend fun routes(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AppSpecStaticSiteRouteArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param argument An HTTP paths that should be routed to this component.
     */
    @Deprecated(
        message = """
  Service level routes are deprecated in favor of ingresses
  """,
    )
    @JvmName("cfhdgcgjmweeqpek")
    public suspend fun routes(vararg argument: suspend AppSpecStaticSiteRouteArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AppSpecStaticSiteRouteArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param argument An HTTP paths that should be routed to this component.
     */
    @Deprecated(
        message = """
  Service level routes are deprecated in favor of ingresses
  """,
    )
    @JvmName("uyexpodkfinoalgi")
    public suspend fun routes(argument: suspend AppSpecStaticSiteRouteArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AppSpecStaticSiteRouteArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.routes = mapped
    }

    /**
     * @param values An HTTP paths that should be routed to this component.
     */
    @Deprecated(
        message = """
  Service level routes are deprecated in favor of ingresses
  """,
    )
    @JvmName("ejyvyeopnwjgocvy")
    public suspend fun routes(vararg values: AppSpecStaticSiteRouteArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.routes = mapped
    }

    /**
     * @param value An optional path to the working directory to use for the build.
     */
    @JvmName("wwemojfdhcjllqpp")
    public suspend fun sourceDir(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceDir = mapped
    }

    internal fun build(): AppSpecStaticSiteArgs = AppSpecStaticSiteArgs(
        buildCommand = buildCommand,
        catchallDocument = catchallDocument,
        cors = cors,
        dockerfilePath = dockerfilePath,
        environmentSlug = environmentSlug,
        envs = envs,
        errorDocument = errorDocument,
        git = git,
        github = github,
        gitlab = gitlab,
        indexDocument = indexDocument,
        name = name ?: throw PulumiNullFieldException("name"),
        outputDir = outputDir,
        routes = routes,
        sourceDir = sourceDir,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy