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

com.pulumi.gitlab.kotlin.ProjectApprovalRuleArgs.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.ProjectApprovalRuleArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ## Import
 * GitLab project approval rules can be imported using a key composed of `:`, e.g.
 * ```sh
 * $ pulumi import gitlab:index/projectApprovalRule:ProjectApprovalRule example "12345:6"
 * ```
 * @property appliesToAllProtectedBranches Whether the rule is applied to all protected branches. If set to 'true', the value of `protected_branch_ids` is ignored. Default is 'false'.
 * @property approvalsRequired The number of approvals required for this rule.
 * @property disableImportingDefaultAnyApproverRuleOnCreate When this flag is set, the default `any_approver` rule will not be imported if present.
 * @property groupIds A list of group IDs whose members can approve of the merge request.
 * @property name The name of the approval rule.
 * @property project The name or id of the project to add the approval rules.
 * @property protectedBranchIds A list of protected branch IDs (not branch names) for which the rule applies.
 * @property ruleType String, defaults to 'regular'. The type of rule. `any_approver` is a pre-configured default rule with `approvals_required` at `0`. Valid values are `regular`, `any_approver`.
 * @property userIds A list of specific User IDs to add to the list of approvers.
 */
public data class ProjectApprovalRuleArgs(
    public val appliesToAllProtectedBranches: Output? = null,
    public val approvalsRequired: Output? = null,
    public val disableImportingDefaultAnyApproverRuleOnCreate: Output? = null,
    public val groupIds: Output>? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val protectedBranchIds: Output>? = null,
    public val ruleType: Output? = null,
    public val userIds: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gitlab.ProjectApprovalRuleArgs =
        com.pulumi.gitlab.ProjectApprovalRuleArgs.builder()
            .appliesToAllProtectedBranches(appliesToAllProtectedBranches?.applyValue({ args0 -> args0 }))
            .approvalsRequired(approvalsRequired?.applyValue({ args0 -> args0 }))
            .disableImportingDefaultAnyApproverRuleOnCreate(
                disableImportingDefaultAnyApproverRuleOnCreate?.applyValue({ args0 ->
                    args0
                }),
            )
            .groupIds(groupIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .protectedBranchIds(protectedBranchIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .ruleType(ruleType?.applyValue({ args0 -> args0 }))
            .userIds(userIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

/**
 * Builder for [ProjectApprovalRuleArgs].
 */
@PulumiTagMarker
public class ProjectApprovalRuleArgsBuilder internal constructor() {
    private var appliesToAllProtectedBranches: Output? = null

    private var approvalsRequired: Output? = null

    private var disableImportingDefaultAnyApproverRuleOnCreate: Output? = null

    private var groupIds: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    private var protectedBranchIds: Output>? = null

    private var ruleType: Output? = null

    private var userIds: Output>? = null

    /**
     * @param value Whether the rule is applied to all protected branches. If set to 'true', the value of `protected_branch_ids` is ignored. Default is 'false'.
     */
    @JvmName("uknaptvjmxhbfgtp")
    public suspend fun appliesToAllProtectedBranches(`value`: Output) {
        this.appliesToAllProtectedBranches = value
    }

    /**
     * @param value The number of approvals required for this rule.
     */
    @JvmName("jmyqiygitaghqtxw")
    public suspend fun approvalsRequired(`value`: Output) {
        this.approvalsRequired = value
    }

    /**
     * @param value When this flag is set, the default `any_approver` rule will not be imported if present.
     */
    @JvmName("leurfvuxqqnomltp")
    public suspend fun disableImportingDefaultAnyApproverRuleOnCreate(`value`: Output) {
        this.disableImportingDefaultAnyApproverRuleOnCreate = value
    }

    /**
     * @param value A list of group IDs whose members can approve of the merge request.
     */
    @JvmName("lkysyipehgrmakml")
    public suspend fun groupIds(`value`: Output>) {
        this.groupIds = value
    }

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

    /**
     * @param values A list of group IDs whose members can approve of the merge request.
     */
    @JvmName("cxsvxdteahqaqnwl")
    public suspend fun groupIds(values: List>) {
        this.groupIds = Output.all(values)
    }

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

    /**
     * @param value The name or id of the project to add the approval rules.
     */
    @JvmName("fkrmdagenjnwbokd")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value A list of protected branch IDs (not branch names) for which the rule applies.
     */
    @JvmName("ayedoohvyroeccou")
    public suspend fun protectedBranchIds(`value`: Output>) {
        this.protectedBranchIds = value
    }

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

    /**
     * @param values A list of protected branch IDs (not branch names) for which the rule applies.
     */
    @JvmName("xauckftydeeqsalh")
    public suspend fun protectedBranchIds(values: List>) {
        this.protectedBranchIds = Output.all(values)
    }

    /**
     * @param value String, defaults to 'regular'. The type of rule. `any_approver` is a pre-configured default rule with `approvals_required` at `0`. Valid values are `regular`, `any_approver`.
     */
    @JvmName("vocgtnrfbxxkmpfd")
    public suspend fun ruleType(`value`: Output) {
        this.ruleType = value
    }

    /**
     * @param value A list of specific User IDs to add to the list of approvers.
     */
    @JvmName("qqcxqhlefhmhjnlo")
    public suspend fun userIds(`value`: Output>) {
        this.userIds = value
    }

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

    /**
     * @param values A list of specific User IDs to add to the list of approvers.
     */
    @JvmName("rcigryuenrlfwiik")
    public suspend fun userIds(values: List>) {
        this.userIds = Output.all(values)
    }

    /**
     * @param value Whether the rule is applied to all protected branches. If set to 'true', the value of `protected_branch_ids` is ignored. Default is 'false'.
     */
    @JvmName("bugoytqgsmpmucih")
    public suspend fun appliesToAllProtectedBranches(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.appliesToAllProtectedBranches = mapped
    }

    /**
     * @param value The number of approvals required for this rule.
     */
    @JvmName("qgorkistivmjthrg")
    public suspend fun approvalsRequired(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.approvalsRequired = mapped
    }

    /**
     * @param value When this flag is set, the default `any_approver` rule will not be imported if present.
     */
    @JvmName("fllqefxftkjoqljt")
    public suspend fun disableImportingDefaultAnyApproverRuleOnCreate(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disableImportingDefaultAnyApproverRuleOnCreate = mapped
    }

    /**
     * @param value A list of group IDs whose members can approve of the merge request.
     */
    @JvmName("vrmptprpsfmigovm")
    public suspend fun groupIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.groupIds = mapped
    }

    /**
     * @param values A list of group IDs whose members can approve of the merge request.
     */
    @JvmName("reykeghgedxakefk")
    public suspend fun groupIds(vararg values: Int) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.groupIds = mapped
    }

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

    /**
     * @param value The name or id of the project to add the approval rules.
     */
    @JvmName("rjrrpcandoveyyvu")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value A list of protected branch IDs (not branch names) for which the rule applies.
     */
    @JvmName("hfemowjtqxjskywl")
    public suspend fun protectedBranchIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protectedBranchIds = mapped
    }

    /**
     * @param values A list of protected branch IDs (not branch names) for which the rule applies.
     */
    @JvmName("udckthcdwpbybtyu")
    public suspend fun protectedBranchIds(vararg values: Int) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protectedBranchIds = mapped
    }

    /**
     * @param value String, defaults to 'regular'. The type of rule. `any_approver` is a pre-configured default rule with `approvals_required` at `0`. Valid values are `regular`, `any_approver`.
     */
    @JvmName("ddxrnhjwarxjvcdb")
    public suspend fun ruleType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleType = mapped
    }

    /**
     * @param value A list of specific User IDs to add to the list of approvers.
     */
    @JvmName("giwboprdaucgauhy")
    public suspend fun userIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.userIds = mapped
    }

    /**
     * @param values A list of specific User IDs to add to the list of approvers.
     */
    @JvmName("wxdsfuwxnyilrqxr")
    public suspend fun userIds(vararg values: Int) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.userIds = mapped
    }

    internal fun build(): ProjectApprovalRuleArgs = ProjectApprovalRuleArgs(
        appliesToAllProtectedBranches = appliesToAllProtectedBranches,
        approvalsRequired = approvalsRequired,
        disableImportingDefaultAnyApproverRuleOnCreate = disableImportingDefaultAnyApproverRuleOnCreate,
        groupIds = groupIds,
        name = name,
        project = project,
        protectedBranchIds = protectedBranchIds,
        ruleType = ruleType,
        userIds = userIds,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy