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

com.pulumi.kubernetes.flowcontrol.v1beta2.kotlin.inputs.ResourcePolicyRuleArgs.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.kubernetes.flowcontrol.v1beta2.inputs.ResourcePolicyRuleArgs.builder
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) either (d1) the request does not specify a namespace (i.e., `Namespace==""`) and clusterScope is true or (d2) the request specifies a namespace and least one member of namespaces matches the request's namespace.
 * @property apiGroups `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
 * @property clusterScope `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.
 * @property namespaces `namespaces` is a list of target namespaces that restricts matches.  A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*".  Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
 * @property resources `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource.  For example, [ "services", "nodes/status" ].  This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
 * @property verbs `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
 */
public data class ResourcePolicyRuleArgs(
    public val apiGroups: Output>,
    public val clusterScope: Output? = null,
    public val namespaces: Output>? = null,
    public val resources: Output>,
    public val verbs: Output>,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.flowcontrol.v1beta2.inputs.ResourcePolicyRuleArgs =
        com.pulumi.kubernetes.flowcontrol.v1beta2.inputs.ResourcePolicyRuleArgs.builder()
            .apiGroups(apiGroups.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .clusterScope(clusterScope?.applyValue({ args0 -> args0 }))
            .namespaces(namespaces?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .resources(resources.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .verbs(verbs.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

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

    private var clusterScope: Output? = null

    private var namespaces: Output>? = null

    private var resources: Output>? = null

    private var verbs: Output>? = null

    /**
     * @param value `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
     */
    @JvmName("dynaawrlpmjfyioy")
    public suspend fun apiGroups(`value`: Output>) {
        this.apiGroups = value
    }

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

    /**
     * @param values `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
     */
    @JvmName("ndmewysuocmaeodm")
    public suspend fun apiGroups(values: List>) {
        this.apiGroups = Output.all(values)
    }

    /**
     * @param value `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.
     */
    @JvmName("pwclsggustbgvnln")
    public suspend fun clusterScope(`value`: Output) {
        this.clusterScope = value
    }

    /**
     * @param value `namespaces` is a list of target namespaces that restricts matches.  A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*".  Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
     */
    @JvmName("bgwkblikgibcweqg")
    public suspend fun namespaces(`value`: Output>) {
        this.namespaces = value
    }

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

    /**
     * @param values `namespaces` is a list of target namespaces that restricts matches.  A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*".  Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
     */
    @JvmName("srmurbrjnrtwrwqo")
    public suspend fun namespaces(values: List>) {
        this.namespaces = Output.all(values)
    }

    /**
     * @param value `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource.  For example, [ "services", "nodes/status" ].  This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
     */
    @JvmName("dyvqqepwkjyutcrn")
    public suspend fun resources(`value`: Output>) {
        this.resources = value
    }

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

    /**
     * @param values `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource.  For example, [ "services", "nodes/status" ].  This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
     */
    @JvmName("ggcmowdhwlckyyul")
    public suspend fun resources(values: List>) {
        this.resources = Output.all(values)
    }

    /**
     * @param value `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
     */
    @JvmName("ygwrlfarvmkwnofg")
    public suspend fun verbs(`value`: Output>) {
        this.verbs = value
    }

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

    /**
     * @param values `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
     */
    @JvmName("cdoofdvjvvtauvuj")
    public suspend fun verbs(values: List>) {
        this.verbs = Output.all(values)
    }

    /**
     * @param value `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
     */
    @JvmName("jcoysmfmvydwlnis")
    public suspend fun apiGroups(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.apiGroups = mapped
    }

    /**
     * @param values `apiGroups` is a list of matching API groups and may not be empty. "*" matches all API groups and, if present, must be the only entry. Required.
     */
    @JvmName("vsmvvdfoiscldvci")
    public suspend fun apiGroups(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.apiGroups = mapped
    }

    /**
     * @param value `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.
     */
    @JvmName("soajbeluleakhxcm")
    public suspend fun clusterScope(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterScope = mapped
    }

    /**
     * @param value `namespaces` is a list of target namespaces that restricts matches.  A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*".  Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
     */
    @JvmName("khkiheekbetmcqqx")
    public suspend fun namespaces(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namespaces = mapped
    }

    /**
     * @param values `namespaces` is a list of target namespaces that restricts matches.  A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains "*".  Note that "*" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.
     */
    @JvmName("tnvcqvevjamscirp")
    public suspend fun namespaces(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.namespaces = mapped
    }

    /**
     * @param value `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource.  For example, [ "services", "nodes/status" ].  This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
     */
    @JvmName("kfpnouiicloyuoqw")
    public suspend fun resources(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resources = mapped
    }

    /**
     * @param values `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource.  For example, [ "services", "nodes/status" ].  This list may not be empty. "*" matches all resources and, if present, must be the only entry. Required.
     */
    @JvmName("xpvjlugilaoaevxb")
    public suspend fun resources(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resources = mapped
    }

    /**
     * @param value `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
     */
    @JvmName("xulmgpufbqylqvki")
    public suspend fun verbs(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.verbs = mapped
    }

    /**
     * @param values `verbs` is a list of matching verbs and may not be empty. "*" matches all verbs and, if present, must be the only entry. Required.
     */
    @JvmName("rflvnhypnbjscmxw")
    public suspend fun verbs(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.verbs = mapped
    }

    internal fun build(): ResourcePolicyRuleArgs = ResourcePolicyRuleArgs(
        apiGroups = apiGroups ?: throw PulumiNullFieldException("apiGroups"),
        clusterScope = clusterScope,
        namespaces = namespaces,
        resources = resources ?: throw PulumiNullFieldException("resources"),
        verbs = verbs ?: throw PulumiNullFieldException("verbs"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy