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

com.pulumi.azurenative.authorization.kotlin.ManagementLockAtResourceGroupLevelArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.authorization.kotlin

import com.pulumi.azurenative.authorization.ManagementLockAtResourceGroupLevelArgs.builder
import com.pulumi.azurenative.authorization.kotlin.enums.LockLevel
import com.pulumi.azurenative.authorization.kotlin.inputs.ManagementLockOwnerArgs
import com.pulumi.azurenative.authorization.kotlin.inputs.ManagementLockOwnerArgsBuilder
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 com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The lock information.
 * Azure REST API version: 2020-05-01. Prior API version in Azure Native 1.x: 2017-04-01.
 * Other available API versions: 2015-01-01.
 * ## Example Usage
 * ### Create management lock at resource group level
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var managementLockAtResourceGroupLevel = new AzureNative.Authorization.ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevel", new()
 *     {
 *         Level = AzureNative.Authorization.LockLevel.ReadOnly,
 *         LockName = "testlock",
 *         ResourceGroupName = "resourcegroupname",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	authorization "github.com/pulumi/pulumi-azure-native-sdk/authorization/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := authorization.NewManagementLockAtResourceGroupLevel(ctx, "managementLockAtResourceGroupLevel", &authorization.ManagementLockAtResourceGroupLevelArgs{
 * 			Level:             pulumi.String(authorization.LockLevelReadOnly),
 * 			LockName:          pulumi.String("testlock"),
 * 			ResourceGroupName: pulumi.String("resourcegroupname"),
 * 		})
 * 		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.authorization.ManagementLockAtResourceGroupLevel;
 * import com.pulumi.azurenative.authorization.ManagementLockAtResourceGroupLevelArgs;
 * 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 managementLockAtResourceGroupLevel = new ManagementLockAtResourceGroupLevel("managementLockAtResourceGroupLevel", ManagementLockAtResourceGroupLevelArgs.builder()
 *             .level("ReadOnly")
 *             .lockName("testlock")
 *             .resourceGroupName("resourcegroupname")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:authorization:ManagementLockAtResourceGroupLevel testlock /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}
 * ```
 * @property level The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.
 * @property lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \, ?, /, or any control characters.
 * @property notes Notes about the lock. Maximum of 512 characters.
 * @property owners The owners of the lock.
 * @property resourceGroupName The name of the resource group to lock.
 */
public data class ManagementLockAtResourceGroupLevelArgs(
    public val level: Output>? = null,
    public val lockName: Output? = null,
    public val notes: Output? = null,
    public val owners: Output>? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.authorization.ManagementLockAtResourceGroupLevelArgs = com.pulumi.azurenative.authorization.ManagementLockAtResourceGroupLevelArgs.builder()
        .level(
            level?.applyValue({ args0 ->
                args0.transform({ args0 -> args0 }, { args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                })
            }),
        )
        .lockName(lockName?.applyValue({ args0 -> args0 }))
        .notes(notes?.applyValue({ args0 -> args0 }))
        .owners(owners?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
        .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

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

    private var lockName: Output? = null

    private var notes: Output? = null

    private var owners: Output>? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.
     */
    @JvmName("myjwqosaregjncsk")
    public suspend fun level(`value`: Output>) {
        this.level = value
    }

    /**
     * @param value The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \, ?, /, or any control characters.
     */
    @JvmName("jhnxobqjqbqtjnrf")
    public suspend fun lockName(`value`: Output) {
        this.lockName = value
    }

    /**
     * @param value Notes about the lock. Maximum of 512 characters.
     */
    @JvmName("vbrhlgehmphjuyaa")
    public suspend fun notes(`value`: Output) {
        this.notes = value
    }

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

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

    /**
     * @param values The owners of the lock.
     */
    @JvmName("slrbxexinfewuqto")
    public suspend fun owners(values: List>) {
        this.owners = Output.all(values)
    }

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

    /**
     * @param value The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.
     */
    @JvmName("aehcguswxxbsjqif")
    public suspend fun level(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.level = mapped
    }

    /**
     * @param value The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.
     */
    @JvmName("llwywirovabxdehx")
    public fun level(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.level = mapped
    }

    /**
     * @param value The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.
     */
    @JvmName("ptbayuwkwaavsdch")
    public fun level(`value`: LockLevel) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.level = mapped
    }

    /**
     * @param value The lock name. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \, ?, /, or any control characters.
     */
    @JvmName("wwkhtrbmmksdcipr")
    public suspend fun lockName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.lockName = mapped
    }

    /**
     * @param value Notes about the lock. Maximum of 512 characters.
     */
    @JvmName("dmdlwfuhjfnqmfay")
    public suspend fun notes(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notes = mapped
    }

    /**
     * @param value The owners of the lock.
     */
    @JvmName("nngmhbkeritfgcvh")
    public suspend fun owners(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.owners = mapped
    }

    /**
     * @param argument The owners of the lock.
     */
    @JvmName("ljycixtclbpoopjf")
    public suspend fun owners(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ManagementLockOwnerArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.owners = mapped
    }

    /**
     * @param argument The owners of the lock.
     */
    @JvmName("gtoiihmebuhdlbhr")
    public suspend fun owners(vararg argument: suspend ManagementLockOwnerArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ManagementLockOwnerArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.owners = mapped
    }

    /**
     * @param argument The owners of the lock.
     */
    @JvmName("bkgtnuuaeqwqnlsh")
    public suspend fun owners(argument: suspend ManagementLockOwnerArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ManagementLockOwnerArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.owners = mapped
    }

    /**
     * @param values The owners of the lock.
     */
    @JvmName("busnmiwedyoovkeq")
    public suspend fun owners(vararg values: ManagementLockOwnerArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.owners = mapped
    }

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

    internal fun build(): ManagementLockAtResourceGroupLevelArgs =
        ManagementLockAtResourceGroupLevelArgs(
            level = level,
            lockName = lockName,
            notes = notes,
            owners = owners,
            resourceGroupName = resourceGroupName,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy