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

com.pulumi.gcp.cloudrun.kotlin.inputs.ServiceTemplateSpecArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.cloudrun.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudrun.inputs.ServiceTemplateSpecArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Deprecated
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 *
 * @property containerConcurrency ContainerConcurrency specifies the maximum allowed in-flight (concurrent)
 * requests per container of the Revision. If not specified or 0, defaults to 80 when
 * requested CPU >= 1 and defaults to 1 when requested CPU < 1.
 * @property containers Containers defines the unit of execution for this Revision.
 * Structure is documented below.
 * @property nodeSelector Node Selector describes the hardware requirements of the resources.
 * Use the following node selector keys to configure features on a Revision:
 * - `run.googleapis.com/accelerator` sets the [type of GPU](https://cloud.google.com/run/docs/configuring/services/gpu) required by the Revision to run.
 * @property serviceAccountName Email address of the IAM service account associated with the revision of the
 * service. The service account represents the identity of the running revision,
 * and determines what permissions the revision has. If not provided, the revision
 * will use the project's default service account.
 * @property servingState (Output, Deprecated)
 * ServingState holds a value describing the state the resources
 * are in for this Revision.
 * It is expected
 * that the system will manipulate this based on routability and load.
 * > **Warning:** `serving_state` is deprecated and will be removed in a future major release. This field is not supported by the Cloud Run API.
 * @property timeoutSeconds TimeoutSeconds holds the max duration the instance is allowed for responding to a request.
 * @property volumes Volume represents a named volume in a container.
 * Structure is documented below.
 */
public data class ServiceTemplateSpecArgs(
    public val containerConcurrency: Output? = null,
    public val containers: Output>? = null,
    public val nodeSelector: Output>? = null,
    public val serviceAccountName: Output? = null,
    @Deprecated(
        message = """
  `serving_state` is deprecated and will be removed in a future major release. This field is not
      supported by the Cloud Run API.
  """,
    )
    public val servingState: Output? = null,
    public val timeoutSeconds: Output? = null,
    public val volumes: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudrun.inputs.ServiceTemplateSpecArgs =
        com.pulumi.gcp.cloudrun.inputs.ServiceTemplateSpecArgs.builder()
            .containerConcurrency(containerConcurrency?.applyValue({ args0 -> args0 }))
            .containers(
                containers?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .nodeSelector(
                nodeSelector?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .serviceAccountName(serviceAccountName?.applyValue({ args0 -> args0 }))
            .servingState(servingState?.applyValue({ args0 -> args0 }))
            .timeoutSeconds(timeoutSeconds?.applyValue({ args0 -> args0 }))
            .volumes(
                volumes?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [ServiceTemplateSpecArgs].
 */
@PulumiTagMarker
public class ServiceTemplateSpecArgsBuilder internal constructor() {
    private var containerConcurrency: Output? = null

    private var containers: Output>? = null

    private var nodeSelector: Output>? = null

    private var serviceAccountName: Output? = null

    private var servingState: Output? = null

    private var timeoutSeconds: Output? = null

    private var volumes: Output>? = null

    /**
     * @param value ContainerConcurrency specifies the maximum allowed in-flight (concurrent)
     * requests per container of the Revision. If not specified or 0, defaults to 80 when
     * requested CPU >= 1 and defaults to 1 when requested CPU < 1.
     */
    @JvmName("pylliqekvledyiku")
    public suspend fun containerConcurrency(`value`: Output) {
        this.containerConcurrency = value
    }

    /**
     * @param value Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     */
    @JvmName("ttrafxjctmucsoef")
    public suspend fun containers(`value`: Output>) {
        this.containers = value
    }

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

    /**
     * @param values Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     */
    @JvmName("rygfttprqaknxojo")
    public suspend fun containers(values: List>) {
        this.containers = Output.all(values)
    }

    /**
     * @param value Node Selector describes the hardware requirements of the resources.
     * Use the following node selector keys to configure features on a Revision:
     * - `run.googleapis.com/accelerator` sets the [type of GPU](https://cloud.google.com/run/docs/configuring/services/gpu) required by the Revision to run.
     */
    @JvmName("pxwvyqiakyqmxmmo")
    public suspend fun nodeSelector(`value`: Output>) {
        this.nodeSelector = value
    }

    /**
     * @param value Email address of the IAM service account associated with the revision of the
     * service. The service account represents the identity of the running revision,
     * and determines what permissions the revision has. If not provided, the revision
     * will use the project's default service account.
     */
    @JvmName("vyxcbglbvcebmwid")
    public suspend fun serviceAccountName(`value`: Output) {
        this.serviceAccountName = value
    }

    /**
     * @param value (Output, Deprecated)
     * ServingState holds a value describing the state the resources
     * are in for this Revision.
     * It is expected
     * that the system will manipulate this based on routability and load.
     * > **Warning:** `serving_state` is deprecated and will be removed in a future major release. This field is not supported by the Cloud Run API.
     */
    @Deprecated(
        message = """
  `serving_state` is deprecated and will be removed in a future major release. This field is not
      supported by the Cloud Run API.
  """,
    )
    @JvmName("wunqjypkvxnlaukn")
    public suspend fun servingState(`value`: Output) {
        this.servingState = value
    }

    /**
     * @param value TimeoutSeconds holds the max duration the instance is allowed for responding to a request.
     */
    @JvmName("qovsnjrsxxurptdx")
    public suspend fun timeoutSeconds(`value`: Output) {
        this.timeoutSeconds = value
    }

    /**
     * @param value Volume represents a named volume in a container.
     * Structure is documented below.
     */
    @JvmName("xubfekvfgpteepmk")
    public suspend fun volumes(`value`: Output>) {
        this.volumes = value
    }

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

    /**
     * @param values Volume represents a named volume in a container.
     * Structure is documented below.
     */
    @JvmName("hvepqfyhibxbsemx")
    public suspend fun volumes(values: List>) {
        this.volumes = Output.all(values)
    }

    /**
     * @param value ContainerConcurrency specifies the maximum allowed in-flight (concurrent)
     * requests per container of the Revision. If not specified or 0, defaults to 80 when
     * requested CPU >= 1 and defaults to 1 when requested CPU < 1.
     */
    @JvmName("grhlrqjvpgxulrgr")
    public suspend fun containerConcurrency(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.containerConcurrency = mapped
    }

    /**
     * @param value Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     */
    @JvmName("sbeotierlsnjjawi")
    public suspend fun containers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.containers = mapped
    }

    /**
     * @param argument Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     */
    @JvmName("waixygncuhrdmrik")
    public suspend fun containers(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ServiceTemplateSpecContainerArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.containers = mapped
    }

    /**
     * @param argument Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     */
    @JvmName("uicflxqwuqgocplr")
    public suspend fun containers(vararg argument: suspend ServiceTemplateSpecContainerArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ServiceTemplateSpecContainerArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.containers = mapped
    }

    /**
     * @param argument Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     */
    @JvmName("teuidqlltjtltmvn")
    public suspend fun containers(argument: suspend ServiceTemplateSpecContainerArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ServiceTemplateSpecContainerArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.containers = mapped
    }

    /**
     * @param values Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     */
    @JvmName("qebcftssnmgbfcjg")
    public suspend fun containers(vararg values: ServiceTemplateSpecContainerArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.containers = mapped
    }

    /**
     * @param value Node Selector describes the hardware requirements of the resources.
     * Use the following node selector keys to configure features on a Revision:
     * - `run.googleapis.com/accelerator` sets the [type of GPU](https://cloud.google.com/run/docs/configuring/services/gpu) required by the Revision to run.
     */
    @JvmName("elgbudgcqhrdxonn")
    public suspend fun nodeSelector(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nodeSelector = mapped
    }

    /**
     * @param values Node Selector describes the hardware requirements of the resources.
     * Use the following node selector keys to configure features on a Revision:
     * - `run.googleapis.com/accelerator` sets the [type of GPU](https://cloud.google.com/run/docs/configuring/services/gpu) required by the Revision to run.
     */
    @JvmName("hrstughahckdnwcb")
    public fun nodeSelector(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.nodeSelector = mapped
    }

    /**
     * @param value Email address of the IAM service account associated with the revision of the
     * service. The service account represents the identity of the running revision,
     * and determines what permissions the revision has. If not provided, the revision
     * will use the project's default service account.
     */
    @JvmName("rxdfrgeoimbnfvta")
    public suspend fun serviceAccountName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceAccountName = mapped
    }

    /**
     * @param value (Output, Deprecated)
     * ServingState holds a value describing the state the resources
     * are in for this Revision.
     * It is expected
     * that the system will manipulate this based on routability and load.
     * > **Warning:** `serving_state` is deprecated and will be removed in a future major release. This field is not supported by the Cloud Run API.
     */
    @Deprecated(
        message = """
  `serving_state` is deprecated and will be removed in a future major release. This field is not
      supported by the Cloud Run API.
  """,
    )
    @JvmName("mypjhbcytilwcbhe")
    public suspend fun servingState(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.servingState = mapped
    }

    /**
     * @param value TimeoutSeconds holds the max duration the instance is allowed for responding to a request.
     */
    @JvmName("sqhwiiffdukapayv")
    public suspend fun timeoutSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeoutSeconds = mapped
    }

    /**
     * @param value Volume represents a named volume in a container.
     * Structure is documented below.
     */
    @JvmName("nrjnhflpsfybxdyb")
    public suspend fun volumes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.volumes = mapped
    }

    /**
     * @param argument Volume represents a named volume in a container.
     * Structure is documented below.
     */
    @JvmName("lxgewmjvwfkgxins")
    public suspend fun volumes(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ServiceTemplateSpecVolumeArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.volumes = mapped
    }

    /**
     * @param argument Volume represents a named volume in a container.
     * Structure is documented below.
     */
    @JvmName("iiqufpgqgolhyndn")
    public suspend fun volumes(vararg argument: suspend ServiceTemplateSpecVolumeArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ServiceTemplateSpecVolumeArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.volumes = mapped
    }

    /**
     * @param argument Volume represents a named volume in a container.
     * Structure is documented below.
     */
    @JvmName("nhlytvsvqdowbdhc")
    public suspend fun volumes(argument: suspend ServiceTemplateSpecVolumeArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ServiceTemplateSpecVolumeArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.volumes = mapped
    }

    /**
     * @param values Volume represents a named volume in a container.
     * Structure is documented below.
     */
    @JvmName("mqaujgnmmanqsiwp")
    public suspend fun volumes(vararg values: ServiceTemplateSpecVolumeArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.volumes = mapped
    }

    internal fun build(): ServiceTemplateSpecArgs = ServiceTemplateSpecArgs(
        containerConcurrency = containerConcurrency,
        containers = containers,
        nodeSelector = nodeSelector,
        serviceAccountName = serviceAccountName,
        servingState = servingState,
        timeoutSeconds = timeoutSeconds,
        volumes = volumes,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy