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

com.pulumi.digitalocean.kotlin.inputs.AppSpecWorkerArgs.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.AppSpecWorkerArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property alerts Describes an alert policy for the component.
 * @property buildCommand An optional build command to run while building this component from source.
 * @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 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 image An image to use as the component's source. Only one of `git`, `github`, `gitlab`, or `image` may be set.
 * @property instanceCount The amount of instances that this component should be scaled to.
 * @property instanceSizeSlug The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/api-reference/#operation/list_instance_sizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
 * @property logDestinations Describes a log forwarding destination.
 * @property name The name of the component.
 * @property runCommand An optional run command to override the component's default.
 * @property sourceDir An optional path to the working directory to use for the build.
 */
public data class AppSpecWorkerArgs(
    public val alerts: Output>? = null,
    public val buildCommand: Output? = null,
    public val dockerfilePath: Output? = null,
    public val environmentSlug: Output? = null,
    public val envs: Output>? = null,
    public val git: Output? = null,
    public val github: Output? = null,
    public val gitlab: Output? = null,
    public val image: Output? = null,
    public val instanceCount: Output? = null,
    public val instanceSizeSlug: Output? = null,
    public val logDestinations: Output>? = null,
    public val name: Output,
    public val runCommand: Output? = null,
    public val sourceDir: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.digitalocean.inputs.AppSpecWorkerArgs =
        com.pulumi.digitalocean.inputs.AppSpecWorkerArgs.builder()
            .alerts(alerts?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .buildCommand(buildCommand?.applyValue({ args0 -> args0 }))
            .dockerfilePath(dockerfilePath?.applyValue({ args0 -> args0 }))
            .environmentSlug(environmentSlug?.applyValue({ args0 -> args0 }))
            .envs(envs?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .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() }) }))
            .image(image?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .instanceCount(instanceCount?.applyValue({ args0 -> args0 }))
            .instanceSizeSlug(instanceSizeSlug?.applyValue({ args0 -> args0 }))
            .logDestinations(
                logDestinations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .name(name.applyValue({ args0 -> args0 }))
            .runCommand(runCommand?.applyValue({ args0 -> args0 }))
            .sourceDir(sourceDir?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AppSpecWorkerArgs].
 */
@PulumiTagMarker
public class AppSpecWorkerArgsBuilder internal constructor() {
    private var alerts: Output>? = null

    private var buildCommand: Output? = null

    private var dockerfilePath: Output? = null

    private var environmentSlug: Output? = null

    private var envs: Output>? = null

    private var git: Output? = null

    private var github: Output? = null

    private var gitlab: Output? = null

    private var image: Output? = null

    private var instanceCount: Output? = null

    private var instanceSizeSlug: Output? = null

    private var logDestinations: Output>? = null

    private var name: Output? = null

    private var runCommand: Output? = null

    private var sourceDir: Output? = null

    /**
     * @param value Describes an alert policy for the component.
     */
    @JvmName("kabcshnogmtqkwly")
    public suspend fun alerts(`value`: Output>) {
        this.alerts = value
    }

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

    /**
     * @param values Describes an alert policy for the component.
     */
    @JvmName("lwwohxwgahogedft")
    public suspend fun alerts(values: List>) {
        this.alerts = Output.all(values)
    }

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

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

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

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

    @JvmName("qneojfrkifrjjkyw")
    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("ownoxnkytwndereh")
    public suspend fun envs(values: List>) {
        this.envs = Output.all(values)
    }

    /**
     * @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("veiciyshlvfjmqwf")
    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("siowhmrvrhxbowii")
    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("fwdydmjvetusexnm")
    public suspend fun gitlab(`value`: Output) {
        this.gitlab = value
    }

    /**
     * @param value An image to use as the component's source. Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("mjxpgoliyfdydxrx")
    public suspend fun image(`value`: Output) {
        this.image = value
    }

    /**
     * @param value The amount of instances that this component should be scaled to.
     */
    @JvmName("ehoninvrutctbrhy")
    public suspend fun instanceCount(`value`: Output) {
        this.instanceCount = value
    }

    /**
     * @param value The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/api-reference/#operation/list_instance_sizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
     */
    @JvmName("whcaaxhyqgvuercm")
    public suspend fun instanceSizeSlug(`value`: Output) {
        this.instanceSizeSlug = value
    }

    /**
     * @param value Describes a log forwarding destination.
     */
    @JvmName("igqnxmrxotnpvfks")
    public suspend fun logDestinations(`value`: Output>) {
        this.logDestinations = value
    }

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

    /**
     * @param values Describes a log forwarding destination.
     */
    @JvmName("rlalbmmmndrwnmju")
    public suspend fun logDestinations(values: List>) {
        this.logDestinations = Output.all(values)
    }

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

    /**
     * @param value An optional run command to override the component's default.
     */
    @JvmName("xskcoeklpyocgewg")
    public suspend fun runCommand(`value`: Output) {
        this.runCommand = value
    }

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

    /**
     * @param value Describes an alert policy for the component.
     */
    @JvmName("bcbdohftgactvqcd")
    public suspend fun alerts(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.alerts = mapped
    }

    /**
     * @param argument Describes an alert policy for the component.
     */
    @JvmName("lwolftchaemthusd")
    public suspend fun alerts(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AppSpecWorkerAlertArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.alerts = mapped
    }

    /**
     * @param argument Describes an alert policy for the component.
     */
    @JvmName("vfpmbkhgdvcjlsfo")
    public suspend fun alerts(vararg argument: suspend AppSpecWorkerAlertArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AppSpecWorkerAlertArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.alerts = mapped
    }

    /**
     * @param argument Describes an alert policy for the component.
     */
    @JvmName("gbdluwhfimtsyvfy")
    public suspend fun alerts(argument: suspend AppSpecWorkerAlertArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AppSpecWorkerAlertArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.alerts = mapped
    }

    /**
     * @param values Describes an alert policy for the component.
     */
    @JvmName("bobsrymulmuegpie")
    public suspend fun alerts(vararg values: AppSpecWorkerAlertArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.alerts = mapped
    }

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

    /**
     * @param value The path to a Dockerfile relative to the root of the repo. If set, overrides usage of buildpacks.
     */
    @JvmName("vyofneklcpgglghq")
    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("nqpftxspiwudxnfw")
    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("purhqhulopekjowi")
    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("kuphhttvqprwghto")
    public suspend fun envs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AppSpecWorkerEnvArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.envs = mapped
    }

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

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

    /**
     * @param values Describes an environment variable made available to an app competent.
     */
    @JvmName("eefseuykcnwggulw")
    public suspend fun envs(vararg values: AppSpecWorkerEnvArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.envs = 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("xpowxvrjkfaessdr")
    public suspend fun git(`value`: AppSpecWorkerGitArgs?) {
        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("llayfxtbfrekfeyw")
    public suspend fun git(argument: suspend AppSpecWorkerGitArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecWorkerGitArgsBuilder().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("qxaakkemaaugbpxv")
    public suspend fun github(`value`: AppSpecWorkerGithubArgs?) {
        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("upxntwrfiuokugpo")
    public suspend fun github(argument: suspend AppSpecWorkerGithubArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecWorkerGithubArgsBuilder().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("qifbrarsrqxtebra")
    public suspend fun gitlab(`value`: AppSpecWorkerGitlabArgs?) {
        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("bhhwnalvepsgyafe")
    public suspend fun gitlab(argument: suspend AppSpecWorkerGitlabArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecWorkerGitlabArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.gitlab = mapped
    }

    /**
     * @param value An image to use as the component's source. Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("curtvypdvflkkvos")
    public suspend fun image(`value`: AppSpecWorkerImageArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.image = mapped
    }

    /**
     * @param argument An image to use as the component's source. Only one of `git`, `github`, `gitlab`, or `image` may be set.
     */
    @JvmName("wgdjmmeyxlfiiiug")
    public suspend fun image(argument: suspend AppSpecWorkerImageArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecWorkerImageArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.image = mapped
    }

    /**
     * @param value The amount of instances that this component should be scaled to.
     */
    @JvmName("ppdhlhqpxjudoppt")
    public suspend fun instanceCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceCount = mapped
    }

    /**
     * @param value The instance size to use for this component. This determines the plan (basic or professional) and the available CPU and memory. The list of available instance sizes can be [found with the API](https://docs.digitalocean.com/reference/api/api-reference/#operation/list_instance_sizes) or using the [doctl CLI](https://docs.digitalocean.com/reference/doctl/) (`doctl apps tier instance-size list`). Default: `basic-xxs`
     */
    @JvmName("tdhqdbvbgqcjvitd")
    public suspend fun instanceSizeSlug(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceSizeSlug = mapped
    }

    /**
     * @param value Describes a log forwarding destination.
     */
    @JvmName("bjukxgfopbfctptc")
    public suspend fun logDestinations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logDestinations = mapped
    }

    /**
     * @param argument Describes a log forwarding destination.
     */
    @JvmName("xbjsfkxjykudlhwb")
    public suspend fun logDestinations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AppSpecWorkerLogDestinationArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.logDestinations = mapped
    }

    /**
     * @param argument Describes a log forwarding destination.
     */
    @JvmName("reuyjbiutuynorot")
    public suspend fun logDestinations(vararg argument: suspend AppSpecWorkerLogDestinationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AppSpecWorkerLogDestinationArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.logDestinations = mapped
    }

    /**
     * @param argument Describes a log forwarding destination.
     */
    @JvmName("oeqhxkpbggybrtkg")
    public suspend fun logDestinations(argument: suspend AppSpecWorkerLogDestinationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            AppSpecWorkerLogDestinationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.logDestinations = mapped
    }

    /**
     * @param values Describes a log forwarding destination.
     */
    @JvmName("qamnmsukgojgecvp")
    public suspend fun logDestinations(vararg values: AppSpecWorkerLogDestinationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.logDestinations = mapped
    }

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

    /**
     * @param value An optional run command to override the component's default.
     */
    @JvmName("puaiipnxfqyncebc")
    public suspend fun runCommand(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runCommand = mapped
    }

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

    internal fun build(): AppSpecWorkerArgs = AppSpecWorkerArgs(
        alerts = alerts,
        buildCommand = buildCommand,
        dockerfilePath = dockerfilePath,
        environmentSlug = environmentSlug,
        envs = envs,
        git = git,
        github = github,
        gitlab = gitlab,
        image = image,
        instanceCount = instanceCount,
        instanceSizeSlug = instanceSizeSlug,
        logDestinations = logDestinations,
        name = name ?: throw PulumiNullFieldException("name"),
        runCommand = runCommand,
        sourceDir = sourceDir,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy