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

com.pulumi.kubernetes.admissionregistration.v1beta1.kotlin.inputs.ValidatingAdmissionPolicySpecPatchArgs.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.admissionregistration.v1beta1.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.admissionregistration.v1beta1.inputs.ValidatingAdmissionPolicySpecPatchArgs.builder
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
 * @property auditAnnotations auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
 * @property failurePolicy failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
 * A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
 * failurePolicy does not define how validations that evaluate to false are handled.
 * When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
 * Allowed values are Ignore or Fail. Defaults to Fail.
 * @property matchConditions MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
 * If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
 * The exact matching logic is (in order):
 *   1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
 *   2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
 *   3. If any matchCondition evaluates to an error (but none are FALSE):
 *      - If failurePolicy=Fail, reject the request
 *      - If failurePolicy=Ignore, the policy is skipped
 * @property matchConstraints MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding. Required.
 * @property paramKind ParamKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
 * @property validations Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
 * @property variables Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
 * The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
 */
public data class ValidatingAdmissionPolicySpecPatchArgs(
    public val auditAnnotations: Output>? = null,
    public val failurePolicy: Output? = null,
    public val matchConditions: Output>? = null,
    public val matchConstraints: Output? = null,
    public val paramKind: Output? = null,
    public val validations: Output>? = null,
    public val variables: Output>? = null,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.admissionregistration.v1beta1.inputs.ValidatingAdmissionPolicySpecPatchArgs =
        com.pulumi.kubernetes.admissionregistration.v1beta1.inputs.ValidatingAdmissionPolicySpecPatchArgs.builder()
            .auditAnnotations(
                auditAnnotations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .failurePolicy(failurePolicy?.applyValue({ args0 -> args0 }))
            .matchConditions(
                matchConditions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .matchConstraints(matchConstraints?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .paramKind(paramKind?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .validations(
                validations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .variables(
                variables?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

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

    private var failurePolicy: Output? = null

    private var matchConditions: Output>? = null

    private var matchConstraints: Output? = null

    private var paramKind: Output? = null

    private var validations: Output>? = null

    private var variables: Output>? = null

    /**
     * @param value auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
     */
    @JvmName("cvemwmrkckjykwnf")
    public suspend fun auditAnnotations(`value`: Output>) {
        this.auditAnnotations = value
    }

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

    /**
     * @param values auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
     */
    @JvmName("lwhvmbboejrsojaj")
    public suspend fun auditAnnotations(values: List>) {
        this.auditAnnotations = Output.all(values)
    }

    /**
     * @param value failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
     * A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
     * failurePolicy does not define how validations that evaluate to false are handled.
     * When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
     * Allowed values are Ignore or Fail. Defaults to Fail.
     */
    @JvmName("kcrjcbfjgibtncsp")
    public suspend fun failurePolicy(`value`: Output) {
        this.failurePolicy = value
    }

    /**
     * @param value MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
     * If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
     * The exact matching logic is (in order):
     *   1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
     *   2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
     *   3. If any matchCondition evaluates to an error (but none are FALSE):
     *      - If failurePolicy=Fail, reject the request
     *      - If failurePolicy=Ignore, the policy is skipped
     */
    @JvmName("swwfkfhrgmxtgwfl")
    public suspend fun matchConditions(`value`: Output>) {
        this.matchConditions = value
    }

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

    /**
     * @param values MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
     * If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
     * The exact matching logic is (in order):
     *   1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
     *   2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
     *   3. If any matchCondition evaluates to an error (but none are FALSE):
     *      - If failurePolicy=Fail, reject the request
     *      - If failurePolicy=Ignore, the policy is skipped
     */
    @JvmName("rmcorunsodbdloqt")
    public suspend fun matchConditions(values: List>) {
        this.matchConditions = Output.all(values)
    }

    /**
     * @param value MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding. Required.
     */
    @JvmName("nbwsmwgnvhcedeaf")
    public suspend fun matchConstraints(`value`: Output) {
        this.matchConstraints = value
    }

    /**
     * @param value ParamKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
     */
    @JvmName("krwijpntebsdnuat")
    public suspend fun paramKind(`value`: Output) {
        this.paramKind = value
    }

    /**
     * @param value Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
     */
    @JvmName("spitvhuyafudmwyv")
    public suspend fun validations(`value`: Output>) {
        this.validations = value
    }

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

    /**
     * @param values Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
     */
    @JvmName("vwdnccqngdewxedj")
    public suspend fun validations(values: List>) {
        this.validations = Output.all(values)
    }

    /**
     * @param value Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
     * The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
     */
    @JvmName("jlsufqkppvevgvkq")
    public suspend fun variables(`value`: Output>) {
        this.variables = value
    }

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

    /**
     * @param values Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
     * The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
     */
    @JvmName("qnndxawcrundhqfl")
    public suspend fun variables(values: List>) {
        this.variables = Output.all(values)
    }

    /**
     * @param value auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
     */
    @JvmName("phfbnfwdbnudbnoa")
    public suspend fun auditAnnotations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.auditAnnotations = mapped
    }

    /**
     * @param argument auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
     */
    @JvmName("uivbbpikreqrcqib")
    public suspend fun auditAnnotations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AuditAnnotationPatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.auditAnnotations = mapped
    }

    /**
     * @param argument auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
     */
    @JvmName("ershalcslyoneerm")
    public suspend fun auditAnnotations(vararg argument: suspend AuditAnnotationPatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AuditAnnotationPatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.auditAnnotations = mapped
    }

    /**
     * @param argument auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
     */
    @JvmName("whfqtewdwuvekgbx")
    public suspend fun auditAnnotations(argument: suspend AuditAnnotationPatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AuditAnnotationPatchArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.auditAnnotations = mapped
    }

    /**
     * @param values auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is required.
     */
    @JvmName("xhdsuvtamklxebgt")
    public suspend fun auditAnnotations(vararg values: AuditAnnotationPatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.auditAnnotations = mapped
    }

    /**
     * @param value failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.
     * A policy is invalid if spec.paramKind refers to a non-existent Kind. A binding is invalid if spec.paramRef.name refers to a non-existent resource.
     * failurePolicy does not define how validations that evaluate to false are handled.
     * When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions define how failures are enforced.
     * Allowed values are Ignore or Fail. Defaults to Fail.
     */
    @JvmName("xvvvpscmjtamfhdj")
    public suspend fun failurePolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failurePolicy = mapped
    }

    /**
     * @param value MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
     * If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
     * The exact matching logic is (in order):
     *   1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
     *   2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
     *   3. If any matchCondition evaluates to an error (but none are FALSE):
     *      - If failurePolicy=Fail, reject the request
     *      - If failurePolicy=Ignore, the policy is skipped
     */
    @JvmName("luvcupsudmmsdxbh")
    public suspend fun matchConditions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.matchConditions = mapped
    }

    /**
     * @param argument MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
     * If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
     * The exact matching logic is (in order):
     *   1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
     *   2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
     *   3. If any matchCondition evaluates to an error (but none are FALSE):
     *      - If failurePolicy=Fail, reject the request
     *      - If failurePolicy=Ignore, the policy is skipped
     */
    @JvmName("mhkxinylmqhihbjt")
    public suspend fun matchConditions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            MatchConditionPatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param argument MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
     * If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
     * The exact matching logic is (in order):
     *   1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
     *   2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
     *   3. If any matchCondition evaluates to an error (but none are FALSE):
     *      - If failurePolicy=Fail, reject the request
     *      - If failurePolicy=Ignore, the policy is skipped
     */
    @JvmName("npyiholbbxhujkga")
    public suspend fun matchConditions(vararg argument: suspend MatchConditionPatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            MatchConditionPatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param argument MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
     * If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
     * The exact matching logic is (in order):
     *   1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
     *   2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
     *   3. If any matchCondition evaluates to an error (but none are FALSE):
     *      - If failurePolicy=Fail, reject the request
     *      - If failurePolicy=Ignore, the policy is skipped
     */
    @JvmName("xmkxjpovsynvqxrh")
    public suspend fun matchConditions(argument: suspend MatchConditionPatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(MatchConditionPatchArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param values MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
     * If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
     * The exact matching logic is (in order):
     *   1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
     *   2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
     *   3. If any matchCondition evaluates to an error (but none are FALSE):
     *      - If failurePolicy=Fail, reject the request
     *      - If failurePolicy=Ignore, the policy is skipped
     */
    @JvmName("veqsbseecjbxrefd")
    public suspend fun matchConditions(vararg values: MatchConditionPatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matchConditions = mapped
    }

    /**
     * @param value MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding. Required.
     */
    @JvmName("adnsuibrqmbwchnl")
    public suspend fun matchConstraints(`value`: MatchResourcesPatchArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.matchConstraints = mapped
    }

    /**
     * @param argument MatchConstraints specifies what resources this policy is designed to validate. The AdmissionPolicy cares about a request if it matches _all_ Constraints. However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding. Required.
     */
    @JvmName("kdvhcqbxjtllmyqj")
    public suspend fun matchConstraints(argument: suspend MatchResourcesPatchArgsBuilder.() -> Unit) {
        val toBeMapped = MatchResourcesPatchArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.matchConstraints = mapped
    }

    /**
     * @param value ParamKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
     */
    @JvmName("djhqigjfxiwttdek")
    public suspend fun paramKind(`value`: ParamKindPatchArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.paramKind = mapped
    }

    /**
     * @param argument ParamKind specifies the kind of resources used to parameterize this policy. If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions. If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied. If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
     */
    @JvmName("mfqjqgjpwwwmikkj")
    public suspend fun paramKind(argument: suspend ParamKindPatchArgsBuilder.() -> Unit) {
        val toBeMapped = ParamKindPatchArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.paramKind = mapped
    }

    /**
     * @param value Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
     */
    @JvmName("gefgxuuupsnsjbby")
    public suspend fun validations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.validations = mapped
    }

    /**
     * @param argument Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
     */
    @JvmName("cvrobaoddsnrcvbq")
    public suspend fun validations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ValidationPatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.validations = mapped
    }

    /**
     * @param argument Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
     */
    @JvmName("frbfvmylxjlwcwdn")
    public suspend fun validations(vararg argument: suspend ValidationPatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ValidationPatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.validations = mapped
    }

    /**
     * @param argument Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
     */
    @JvmName("kcyghxeboatduaiq")
    public suspend fun validations(argument: suspend ValidationPatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ValidationPatchArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.validations = mapped
    }

    /**
     * @param values Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
     */
    @JvmName("ggfkgswqysqdohgb")
    public suspend fun validations(vararg values: ValidationPatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.validations = mapped
    }

    /**
     * @param value Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
     * The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
     */
    @JvmName("cubjipxasivuafpb")
    public suspend fun variables(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.variables = mapped
    }

    /**
     * @param argument Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
     * The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
     */
    @JvmName("ohsrsnrnohjomxwi")
    public suspend fun variables(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            VariablePatchArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.variables = mapped
    }

    /**
     * @param argument Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
     * The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
     */
    @JvmName("qkmichsnimgnywbh")
    public suspend fun variables(vararg argument: suspend VariablePatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            VariablePatchArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.variables = mapped
    }

    /**
     * @param argument Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
     * The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
     */
    @JvmName("vcaqxytejqbhomqr")
    public suspend fun variables(argument: suspend VariablePatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(VariablePatchArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.variables = mapped
    }

    /**
     * @param values Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy.
     * The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
     */
    @JvmName("tyyomxfaxautdqws")
    public suspend fun variables(vararg values: VariablePatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.variables = mapped
    }

    internal fun build(): ValidatingAdmissionPolicySpecPatchArgs =
        ValidatingAdmissionPolicySpecPatchArgs(
            auditAnnotations = auditAnnotations,
            failurePolicy = failurePolicy,
            matchConditions = matchConditions,
            matchConstraints = matchConstraints,
            paramKind = paramKind,
            validations = validations,
            variables = variables,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy