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

com.pulumi.gitlab.kotlin.GroupProtectedEnvironmentArgs.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.

There is a newer version: 8.4.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gitlab.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gitlab.GroupProtectedEnvironmentArgs.builder
import com.pulumi.gitlab.kotlin.inputs.GroupProtectedEnvironmentApprovalRuleArgs
import com.pulumi.gitlab.kotlin.inputs.GroupProtectedEnvironmentApprovalRuleArgsBuilder
import com.pulumi.gitlab.kotlin.inputs.GroupProtectedEnvironmentDeployAccessLevelArgs
import com.pulumi.gitlab.kotlin.inputs.GroupProtectedEnvironmentDeployAccessLevelArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The `gitlab.GroupProtectedEnvironment` resource allows to manage the lifecycle of a protected environment in a group.
 * > In order to use a user_id in the `deploy_access_levels` configuration,
 *    you need to make sure that users have access to the group with Maintainer role or higher.
 *    In order to use a group_id in the `deploy_access_levels` configuration,
 *    the group_id must be a sub-group under the given group.
 * **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/group_protected_environments.html)
 * ## Import
 * Starting in Terraform v1.5.0 you can use an import block to import `gitlab_group_protected_environment`. For example:
 * terraform
 * import {
 *   to = gitlab_group_protected_environment.example
 *   id = "see CLI command below for ID"
 * }
 * Import using the CLI is supported using the following syntax:
 * GitLab group protected environments can be imported using an id made up of `groupId:environmentName`, e.g.
 * ```sh
 * $ pulumi import gitlab:index/groupProtectedEnvironment:GroupProtectedEnvironment bar 123:production
 * ```
 * @property approvalRules Array of approval rules to deploy, with each described by a hash. Elements in the `approval_rules` should be one of `user_id`, `group_id` or `access_level`.
 * @property deployAccessLevels Array of access levels allowed to deploy, with each described by a hash. Elements in the `deploy_access_levels` should be one of `user_id`, `group_id` or `access_level`.
 * @property environment The deployment tier of the environment.  Valid values are `production`, `staging`, `testing`, `development`, `other`.
 * @property group The ID or full path of the group which the protected environment is created against.
 */
public data class GroupProtectedEnvironmentArgs(
    public val approvalRules: Output>? = null,
    public val deployAccessLevels: Output>? =
        null,
    public val environment: Output? = null,
    public val group: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gitlab.GroupProtectedEnvironmentArgs =
        com.pulumi.gitlab.GroupProtectedEnvironmentArgs.builder()
            .approvalRules(
                approvalRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .deployAccessLevels(
                deployAccessLevels?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .environment(environment?.applyValue({ args0 -> args0 }))
            .group(group?.applyValue({ args0 -> args0 })).build()
}

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

    private var deployAccessLevels: Output>? =
        null

    private var environment: Output? = null

    private var group: Output? = null

    /**
     * @param value Array of approval rules to deploy, with each described by a hash. Elements in the `approval_rules` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("pbnfjdmuxoqbsxbx")
    public suspend fun approvalRules(`value`: Output>) {
        this.approvalRules = value
    }

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

    /**
     * @param values Array of approval rules to deploy, with each described by a hash. Elements in the `approval_rules` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("pyvxjiexpvnyrisu")
    public suspend fun approvalRules(values: List>) {
        this.approvalRules = Output.all(values)
    }

    /**
     * @param value Array of access levels allowed to deploy, with each described by a hash. Elements in the `deploy_access_levels` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("sxkcibjmvbdfdajl")
    public suspend fun deployAccessLevels(`value`: Output>) {
        this.deployAccessLevels = value
    }

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

    /**
     * @param values Array of access levels allowed to deploy, with each described by a hash. Elements in the `deploy_access_levels` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("kpshklblpawaktks")
    public suspend fun deployAccessLevels(values: List>) {
        this.deployAccessLevels = Output.all(values)
    }

    /**
     * @param value The deployment tier of the environment.  Valid values are `production`, `staging`, `testing`, `development`, `other`.
     */
    @JvmName("sicqkrnmxvbyjgsk")
    public suspend fun environment(`value`: Output) {
        this.environment = value
    }

    /**
     * @param value The ID or full path of the group which the protected environment is created against.
     */
    @JvmName("ahifsimyyaeshtxq")
    public suspend fun group(`value`: Output) {
        this.group = value
    }

    /**
     * @param value Array of approval rules to deploy, with each described by a hash. Elements in the `approval_rules` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("qgkqgxjkothudvjw")
    public suspend fun approvalRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.approvalRules = mapped
    }

    /**
     * @param argument Array of approval rules to deploy, with each described by a hash. Elements in the `approval_rules` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("oxaclortgapxwcqv")
    public suspend fun approvalRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            GroupProtectedEnvironmentApprovalRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.approvalRules = mapped
    }

    /**
     * @param argument Array of approval rules to deploy, with each described by a hash. Elements in the `approval_rules` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("rfygslmgaflbuwgv")
    public suspend fun approvalRules(vararg argument: suspend GroupProtectedEnvironmentApprovalRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            GroupProtectedEnvironmentApprovalRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.approvalRules = mapped
    }

    /**
     * @param argument Array of approval rules to deploy, with each described by a hash. Elements in the `approval_rules` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("wrrwfvpggkhkjypo")
    public suspend fun approvalRules(argument: suspend GroupProtectedEnvironmentApprovalRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            GroupProtectedEnvironmentApprovalRuleArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.approvalRules = mapped
    }

    /**
     * @param values Array of approval rules to deploy, with each described by a hash. Elements in the `approval_rules` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("dhdquwiyofomsdew")
    public suspend fun approvalRules(vararg values: GroupProtectedEnvironmentApprovalRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.approvalRules = mapped
    }

    /**
     * @param value Array of access levels allowed to deploy, with each described by a hash. Elements in the `deploy_access_levels` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("ylmdjcdnehtxnxlo")
    public suspend fun deployAccessLevels(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deployAccessLevels = mapped
    }

    /**
     * @param argument Array of access levels allowed to deploy, with each described by a hash. Elements in the `deploy_access_levels` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("exjesuraeslueccq")
    public suspend fun deployAccessLevels(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            GroupProtectedEnvironmentDeployAccessLevelArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.deployAccessLevels = mapped
    }

    /**
     * @param argument Array of access levels allowed to deploy, with each described by a hash. Elements in the `deploy_access_levels` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("wdjwughfycsxebdm")
    public suspend fun deployAccessLevels(vararg argument: suspend GroupProtectedEnvironmentDeployAccessLevelArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            GroupProtectedEnvironmentDeployAccessLevelArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.deployAccessLevels = mapped
    }

    /**
     * @param argument Array of access levels allowed to deploy, with each described by a hash. Elements in the `deploy_access_levels` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("hgsbxxwgvxbbexdg")
    public suspend fun deployAccessLevels(argument: suspend GroupProtectedEnvironmentDeployAccessLevelArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            GroupProtectedEnvironmentDeployAccessLevelArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.deployAccessLevels = mapped
    }

    /**
     * @param values Array of access levels allowed to deploy, with each described by a hash. Elements in the `deploy_access_levels` should be one of `user_id`, `group_id` or `access_level`.
     */
    @JvmName("gwssykordpcvfklk")
    public suspend fun deployAccessLevels(vararg values: GroupProtectedEnvironmentDeployAccessLevelArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.deployAccessLevels = mapped
    }

    /**
     * @param value The deployment tier of the environment.  Valid values are `production`, `staging`, `testing`, `development`, `other`.
     */
    @JvmName("ajhmcyoycybyjduh")
    public suspend fun environment(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environment = mapped
    }

    /**
     * @param value The ID or full path of the group which the protected environment is created against.
     */
    @JvmName("xafhdmjnlxrpemij")
    public suspend fun group(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.group = mapped
    }

    internal fun build(): GroupProtectedEnvironmentArgs = GroupProtectedEnvironmentArgs(
        approvalRules = approvalRules,
        deployAccessLevels = deployAccessLevels,
        environment = environment,
        group = group,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy