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

com.pulumi.kubernetes.flowcontrol.v1alpha1.kotlin.inputs.FlowSchemaSpecArgs.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.v1alpha1.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.v1alpha1.inputs.FlowSchemaSpecArgs.builder
import kotlin.Int
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * FlowSchemaSpec describes how the FlowSchema's specification looks like.
 * @property distinguisherMethod `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
 * @property matchingPrecedence `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence.  Each MatchingPrecedence value must be non-negative. Note that if the precedence is not specified or zero, it will be set to 1000 as default.
 * @property priorityLevelConfiguration `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.
 * @property rules `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
 */
public data class FlowSchemaSpecArgs(
    public val distinguisherMethod: Output? = null,
    public val matchingPrecedence: Output? = null,
    public val priorityLevelConfiguration: Output,
    public val rules: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.flowcontrol.v1alpha1.inputs.FlowSchemaSpecArgs =
        com.pulumi.kubernetes.flowcontrol.v1alpha1.inputs.FlowSchemaSpecArgs.builder()
            .distinguisherMethod(
                distinguisherMethod?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .matchingPrecedence(matchingPrecedence?.applyValue({ args0 -> args0 }))
            .priorityLevelConfiguration(
                priorityLevelConfiguration.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .rules(
                rules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [FlowSchemaSpecArgs].
 */
@PulumiTagMarker
public class FlowSchemaSpecArgsBuilder internal constructor() {
    private var distinguisherMethod: Output? = null

    private var matchingPrecedence: Output? = null

    private var priorityLevelConfiguration: Output? = null

    private var rules: Output>? = null

    /**
     * @param value `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
     */
    @JvmName("lkvqelwlmoiivssq")
    public suspend fun distinguisherMethod(`value`: Output) {
        this.distinguisherMethod = value
    }

    /**
     * @param value `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence.  Each MatchingPrecedence value must be non-negative. Note that if the precedence is not specified or zero, it will be set to 1000 as default.
     */
    @JvmName("bwwpgobcjvtmeqrm")
    public suspend fun matchingPrecedence(`value`: Output) {
        this.matchingPrecedence = value
    }

    /**
     * @param value `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.
     */
    @JvmName("klaagxiymbdmrcwy")
    public suspend fun priorityLevelConfiguration(`value`: Output) {
        this.priorityLevelConfiguration = value
    }

    /**
     * @param value `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     */
    @JvmName("cjtybapxauhmyndp")
    public suspend fun rules(`value`: Output>) {
        this.rules = value
    }

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

    /**
     * @param values `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     */
    @JvmName("lhbapdrmtnxybytw")
    public suspend fun rules(values: List>) {
        this.rules = Output.all(values)
    }

    /**
     * @param value `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
     */
    @JvmName("ejfdrywvenaqeqro")
    public suspend fun distinguisherMethod(`value`: FlowDistinguisherMethodArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.distinguisherMethod = mapped
    }

    /**
     * @param argument `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
     */
    @JvmName("odkibyxanmtxmkbe")
    public suspend fun distinguisherMethod(argument: suspend FlowDistinguisherMethodArgsBuilder.() -> Unit) {
        val toBeMapped = FlowDistinguisherMethodArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.distinguisherMethod = mapped
    }

    /**
     * @param value `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence.  Each MatchingPrecedence value must be non-negative. Note that if the precedence is not specified or zero, it will be set to 1000 as default.
     */
    @JvmName("kmbylgndgupbynya")
    public suspend fun matchingPrecedence(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.matchingPrecedence = mapped
    }

    /**
     * @param value `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.
     */
    @JvmName("nuxbwhqmogrvrwgb")
    public suspend fun priorityLevelConfiguration(`value`: PriorityLevelConfigurationReferenceArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.priorityLevelConfiguration = mapped
    }

    /**
     * @param argument `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.
     */
    @JvmName("lajlokkyvfyjovgw")
    public suspend fun priorityLevelConfiguration(argument: suspend PriorityLevelConfigurationReferenceArgsBuilder.() -> Unit) {
        val toBeMapped = PriorityLevelConfigurationReferenceArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.priorityLevelConfiguration = mapped
    }

    /**
     * @param value `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     */
    @JvmName("qtkfqnkhnpuhxjld")
    public suspend fun rules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param argument `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     */
    @JvmName("fibicyuknnafiwvi")
    public suspend fun rules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            PolicyRulesWithSubjectsArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     */
    @JvmName("podbkneewrfbfedt")
    public suspend fun rules(vararg argument: suspend PolicyRulesWithSubjectsArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            PolicyRulesWithSubjectsArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     */
    @JvmName("oteadndlnfkvvtms")
    public suspend fun rules(argument: suspend PolicyRulesWithSubjectsArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            PolicyRulesWithSubjectsArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param values `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     */
    @JvmName("ahyxaynvugfitkhh")
    public suspend fun rules(vararg values: PolicyRulesWithSubjectsArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    internal fun build(): FlowSchemaSpecArgs = FlowSchemaSpecArgs(
        distinguisherMethod = distinguisherMethod,
        matchingPrecedence = matchingPrecedence,
        priorityLevelConfiguration = priorityLevelConfiguration ?: throw
            PulumiNullFieldException("priorityLevelConfiguration"),
        rules = rules,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy