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

com.pulumi.azurenative.devtestlab.kotlin.PolicyArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.devtestlab.kotlin

import com.pulumi.azurenative.devtestlab.PolicyArgs.builder
import com.pulumi.azurenative.devtestlab.kotlin.enums.PolicyEvaluatorType
import com.pulumi.azurenative.devtestlab.kotlin.enums.PolicyFactName
import com.pulumi.azurenative.devtestlab.kotlin.enums.PolicyStatus
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A Policy.
 * Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15.
 * Other available API versions: 2016-05-15.
 * ## Example Usage
 * ### Policies_CreateOrUpdate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var policy = new AzureNative.DevTestLab.Policy("policy", new()
 *     {
 *         Description = "{policyDescription}",
 *         EvaluatorType = "{policyEvaluatorType}",
 *         FactData = "{policyFactData}",
 *         FactName = "{policyFactName}",
 *         LabName = "{labName}",
 *         Location = "{location}",
 *         Name = "{policyName}",
 *         PolicySetName = "{policySetName}",
 *         ResourceGroupName = "resourceGroupName",
 *         Status = "{policyStatus}",
 *         Tags =
 *         {
 *             { "tagName1", "tagValue1" },
 *         },
 *         Threshold = "{policyThreshold}",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := devtestlab.NewPolicy(ctx, "policy", &devtestlab.PolicyArgs{
 * 			Description:       pulumi.String("{policyDescription}"),
 * 			EvaluatorType:     pulumi.String("{policyEvaluatorType}"),
 * 			FactData:          pulumi.String("{policyFactData}"),
 * 			FactName:          pulumi.String("{policyFactName}"),
 * 			LabName:           pulumi.String("{labName}"),
 * 			Location:          pulumi.String("{location}"),
 * 			Name:              pulumi.String("{policyName}"),
 * 			PolicySetName:     pulumi.String("{policySetName}"),
 * 			ResourceGroupName: pulumi.String("resourceGroupName"),
 * 			Status:            pulumi.String("{policyStatus}"),
 * 			Tags: pulumi.StringMap{
 * 				"tagName1": pulumi.String("tagValue1"),
 * 			},
 * 			Threshold: pulumi.String("{policyThreshold}"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.devtestlab.Policy;
 * import com.pulumi.azurenative.devtestlab.PolicyArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var policy = new Policy("policy", PolicyArgs.builder()
 *             .description("{policyDescription}")
 *             .evaluatorType("{policyEvaluatorType}")
 *             .factData("{policyFactData}")
 *             .factName("{policyFactName}")
 *             .labName("{labName}")
 *             .location("{location}")
 *             .name("{policyName}")
 *             .policySetName("{policySetName}")
 *             .resourceGroupName("resourceGroupName")
 *             .status("{policyStatus}")
 *             .tags(Map.of("tagName1", "tagValue1"))
 *             .threshold("{policyThreshold}")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:devtestlab:Policy {labName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}
 * ```
 * @property description The description of the policy.
 * @property evaluatorType The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
 * @property factData The fact data of the policy.
 * @property factName The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
 * @property labName The name of the lab.
 * @property location The location of the resource.
 * @property name The name of the policy.
 * @property policySetName The name of the policy set.
 * @property resourceGroupName The name of the resource group.
 * @property status The status of the policy.
 * @property tags The tags of the resource.
 * @property threshold The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
 */
public data class PolicyArgs(
    public val description: Output? = null,
    public val evaluatorType: Output>? = null,
    public val factData: Output? = null,
    public val factName: Output>? = null,
    public val labName: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val policySetName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val status: Output>? = null,
    public val tags: Output>? = null,
    public val threshold: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.devtestlab.PolicyArgs =
        com.pulumi.azurenative.devtestlab.PolicyArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .evaluatorType(
                evaluatorType?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .factData(factData?.applyValue({ args0 -> args0 }))
            .factName(
                factName?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .labName(labName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .policySetName(policySetName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .status(
                status?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .threshold(threshold?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [PolicyArgs].
 */
@PulumiTagMarker
public class PolicyArgsBuilder internal constructor() {
    private var description: Output? = null

    private var evaluatorType: Output>? = null

    private var factData: Output? = null

    private var factName: Output>? = null

    private var labName: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var policySetName: Output? = null

    private var resourceGroupName: Output? = null

    private var status: Output>? = null

    private var tags: Output>? = null

    private var threshold: Output? = null

    /**
     * @param value The description of the policy.
     */
    @JvmName("taoharoqsaqgpsme")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
     */
    @JvmName("qhgiofgjolwhbxqo")
    public suspend fun evaluatorType(`value`: Output>) {
        this.evaluatorType = value
    }

    /**
     * @param value The fact data of the policy.
     */
    @JvmName("qykkgdktfrxermqe")
    public suspend fun factData(`value`: Output) {
        this.factData = value
    }

    /**
     * @param value The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
     */
    @JvmName("ggpagatuneqgbsvc")
    public suspend fun factName(`value`: Output>) {
        this.factName = value
    }

    /**
     * @param value The name of the lab.
     */
    @JvmName("drityechkbkqvwxm")
    public suspend fun labName(`value`: Output) {
        this.labName = value
    }

    /**
     * @param value The location of the resource.
     */
    @JvmName("beckimxlofolphdp")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name of the policy.
     */
    @JvmName("xesnqchutfpxvfgh")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the policy set.
     */
    @JvmName("mdkjcepgpxsofbfm")
    public suspend fun policySetName(`value`: Output) {
        this.policySetName = value
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("gngrcxecmncfqwey")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The status of the policy.
     */
    @JvmName("itbcorrsoakgmysl")
    public suspend fun status(`value`: Output>) {
        this.status = value
    }

    /**
     * @param value The tags of the resource.
     */
    @JvmName("vdqlssqwirabguvx")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
     */
    @JvmName("yfsrkibysdmitydh")
    public suspend fun threshold(`value`: Output) {
        this.threshold = value
    }

    /**
     * @param value The description of the policy.
     */
    @JvmName("nqvetekcxhmsbstk")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
     */
    @JvmName("iwpgrpfdntxrhkan")
    public suspend fun evaluatorType(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.evaluatorType = mapped
    }

    /**
     * @param value The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
     */
    @JvmName("tbredtbbbyirofqh")
    public fun evaluatorType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.evaluatorType = mapped
    }

    /**
     * @param value The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
     */
    @JvmName("kgfwdxsvemwrqewv")
    public fun evaluatorType(`value`: PolicyEvaluatorType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.evaluatorType = mapped
    }

    /**
     * @param value The fact data of the policy.
     */
    @JvmName("obmqiwbangcwitet")
    public suspend fun factData(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.factData = mapped
    }

    /**
     * @param value The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
     */
    @JvmName("gemapsmdqusmnheu")
    public suspend fun factName(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.factName = mapped
    }

    /**
     * @param value The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
     */
    @JvmName("xhagfwqkxchmvktt")
    public fun factName(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.factName = mapped
    }

    /**
     * @param value The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
     */
    @JvmName("ecnmcbrayngsbcif")
    public fun factName(`value`: PolicyFactName) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.factName = mapped
    }

    /**
     * @param value The name of the lab.
     */
    @JvmName("pucwarypcrwfwugj")
    public suspend fun labName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labName = mapped
    }

    /**
     * @param value The location of the resource.
     */
    @JvmName("tmvylebkkyoasisj")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name of the policy.
     */
    @JvmName("hwifcrfqyaganqro")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the policy set.
     */
    @JvmName("uhqgenqenygpiplq")
    public suspend fun policySetName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policySetName = mapped
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("romtburyufgfkqsl")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The status of the policy.
     */
    @JvmName("nqoaikhtvxrapxxa")
    public suspend fun status(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value The status of the policy.
     */
    @JvmName("iyuybucpojwhpvlw")
    public fun status(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value The status of the policy.
     */
    @JvmName("tflxsgylvauwhymw")
    public fun status(`value`: PolicyStatus) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value The tags of the resource.
     */
    @JvmName("ugdkmdpxdrtubinw")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values The tags of the resource.
     */
    @JvmName("utdxgggwsjhoujwi")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
     */
    @JvmName("tejcnewsxwpdhhwl")
    public suspend fun threshold(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.threshold = mapped
    }

    internal fun build(): PolicyArgs = PolicyArgs(
        description = description,
        evaluatorType = evaluatorType,
        factData = factData,
        factName = factName,
        labName = labName,
        location = location,
        name = name,
        policySetName = policySetName,
        resourceGroupName = resourceGroupName,
        status = status,
        tags = tags,
        threshold = threshold,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy