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

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

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

package com.pulumi.azurenative.authorization.kotlin

import com.pulumi.azurenative.authorization.ManagementLockAtSubscriptionLevelArgs.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 subscription level
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var managementLockAtSubscriptionLevel = new AzureNative.Authorization.ManagementLockAtSubscriptionLevel("managementLockAtSubscriptionLevel", new()
 *     {
 *         Level = AzureNative.Authorization.LockLevel.ReadOnly,
 *         LockName = "testlock",
 *     });
 * });
 * ```
 * ```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.NewManagementLockAtSubscriptionLevel(ctx, "managementLockAtSubscriptionLevel", &authorization.ManagementLockAtSubscriptionLevelArgs{
 * 			Level:    pulumi.String(authorization.LockLevelReadOnly),
 * 			LockName: pulumi.String("testlock"),
 * 		})
 * 		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.ManagementLockAtSubscriptionLevel;
 * import com.pulumi.azurenative.authorization.ManagementLockAtSubscriptionLevelArgs;
 * 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 managementLockAtSubscriptionLevel = new ManagementLockAtSubscriptionLevel("managementLockAtSubscriptionLevel", ManagementLockAtSubscriptionLevelArgs.builder()
 *             .level("ReadOnly")
 *             .lockName("testlock")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:authorization:ManagementLockAtSubscriptionLevel testlock /subscriptions/{subscriptionId}/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. 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.
 */
public data class ManagementLockAtSubscriptionLevelArgs(
    public val level: Output>? = null,
    public val lockName: Output? = null,
    public val notes: Output? = null,
    public val owners: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.authorization.ManagementLockAtSubscriptionLevelArgs = com.pulumi.azurenative.authorization.ManagementLockAtSubscriptionLevelArgs.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()
                    })
                })
            }),
        ).build()
}

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

    private var lockName: Output? = null

    private var notes: Output? = null

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

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

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

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

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

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

    /**
     * @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("uqpuldcxsfjglvet")
    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("lsrnfipbadbjntww")
    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("nfynfyrnujaotniq")
    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. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \, ?, /, or any control characters.
     */
    @JvmName("tavarckwcauuvhme")
    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("pwcnpwpcywijqakk")
    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("stokjejdgnyxuiqp")
    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("rgjvidenxfnwyaox")
    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("dtiiaokuactljcgg")
    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("bfvkwnlrdfqikuuk")
    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("itgpmlpoaotvuiuw")
    public suspend fun owners(vararg values: ManagementLockOwnerArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.owners = mapped
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy