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

com.pulumi.kubernetes.flowcontrol.v1beta3.kotlin.inputs.PolicyRulesWithSubjectsPatchArgs.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.flowcontrol.v1beta3.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import com.pulumi.kubernetes.flowcontrol.v1beta3.inputs.PolicyRulesWithSubjectsPatchArgs.builder
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request.
 * @property nonResourceRules `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.
 * @property resourceRules `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
 * @property subjects subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.
 */
public data class PolicyRulesWithSubjectsPatchArgs(
    public val nonResourceRules: Output>? = null,
    public val resourceRules: Output>? = null,
    public val subjects: Output>? = null,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.flowcontrol.v1beta3.inputs.PolicyRulesWithSubjectsPatchArgs =
        com.pulumi.kubernetes.flowcontrol.v1beta3.inputs.PolicyRulesWithSubjectsPatchArgs.builder()
            .nonResourceRules(
                nonResourceRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .resourceRules(
                resourceRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .subjects(
                subjects?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

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

    private var resourceRules: Output>? = null

    private var subjects: Output>? = null

    /**
     * @param value `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.
     */
    @JvmName("iarkogqqxvuihkpd")
    public suspend fun nonResourceRules(`value`: Output>) {
        this.nonResourceRules = value
    }

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

    /**
     * @param values `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.
     */
    @JvmName("dhwisajbddrkwror")
    public suspend fun nonResourceRules(values: List>) {
        this.nonResourceRules = Output.all(values)
    }

    /**
     * @param value `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
     */
    @JvmName("jvsqmnonsfqvtyiw")
    public suspend fun resourceRules(`value`: Output>) {
        this.resourceRules = value
    }

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

    /**
     * @param values `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
     */
    @JvmName("fmkgxifjbfwqegnn")
    public suspend fun resourceRules(values: List>) {
        this.resourceRules = Output.all(values)
    }

    /**
     * @param value subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.
     */
    @JvmName("olsgrxwbpxbxsotq")
    public suspend fun subjects(`value`: Output>) {
        this.subjects = value
    }

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

    /**
     * @param values subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.
     */
    @JvmName("rqmwsfapihxtoljy")
    public suspend fun subjects(values: List>) {
        this.subjects = Output.all(values)
    }

    /**
     * @param value `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.
     */
    @JvmName("paalnpghnvokmqqf")
    public suspend fun nonResourceRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nonResourceRules = mapped
    }

    /**
     * @param argument `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.
     */
    @JvmName("tljxukqanefhujbm")
    public suspend fun nonResourceRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NonResourcePolicyRulePatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.nonResourceRules = mapped
    }

    /**
     * @param argument `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.
     */
    @JvmName("mtpeqoimhoahljcv")
    public suspend fun nonResourceRules(vararg argument: suspend NonResourcePolicyRulePatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            NonResourcePolicyRulePatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.nonResourceRules = mapped
    }

    /**
     * @param argument `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.
     */
    @JvmName("jxtbsfgwdyndrhqc")
    public suspend fun nonResourceRules(argument: suspend NonResourcePolicyRulePatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            NonResourcePolicyRulePatchArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.nonResourceRules = mapped
    }

    /**
     * @param values `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.
     */
    @JvmName("xoojbsxyoqjubadx")
    public suspend fun nonResourceRules(vararg values: NonResourcePolicyRulePatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.nonResourceRules = mapped
    }

    /**
     * @param value `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
     */
    @JvmName("baowqcmrvgoopnil")
    public suspend fun resourceRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceRules = mapped
    }

    /**
     * @param argument `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
     */
    @JvmName("rfhgkuvyawofgkmx")
    public suspend fun resourceRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ResourcePolicyRulePatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.resourceRules = mapped
    }

    /**
     * @param argument `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
     */
    @JvmName("pxxbuiebahecgpui")
    public suspend fun resourceRules(vararg argument: suspend ResourcePolicyRulePatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ResourcePolicyRulePatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.resourceRules = mapped
    }

    /**
     * @param argument `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
     */
    @JvmName("tgkqmuuvsdrfnqhs")
    public suspend fun resourceRules(argument: suspend ResourcePolicyRulePatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ResourcePolicyRulePatchArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.resourceRules = mapped
    }

    /**
     * @param values `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
     */
    @JvmName("bbjvxojfeqlkjbwy")
    public suspend fun resourceRules(vararg values: ResourcePolicyRulePatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resourceRules = mapped
    }

    /**
     * @param value subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.
     */
    @JvmName("xrfpluibdobibyub")
    public suspend fun subjects(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subjects = mapped
    }

    /**
     * @param argument subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.
     */
    @JvmName("ngsawbubklelmhoc")
    public suspend fun subjects(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            SubjectPatchArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.subjects = mapped
    }

    /**
     * @param argument subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.
     */
    @JvmName("dconeabqkybdygpy")
    public suspend fun subjects(vararg argument: suspend SubjectPatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            SubjectPatchArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.subjects = mapped
    }

    /**
     * @param argument subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.
     */
    @JvmName("trlkxbtwciupkdec")
    public suspend fun subjects(argument: suspend SubjectPatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SubjectPatchArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.subjects = mapped
    }

    /**
     * @param values subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.
     */
    @JvmName("ghwwuooaksgyobxa")
    public suspend fun subjects(vararg values: SubjectPatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.subjects = mapped
    }

    internal fun build(): PolicyRulesWithSubjectsPatchArgs = PolicyRulesWithSubjectsPatchArgs(
        nonResourceRules = nonResourceRules,
        resourceRules = resourceRules,
        subjects = subjects,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy