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

com.pulumi.azurenative.authorization.kotlin.ManagementLockByScopeArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.authorization.kotlin

import com.pulumi.azurenative.authorization.ManagementLockByScopeArgs.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.
 * ## Example Usage
 * ### Create management lock at scope
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var managementLockByScope = new AzureNative.Authorization.ManagementLockByScope("managementLockByScope", new()
 *     {
 *         Level = AzureNative.Authorization.LockLevel.ReadOnly,
 *         LockName = "testlock",
 *         Scope = "subscriptions/subscriptionId",
 *     });
 * });
 * ```
 * ```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.NewManagementLockByScope(ctx, "managementLockByScope", &authorization.ManagementLockByScopeArgs{
 * 			Level:    pulumi.String(authorization.LockLevelReadOnly),
 * 			LockName: pulumi.String("testlock"),
 * 			Scope:    pulumi.String("subscriptions/subscriptionId"),
 * 		})
 * 		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.ManagementLockByScope;
 * import com.pulumi.azurenative.authorization.ManagementLockByScopeArgs;
 * 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 managementLockByScope = new ManagementLockByScope("managementLockByScope", ManagementLockByScopeArgs.builder()
 *             .level("ReadOnly")
 *             .lockName("testlock")
 *             .scope("subscriptions/subscriptionId")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:authorization:ManagementLockByScope testlock /{scope}/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 name of lock.
 * @property notes Notes about the lock. Maximum of 512 characters.
 * @property owners The owners of the lock.
 * @property scope The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' for resources.
 */
public data class ManagementLockByScopeArgs(
    public val level: Output>? = null,
    public val lockName: Output? = null,
    public val notes: Output? = null,
    public val owners: Output>? = null,
    public val scope: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.authorization.ManagementLockByScopeArgs =
        com.pulumi.azurenative.authorization.ManagementLockByScopeArgs.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() }) }) }))
            .scope(scope?.applyValue({ args0 -> args0 })).build()
}

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

    private var lockName: Output? = null

    private var notes: Output? = null

    private var owners: Output>? = null

    private var scope: 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("erqvmycwuelgcxbc")
    public suspend fun level(`value`: Output>) {
        this.level = value
    }

    /**
     * @param value The name of lock.
     */
    @JvmName("acsvioimlscwgmky")
    public suspend fun lockName(`value`: Output) {
        this.lockName = value
    }

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

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

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

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

    /**
     * @param value The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' for resources.
     */
    @JvmName("jvkebuiskfuhgldc")
    public suspend fun scope(`value`: Output) {
        this.scope = 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("jsthjqufkfgadrvx")
    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("mhqaknlxbveehgym")
    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("kkylhgvxwjvmxnir")
    public fun level(`value`: LockLevel) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.level = mapped
    }

    /**
     * @param value The name of lock.
     */
    @JvmName("wsgvujqtxvrclasl")
    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("vvwveqtseohequsq")
    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("hcpcubfqpflpbuao")
    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("oukscorfrvlwlwjk")
    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("hnjbnaundiguerts")
    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("aopoxtppvnkcxxcu")
    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("xtqmermrfdmbdcau")
    public suspend fun owners(vararg values: ManagementLockOwnerArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.owners = mapped
    }

    /**
     * @param value The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' for resources.
     */
    @JvmName("pkgmahopkeinjlhp")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    internal fun build(): ManagementLockByScopeArgs = ManagementLockByScopeArgs(
        level = level,
        lockName = lockName,
        notes = notes,
        owners = owners,
        scope = scope,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy