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

com.pulumi.kubernetes.flowcontrol.v1beta2.kotlin.inputs.PolicyRulesWithSubjectsArgs.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: 4.18.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

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

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import com.pulumi.kubernetes.flowcontrol.v1beta2.inputs.PolicyRulesWithSubjectsArgs.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 PolicyRulesWithSubjectsArgs(
    public val nonResourceRules: Output>? = null,
    public val resourceRules: Output>? = null,
    public val subjects: Output>,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.flowcontrol.v1beta2.inputs.PolicyRulesWithSubjectsArgs =
        com.pulumi.kubernetes.flowcontrol.v1beta2.inputs.PolicyRulesWithSubjectsArgs.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 [PolicyRulesWithSubjectsArgs].
 */
@PulumiTagMarker
public class PolicyRulesWithSubjectsArgsBuilder 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("bistuxuvuotlhonh")
    public suspend fun nonResourceRules(`value`: Output>) {
        this.nonResourceRules = value
    }

    @JvmName("sruewmmbylknfbmp")
    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("rciifdgkpuninmxh")
    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("ylwxladcivadcssy")
    public suspend fun resourceRules(`value`: Output>) {
        this.resourceRules = value
    }

    @JvmName("tuglhapshxtykhwh")
    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("wqwgxwnybqpwkcmc")
    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("orhoeiylmvrawyaw")
    public suspend fun subjects(`value`: Output>) {
        this.subjects = value
    }

    @JvmName("fqibrqhfcrlmbhkk")
    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("asituvliffbdeuyt")
    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("wfqomeyqdvotbqyq")
    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("qfoursegeeolahxv")
    public suspend fun nonResourceRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NonResourcePolicyRuleArgsBuilder().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("magltpawviwhssvx")
    public suspend fun nonResourceRules(vararg argument: suspend NonResourcePolicyRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            NonResourcePolicyRuleArgsBuilder().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("rhycgswwfispsgvv")
    public suspend fun nonResourceRules(argument: suspend NonResourcePolicyRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(NonResourcePolicyRuleArgsBuilder().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("wooguygfftplrakl")
    public suspend fun nonResourceRules(vararg values: NonResourcePolicyRuleArgs) {
        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("pxaecpitmyloiutk")
    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("mocumawjtxqqdnka")
    public suspend fun resourceRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ResourcePolicyRuleArgsBuilder().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("qdcrskdppdoynroq")
    public suspend fun resourceRules(vararg argument: suspend ResourcePolicyRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ResourcePolicyRuleArgsBuilder().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("mvmpdjsxegdghaay")
    public suspend fun resourceRules(argument: suspend ResourcePolicyRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ResourcePolicyRuleArgsBuilder().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("rvxgjubrciotknhk")
    public suspend fun resourceRules(vararg values: ResourcePolicyRuleArgs) {
        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("thkjumqpnfkcduos")
    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("xjptokpdngjoubfs")
    public suspend fun subjects(argument: List Unit>) {
        val toBeMapped = argument.toList().map { SubjectArgsBuilder().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("tcnwsngjitlwhirt")
    public suspend fun subjects(vararg argument: suspend SubjectArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { SubjectArgsBuilder().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("euckdstknvqqtkle")
    public suspend fun subjects(argument: suspend SubjectArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SubjectArgsBuilder().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("mhgfvvnyjucdtwpw")
    public suspend fun subjects(vararg values: SubjectArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.subjects = mapped
    }

    internal fun build(): PolicyRulesWithSubjectsArgs = PolicyRulesWithSubjectsArgs(
        nonResourceRules = nonResourceRules,
        resourceRules = resourceRules,
        subjects = subjects ?: throw PulumiNullFieldException("subjects"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy