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

com.pulumi.gcp.orgpolicy.kotlin.outputs.PolicySpecRule.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.orgpolicy.kotlin.outputs

import kotlin.String
import kotlin.Suppress

/**
 *
 * @property allowAll Setting this to `"TRUE"` means that all values are allowed. This field can be set only in Policies for list constraints.
 * @property condition A condition which determines whether this rule is used in the evaluation of the policy. When set, the `expression` field in the `Expr' must include from 1 to 10 subexpressions, joined by the "||" or "&&" operators. Each subexpression must be of the form "resource.matchTag('/tag_key_short_name, 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', 'tagValues/value_id')". where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Tag Manager Service. An example expression is: "resource.matchTag('123456789/environment, 'prod')". or "resource.matchTagId('tagKeys/123', 'tagValues/456')".
 * @property denyAll Setting this to `"TRUE"` means that all values are denied. This field can be set only in Policies for list constraints.
 * @property enforce If `"TRUE"`, then the `Policy` is enforced. If `"FALSE"`, then any configuration is acceptable. This field can be set only in Policies for boolean constraints.
 * @property values List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints.
 */
public data class PolicySpecRule(
    public val allowAll: String? = null,
    public val condition: PolicySpecRuleCondition? = null,
    public val denyAll: String? = null,
    public val enforce: String? = null,
    public val values: PolicySpecRuleValues? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.gcp.orgpolicy.outputs.PolicySpecRule): PolicySpecRule =
            PolicySpecRule(
                allowAll = javaType.allowAll().map({ args0 -> args0 }).orElse(null),
                condition = javaType.condition().map({ args0 ->
                    args0.let({ args0 ->
                        com.pulumi.gcp.orgpolicy.kotlin.outputs.PolicySpecRuleCondition.Companion.toKotlin(args0)
                    })
                }).orElse(null),
                denyAll = javaType.denyAll().map({ args0 -> args0 }).orElse(null),
                enforce = javaType.enforce().map({ args0 -> args0 }).orElse(null),
                values = javaType.values().map({ args0 ->
                    args0.let({ args0 ->
                        com.pulumi.gcp.orgpolicy.kotlin.outputs.PolicySpecRuleValues.Companion.toKotlin(args0)
                    })
                }).orElse(null),
            )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy