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

com.pulumi.azurenative.apimanagement.kotlin.UserArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.apimanagement.kotlin

import com.pulumi.azurenative.apimanagement.UserArgs.builder
import com.pulumi.azurenative.apimanagement.kotlin.enums.AppType
import com.pulumi.azurenative.apimanagement.kotlin.enums.Confirmation
import com.pulumi.azurenative.apimanagement.kotlin.enums.UserState
import com.pulumi.azurenative.apimanagement.kotlin.inputs.UserIdentityContractArgs
import com.pulumi.azurenative.apimanagement.kotlin.inputs.UserIdentityContractArgsBuilder
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.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * User details.
 * Azure REST API version: 2022-08-01. Prior API version in Azure Native 1.x: 2020-12-01.
 * Other available API versions: 2016-07-07, 2016-10-10, 2017-03-01, 2018-01-01, 2022-09-01-preview, 2023-03-01-preview, 2023-05-01-preview, 2023-09-01-preview, 2024-05-01.
 * ## Example Usage
 * ### ApiManagementCreateUser
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var user = new AzureNative.ApiManagement.User("user", new()
 *     {
 *         Confirmation = AzureNative.ApiManagement.Confirmation.Signup,
 *         Email = "[email protected]",
 *         FirstName = "foo",
 *         LastName = "bar",
 *         ResourceGroupName = "rg1",
 *         ServiceName = "apimService1",
 *         UserId = "5931a75ae4bbd512288c680b",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := apimanagement.NewUser(ctx, "user", &apimanagement.UserArgs{
 * 			Confirmation:      pulumi.String(apimanagement.ConfirmationSignup),
 * 			Email:             pulumi.String("[email protected]"),
 * 			FirstName:         pulumi.String("foo"),
 * 			LastName:          pulumi.String("bar"),
 * 			ResourceGroupName: pulumi.String("rg1"),
 * 			ServiceName:       pulumi.String("apimService1"),
 * 			UserId:            pulumi.String("5931a75ae4bbd512288c680b"),
 * 		})
 * 		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.apimanagement.User;
 * import com.pulumi.azurenative.apimanagement.UserArgs;
 * 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 user = new User("user", UserArgs.builder()
 *             .confirmation("signup")
 *             .email("[email protected]")
 *             .firstName("foo")
 *             .lastName("bar")
 *             .resourceGroupName("rg1")
 *             .serviceName("apimService1")
 *             .userId("5931a75ae4bbd512288c680b")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:apimanagement:User 5931a75ae4bbd512288c680b /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}
 * ```
 * @property appType Determines the type of application which send the create user request. Default is legacy portal.
 * @property confirmation Determines the type of confirmation e-mail that will be sent to the newly created user.
 * @property email Email address. Must not be empty and must be unique within the service instance.
 * @property firstName First name.
 * @property identities Collection of user identities.
 * @property lastName Last name.
 * @property note Optional note about a user set by the administrator.
 * @property notify Send an Email notification to the User.
 * @property password User Password. If no value is provided, a default password is generated.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property serviceName The name of the API Management service.
 * @property state Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.
 * @property userId User identifier. Must be unique in the current API Management service instance.
 */
public data class UserArgs(
    public val appType: Output>? = null,
    public val confirmation: Output>? = null,
    public val email: Output? = null,
    public val firstName: Output? = null,
    public val identities: Output>? = null,
    public val lastName: Output? = null,
    public val note: Output? = null,
    public val notify: Output? = null,
    public val password: Output? = null,
    public val resourceGroupName: Output? = null,
    public val serviceName: Output? = null,
    public val state: Output>? = null,
    public val userId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.apimanagement.UserArgs =
        com.pulumi.azurenative.apimanagement.UserArgs.builder()
            .appType(
                appType?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .confirmation(
                confirmation?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .email(email?.applyValue({ args0 -> args0 }))
            .firstName(firstName?.applyValue({ args0 -> args0 }))
            .identities(
                identities?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .lastName(lastName?.applyValue({ args0 -> args0 }))
            .note(note?.applyValue({ args0 -> args0 }))
            .notify_(notify?.applyValue({ args0 -> args0 }))
            .password(password?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serviceName(serviceName?.applyValue({ args0 -> args0 }))
            .state(
                state?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .userId(userId?.applyValue({ args0 -> args0 })).build()
}

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

    private var confirmation: Output>? = null

    private var email: Output? = null

    private var firstName: Output? = null

    private var identities: Output>? = null

    private var lastName: Output? = null

    private var note: Output? = null

    private var notify: Output? = null

    private var password: Output? = null

    private var resourceGroupName: Output? = null

    private var serviceName: Output? = null

    private var state: Output>? = null

    private var userId: Output? = null

    /**
     * @param value Determines the type of application which send the create user request. Default is legacy portal.
     */
    @JvmName("whhlysvrnrngyyrw")
    public suspend fun appType(`value`: Output>) {
        this.appType = value
    }

    /**
     * @param value Determines the type of confirmation e-mail that will be sent to the newly created user.
     */
    @JvmName("bliikopkjpwchbno")
    public suspend fun confirmation(`value`: Output>) {
        this.confirmation = value
    }

    /**
     * @param value Email address. Must not be empty and must be unique within the service instance.
     */
    @JvmName("xnphnnqujpifwhjt")
    public suspend fun email(`value`: Output) {
        this.email = value
    }

    /**
     * @param value First name.
     */
    @JvmName("vfixtacoflfpdver")
    public suspend fun firstName(`value`: Output) {
        this.firstName = value
    }

    /**
     * @param value Collection of user identities.
     */
    @JvmName("lenrmjkqgpwpeyoo")
    public suspend fun identities(`value`: Output>) {
        this.identities = value
    }

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

    /**
     * @param values Collection of user identities.
     */
    @JvmName("cyaulycfvkoamklm")
    public suspend fun identities(values: List>) {
        this.identities = Output.all(values)
    }

    /**
     * @param value Last name.
     */
    @JvmName("kkmhqmjuclfqrjkc")
    public suspend fun lastName(`value`: Output) {
        this.lastName = value
    }

    /**
     * @param value Optional note about a user set by the administrator.
     */
    @JvmName("cekioabqrnreqnhe")
    public suspend fun note(`value`: Output) {
        this.note = value
    }

    /**
     * @param value Send an Email notification to the User.
     */
    @JvmName("aedjpnciuvkoilmx")
    public suspend fun notify(`value`: Output) {
        this.notify = value
    }

    /**
     * @param value User Password. If no value is provided, a default password is generated.
     */
    @JvmName("diybckvhrddfprcl")
    public suspend fun password(`value`: Output) {
        this.password = value
    }

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

    /**
     * @param value The name of the API Management service.
     */
    @JvmName("pvgtkrqwmhfoojwk")
    public suspend fun serviceName(`value`: Output) {
        this.serviceName = value
    }

    /**
     * @param value Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.
     */
    @JvmName("emhpvjgsjolmgkvb")
    public suspend fun state(`value`: Output>) {
        this.state = value
    }

    /**
     * @param value User identifier. Must be unique in the current API Management service instance.
     */
    @JvmName("mhrvejrvaysmpisw")
    public suspend fun userId(`value`: Output) {
        this.userId = value
    }

    /**
     * @param value Determines the type of application which send the create user request. Default is legacy portal.
     */
    @JvmName("gwhqqrxapiiiidtc")
    public suspend fun appType(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.appType = mapped
    }

    /**
     * @param value Determines the type of application which send the create user request. Default is legacy portal.
     */
    @JvmName("ojqclanpyiqiylut")
    public fun appType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.appType = mapped
    }

    /**
     * @param value Determines the type of application which send the create user request. Default is legacy portal.
     */
    @JvmName("robkjdgdmjtgdglq")
    public fun appType(`value`: AppType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.appType = mapped
    }

    /**
     * @param value Determines the type of confirmation e-mail that will be sent to the newly created user.
     */
    @JvmName("xffavkauifxiquld")
    public suspend fun confirmation(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.confirmation = mapped
    }

    /**
     * @param value Determines the type of confirmation e-mail that will be sent to the newly created user.
     */
    @JvmName("usbpyljdgdjflqfu")
    public fun confirmation(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.confirmation = mapped
    }

    /**
     * @param value Determines the type of confirmation e-mail that will be sent to the newly created user.
     */
    @JvmName("lgvvwafcyimkknmp")
    public fun confirmation(`value`: Confirmation) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.confirmation = mapped
    }

    /**
     * @param value Email address. Must not be empty and must be unique within the service instance.
     */
    @JvmName("dyudseibisudxenv")
    public suspend fun email(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.email = mapped
    }

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

    /**
     * @param value Collection of user identities.
     */
    @JvmName("uttqhgmmqxotntxb")
    public suspend fun identities(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identities = mapped
    }

    /**
     * @param argument Collection of user identities.
     */
    @JvmName("xamsjdeealgnspqu")
    public suspend fun identities(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            UserIdentityContractArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.identities = mapped
    }

    /**
     * @param argument Collection of user identities.
     */
    @JvmName("aiggtuxjhfuctyds")
    public suspend fun identities(vararg argument: suspend UserIdentityContractArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            UserIdentityContractArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.identities = mapped
    }

    /**
     * @param argument Collection of user identities.
     */
    @JvmName("drhnvgylgfvvspfw")
    public suspend fun identities(argument: suspend UserIdentityContractArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(UserIdentityContractArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.identities = mapped
    }

    /**
     * @param values Collection of user identities.
     */
    @JvmName("ckykxnfxqidvroor")
    public suspend fun identities(vararg values: UserIdentityContractArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.identities = mapped
    }

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

    /**
     * @param value Optional note about a user set by the administrator.
     */
    @JvmName("jphpjjjuebjxhebh")
    public suspend fun note(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.note = mapped
    }

    /**
     * @param value Send an Email notification to the User.
     */
    @JvmName("cmwlaebcomjduhew")
    public suspend fun notify(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notify = mapped
    }

    /**
     * @param value User Password. If no value is provided, a default password is generated.
     */
    @JvmName("mglrwopvbajimnsk")
    public suspend fun password(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.password = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("tjavkkdvotcdgvie")
    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 API Management service.
     */
    @JvmName("eebnbmbnmpywrxxg")
    public suspend fun serviceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceName = mapped
    }

    /**
     * @param value Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.
     */
    @JvmName("daywdfxiblxyrdxq")
    public suspend fun state(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.state = mapped
    }

    /**
     * @param value Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.
     */
    @JvmName("jmhmmqhcxqdjufyp")
    public fun state(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.state = mapped
    }

    /**
     * @param value Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.
     */
    @JvmName("vvnnwrwqieftsgro")
    public fun state(`value`: UserState) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.state = mapped
    }

    /**
     * @param value User identifier. Must be unique in the current API Management service instance.
     */
    @JvmName("ngckpiyqnokdvels")
    public suspend fun userId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.userId = mapped
    }

    internal fun build(): UserArgs = UserArgs(
        appType = appType,
        confirmation = confirmation,
        email = email,
        firstName = firstName,
        identities = identities,
        lastName = lastName,
        note = note,
        notify = notify,
        password = password,
        resourceGroupName = resourceGroupName,
        serviceName = serviceName,
        state = state,
        userId = userId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy