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

com.pulumi.azurenative.authorization.kotlin.RoleDefinitionArgs.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.RoleDefinitionArgs.builder
import com.pulumi.azurenative.authorization.kotlin.inputs.PermissionArgs
import com.pulumi.azurenative.authorization.kotlin.inputs.PermissionArgsBuilder
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

/**
 * Role definition.
 * Azure REST API version: 2022-05-01-preview. Prior API version in Azure Native 1.x: 2018-01-01-preview.
 * ## Example Usage
 * ### Create role definition
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var roleDefinition = new AzureNative.Authorization.RoleDefinition("roleDefinition", new()
 *     {
 *         RoleDefinitionId = "roleDefinitionId",
 *         Scope = "scope",
 *     });
 * });
 * ```
 * ```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.NewRoleDefinition(ctx, "roleDefinition", &authorization.RoleDefinitionArgs{
 * 			RoleDefinitionId: pulumi.String("roleDefinitionId"),
 * 			Scope:            pulumi.String("scope"),
 * 		})
 * 		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.RoleDefinition;
 * import com.pulumi.azurenative.authorization.RoleDefinitionArgs;
 * 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 roleDefinition = new RoleDefinition("roleDefinition", RoleDefinitionArgs.builder()
 *             .roleDefinitionId("roleDefinitionId")
 *             .scope("scope")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:authorization:RoleDefinition roleDefinitionId /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}
 * ```
 * @property assignableScopes Role definition assignable scopes.
 * @property description The role definition description.
 * @property permissions Role definition permissions.
 * @property roleDefinitionId The ID of the role definition.
 * @property roleName The role name.
 * @property roleType The role type.
 * @property scope The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
 */
public data class RoleDefinitionArgs(
    public val assignableScopes: Output>? = null,
    public val description: Output? = null,
    public val permissions: Output>? = null,
    public val roleDefinitionId: Output? = null,
    public val roleName: Output? = null,
    public val roleType: Output? = null,
    public val scope: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.authorization.RoleDefinitionArgs =
        com.pulumi.azurenative.authorization.RoleDefinitionArgs.builder()
            .assignableScopes(assignableScopes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .permissions(
                permissions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .roleDefinitionId(roleDefinitionId?.applyValue({ args0 -> args0 }))
            .roleName(roleName?.applyValue({ args0 -> args0 }))
            .roleType(roleType?.applyValue({ args0 -> args0 }))
            .scope(scope?.applyValue({ args0 -> args0 })).build()
}

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

    private var description: Output? = null

    private var permissions: Output>? = null

    private var roleDefinitionId: Output? = null

    private var roleName: Output? = null

    private var roleType: Output? = null

    private var scope: Output? = null

    /**
     * @param value Role definition assignable scopes.
     */
    @JvmName("psroldwvtllacdnm")
    public suspend fun assignableScopes(`value`: Output>) {
        this.assignableScopes = value
    }

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

    /**
     * @param values Role definition assignable scopes.
     */
    @JvmName("cfvpkbsxyeuolnmo")
    public suspend fun assignableScopes(values: List>) {
        this.assignableScopes = Output.all(values)
    }

    /**
     * @param value The role definition description.
     */
    @JvmName("sdywpqousjnwawrr")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Role definition permissions.
     */
    @JvmName("dsdqbjnahuyijlep")
    public suspend fun permissions(`value`: Output>) {
        this.permissions = value
    }

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

    /**
     * @param values Role definition permissions.
     */
    @JvmName("fkqbowfcpwaqkqow")
    public suspend fun permissions(values: List>) {
        this.permissions = Output.all(values)
    }

    /**
     * @param value The ID of the role definition.
     */
    @JvmName("jnuxnwdmiqldtpnt")
    public suspend fun roleDefinitionId(`value`: Output) {
        this.roleDefinitionId = value
    }

    /**
     * @param value The role name.
     */
    @JvmName("rmllfnotxuinqobx")
    public suspend fun roleName(`value`: Output) {
        this.roleName = value
    }

    /**
     * @param value The role type.
     */
    @JvmName("rmprxuslvyxeavfe")
    public suspend fun roleType(`value`: Output) {
        this.roleType = value
    }

    /**
     * @param value The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
     */
    @JvmName("tvljpyfqnytrtxkk")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value Role definition assignable scopes.
     */
    @JvmName("ojjhupijbdjnscii")
    public suspend fun assignableScopes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.assignableScopes = mapped
    }

    /**
     * @param values Role definition assignable scopes.
     */
    @JvmName("vpokvmtconrpihpx")
    public suspend fun assignableScopes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.assignableScopes = mapped
    }

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

    /**
     * @param value Role definition permissions.
     */
    @JvmName("mshxvrjxnklhkiqd")
    public suspend fun permissions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.permissions = mapped
    }

    /**
     * @param argument Role definition permissions.
     */
    @JvmName("rowpatircacamkit")
    public suspend fun permissions(argument: List Unit>) {
        val toBeMapped = argument.toList().map { PermissionArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.permissions = mapped
    }

    /**
     * @param argument Role definition permissions.
     */
    @JvmName("uessgoovjvnjaqio")
    public suspend fun permissions(vararg argument: suspend PermissionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { PermissionArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.permissions = mapped
    }

    /**
     * @param argument Role definition permissions.
     */
    @JvmName("ctyuxeyrebpicbse")
    public suspend fun permissions(argument: suspend PermissionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(PermissionArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.permissions = mapped
    }

    /**
     * @param values Role definition permissions.
     */
    @JvmName("odprlmqcpbiknjgh")
    public suspend fun permissions(vararg values: PermissionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.permissions = mapped
    }

    /**
     * @param value The ID of the role definition.
     */
    @JvmName("lsxpctqfrhurptbk")
    public suspend fun roleDefinitionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.roleDefinitionId = mapped
    }

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

    /**
     * @param value The role type.
     */
    @JvmName("hgqcdyokipnrogfn")
    public suspend fun roleType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.roleType = mapped
    }

    /**
     * @param value The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
     */
    @JvmName("gysuhhmfxsxifiod")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    internal fun build(): RoleDefinitionArgs = RoleDefinitionArgs(
        assignableScopes = assignableScopes,
        description = description,
        permissions = permissions,
        roleDefinitionId = roleDefinitionId,
        roleName = roleName,
        roleType = roleType,
        scope = scope,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy