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

com.pulumi.azurenative.dbformysql.kotlin.AzureADAdministratorArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.dbformysql.kotlin

import com.pulumi.azurenative.dbformysql.AzureADAdministratorArgs.builder
import com.pulumi.azurenative.dbformysql.kotlin.enums.AdministratorType
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.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Represents a Administrator.
 * Azure REST API version: 2022-01-01.
 * Other available API versions: 2023-06-01-preview, 2023-06-30, 2023-12-30.
 * ## Example Usage
 * ### Create an azure ad administrator
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var azureADAdministrator = new AzureNative.DBforMySQL.AzureADAdministrator("azureADAdministrator", new()
 *     {
 *         AdministratorName = "ActiveDirectory",
 *         AdministratorType = AzureNative.DBforMySQL.AdministratorType.ActiveDirectory,
 *         IdentityResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi",
 *         Login = "[email protected]",
 *         ResourceGroupName = "testrg",
 *         ServerName = "mysqltestsvc4",
 *         Sid = "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c",
 *         TenantId = "c12b7025-bfe2-46c1-b463-993b5e4cd467",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dbformysql.NewAzureADAdministrator(ctx, "azureADAdministrator", &dbformysql.AzureADAdministratorArgs{
 * 			AdministratorName:  pulumi.String("ActiveDirectory"),
 * 			AdministratorType:  pulumi.String(dbformysql.AdministratorTypeActiveDirectory),
 * 			IdentityResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"),
 * 			Login:              pulumi.String("[email protected]"),
 * 			ResourceGroupName:  pulumi.String("testrg"),
 * 			ServerName:         pulumi.String("mysqltestsvc4"),
 * 			Sid:                pulumi.String("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
 * 			TenantId:           pulumi.String("c12b7025-bfe2-46c1-b463-993b5e4cd467"),
 * 		})
 * 		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.dbformysql.AzureADAdministrator;
 * import com.pulumi.azurenative.dbformysql.AzureADAdministratorArgs;
 * 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 azureADAdministrator = new AzureADAdministrator("azureADAdministrator", AzureADAdministratorArgs.builder()
 *             .administratorName("ActiveDirectory")
 *             .administratorType("ActiveDirectory")
 *             .identityResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi")
 *             .login("[email protected]")
 *             .resourceGroupName("testrg")
 *             .serverName("mysqltestsvc4")
 *             .sid("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c")
 *             .tenantId("c12b7025-bfe2-46c1-b463-993b5e4cd467")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:dbformysql:AzureADAdministrator ActiveDirectory /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}
 * ```
 * @property administratorName The name of the Azure AD Administrator.
 * @property administratorType Type of the sever administrator.
 * @property identityResourceId The resource id of the identity used for AAD Authentication.
 * @property login Login name of the server administrator.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property serverName The name of the server.
 * @property sid SID (object ID) of the server administrator.
 * @property tenantId Tenant ID of the administrator.
 */
public data class AzureADAdministratorArgs(
    public val administratorName: Output? = null,
    public val administratorType: Output>? = null,
    public val identityResourceId: Output? = null,
    public val login: Output? = null,
    public val resourceGroupName: Output? = null,
    public val serverName: Output? = null,
    public val sid: Output? = null,
    public val tenantId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.dbformysql.AzureADAdministratorArgs =
        com.pulumi.azurenative.dbformysql.AzureADAdministratorArgs.builder()
            .administratorName(administratorName?.applyValue({ args0 -> args0 }))
            .administratorType(
                administratorType?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            )
            .identityResourceId(identityResourceId?.applyValue({ args0 -> args0 }))
            .login(login?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serverName(serverName?.applyValue({ args0 -> args0 }))
            .sid(sid?.applyValue({ args0 -> args0 }))
            .tenantId(tenantId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AzureADAdministratorArgs].
 */
@PulumiTagMarker
public class AzureADAdministratorArgsBuilder internal constructor() {
    private var administratorName: Output? = null

    private var administratorType: Output>? = null

    private var identityResourceId: Output? = null

    private var login: Output? = null

    private var resourceGroupName: Output? = null

    private var serverName: Output? = null

    private var sid: Output? = null

    private var tenantId: Output? = null

    /**
     * @param value The name of the Azure AD Administrator.
     */
    @JvmName("ywgxifimcbholxsh")
    public suspend fun administratorName(`value`: Output) {
        this.administratorName = value
    }

    /**
     * @param value Type of the sever administrator.
     */
    @JvmName("ymvxsydsvtmymxgw")
    public suspend fun administratorType(`value`: Output>) {
        this.administratorType = value
    }

    /**
     * @param value The resource id of the identity used for AAD Authentication.
     */
    @JvmName("nwrswqthevgqmkxs")
    public suspend fun identityResourceId(`value`: Output) {
        this.identityResourceId = value
    }

    /**
     * @param value Login name of the server administrator.
     */
    @JvmName("uykiqxshoxontbma")
    public suspend fun login(`value`: Output) {
        this.login = value
    }

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

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

    /**
     * @param value SID (object ID) of the server administrator.
     */
    @JvmName("ojneuwdujeumfrwi")
    public suspend fun sid(`value`: Output) {
        this.sid = value
    }

    /**
     * @param value Tenant ID of the administrator.
     */
    @JvmName("qsfweyeqpecyppov")
    public suspend fun tenantId(`value`: Output) {
        this.tenantId = value
    }

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

    /**
     * @param value Type of the sever administrator.
     */
    @JvmName("kixkynxjdelgycmo")
    public suspend fun administratorType(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.administratorType = mapped
    }

    /**
     * @param value Type of the sever administrator.
     */
    @JvmName("eggmlhnelnuimkti")
    public fun administratorType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.administratorType = mapped
    }

    /**
     * @param value Type of the sever administrator.
     */
    @JvmName("nkuvjumcdjwaydnj")
    public fun administratorType(`value`: AdministratorType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.administratorType = mapped
    }

    /**
     * @param value The resource id of the identity used for AAD Authentication.
     */
    @JvmName("ofqkljctlbbaxaau")
    public suspend fun identityResourceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identityResourceId = mapped
    }

    /**
     * @param value Login name of the server administrator.
     */
    @JvmName("bcxuiuadgpvkucpi")
    public suspend fun login(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.login = mapped
    }

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

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

    /**
     * @param value SID (object ID) of the server administrator.
     */
    @JvmName("ybhwytuyaylcnopm")
    public suspend fun sid(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sid = mapped
    }

    /**
     * @param value Tenant ID of the administrator.
     */
    @JvmName("pqqxwmmjpamkomkb")
    public suspend fun tenantId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tenantId = mapped
    }

    internal fun build(): AzureADAdministratorArgs = AzureADAdministratorArgs(
        administratorName = administratorName,
        administratorType = administratorType,
        identityResourceId = identityResourceId,
        login = login,
        resourceGroupName = resourceGroupName,
        serverName = serverName,
        sid = sid,
        tenantId = tenantId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy