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

com.pulumi.azurenative.notificationhubs.kotlin.NotificationHubAuthorizationRuleArgs.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.notificationhubs.kotlin

import com.pulumi.azurenative.notificationhubs.NotificationHubAuthorizationRuleArgs.builder
import com.pulumi.azurenative.notificationhubs.kotlin.inputs.SharedAccessAuthorizationRulePropertiesArgs
import com.pulumi.azurenative.notificationhubs.kotlin.inputs.SharedAccessAuthorizationRulePropertiesArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Response for POST requests that return single SharedAccessAuthorizationRule.
 * Azure REST API version: 2023-01-01-preview. Prior API version in Azure Native 1.x: 2017-04-01.
 * Other available API versions: 2016-03-01, 2017-04-01, 2023-09-01, 2023-10-01-preview.
 * ## Example Usage
 * ### NotificationHubs_CreateOrUpdateAuthorizationRule
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var notificationHubAuthorizationRule = new AzureNative.NotificationHubs.NotificationHubAuthorizationRule("notificationHubAuthorizationRule", new()
 *     {
 *         AuthorizationRuleName = "MyManageSharedAccessKey",
 *         NamespaceName = "nh-sdk-ns",
 *         NotificationHubName = "nh-sdk-hub",
 *         Properties = new AzureNative.NotificationHubs.Inputs.SharedAccessAuthorizationRulePropertiesArgs
 *         {
 *             Rights = new[]
 *             {
 *                 AzureNative.NotificationHubs.AccessRights.Listen,
 *                 AzureNative.NotificationHubs.AccessRights.Send,
 *             },
 *         },
 *         ResourceGroupName = "5ktrial",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	notificationhubs "github.com/pulumi/pulumi-azure-native-sdk/notificationhubs/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := notificationhubs.NewNotificationHubAuthorizationRule(ctx, "notificationHubAuthorizationRule", ¬ificationhubs.NotificationHubAuthorizationRuleArgs{
 * 			AuthorizationRuleName: pulumi.String("MyManageSharedAccessKey"),
 * 			NamespaceName:         pulumi.String("nh-sdk-ns"),
 * 			NotificationHubName:   pulumi.String("nh-sdk-hub"),
 * 			Properties: ¬ificationhubs.SharedAccessAuthorizationRulePropertiesArgs{
 * 				Rights: pulumi.StringArray{
 * 					pulumi.String(notificationhubs.AccessRightsListen),
 * 					pulumi.String(notificationhubs.AccessRightsSend),
 * 				},
 * 			},
 * 			ResourceGroupName: pulumi.String("5ktrial"),
 * 		})
 * 		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.notificationhubs.NotificationHubAuthorizationRule;
 * import com.pulumi.azurenative.notificationhubs.NotificationHubAuthorizationRuleArgs;
 * import com.pulumi.azurenative.notificationhubs.inputs.SharedAccessAuthorizationRulePropertiesArgs;
 * 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 notificationHubAuthorizationRule = new NotificationHubAuthorizationRule("notificationHubAuthorizationRule", NotificationHubAuthorizationRuleArgs.builder()
 *             .authorizationRuleName("MyManageSharedAccessKey")
 *             .namespaceName("nh-sdk-ns")
 *             .notificationHubName("nh-sdk-hub")
 *             .properties(SharedAccessAuthorizationRulePropertiesArgs.builder()
 *                 .rights(
 *                     "Listen",
 *                     "Send")
 *                 .build())
 *             .resourceGroupName("5ktrial")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:notificationhubs:NotificationHubAuthorizationRule MyManageSharedAccessKey /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}
 * ```
 * @property authorizationRuleName Authorization Rule Name
 * @property location Deprecated - only for compatibility.
 * @property namespaceName Namespace name
 * @property notificationHubName Notification Hub name
 * @property properties SharedAccessAuthorizationRule properties.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property tags Deprecated - only for compatibility.
 */
public data class NotificationHubAuthorizationRuleArgs(
    public val authorizationRuleName: Output? = null,
    public val location: Output? = null,
    public val namespaceName: Output? = null,
    public val notificationHubName: Output? = null,
    public val properties: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.notificationhubs.NotificationHubAuthorizationRuleArgs =
        com.pulumi.azurenative.notificationhubs.NotificationHubAuthorizationRuleArgs.builder()
            .authorizationRuleName(authorizationRuleName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .namespaceName(namespaceName?.applyValue({ args0 -> args0 }))
            .notificationHubName(notificationHubName?.applyValue({ args0 -> args0 }))
            .properties(properties?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [NotificationHubAuthorizationRuleArgs].
 */
@PulumiTagMarker
public class NotificationHubAuthorizationRuleArgsBuilder internal constructor() {
    private var authorizationRuleName: Output? = null

    private var location: Output? = null

    private var namespaceName: Output? = null

    private var notificationHubName: Output? = null

    private var properties: Output? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Authorization Rule Name
     */
    @JvmName("ltcgppjupxywhuhx")
    public suspend fun authorizationRuleName(`value`: Output) {
        this.authorizationRuleName = value
    }

    /**
     * @param value Deprecated - only for compatibility.
     */
    @JvmName("cxruqglplywylgel")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Namespace name
     */
    @JvmName("hdrsbhdhxuwhgfck")
    public suspend fun namespaceName(`value`: Output) {
        this.namespaceName = value
    }

    /**
     * @param value Notification Hub name
     */
    @JvmName("cawslvjssoxjikae")
    public suspend fun notificationHubName(`value`: Output) {
        this.notificationHubName = value
    }

    /**
     * @param value SharedAccessAuthorizationRule properties.
     */
    @JvmName("vbqlgbfbyvgckhqw")
    public suspend fun properties(`value`: Output) {
        this.properties = value
    }

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

    /**
     * @param value Deprecated - only for compatibility.
     */
    @JvmName("gkdngkrtyenetjmj")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Authorization Rule Name
     */
    @JvmName("mmngxxfvlyvildpx")
    public suspend fun authorizationRuleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizationRuleName = mapped
    }

    /**
     * @param value Deprecated - only for compatibility.
     */
    @JvmName("syajpewjpukvtqus")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

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

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

    /**
     * @param value SharedAccessAuthorizationRule properties.
     */
    @JvmName("psmirbjntontnjaw")
    public suspend fun properties(`value`: SharedAccessAuthorizationRulePropertiesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param argument SharedAccessAuthorizationRule properties.
     */
    @JvmName("kdtualbhmunxufjr")
    public suspend fun properties(argument: suspend SharedAccessAuthorizationRulePropertiesArgsBuilder.() -> Unit) {
        val toBeMapped = SharedAccessAuthorizationRulePropertiesArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.properties = mapped
    }

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

    /**
     * @param value Deprecated - only for compatibility.
     */
    @JvmName("hvdsiweohawhkaph")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Deprecated - only for compatibility.
     */
    @JvmName("apkrsovibncxjqde")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): NotificationHubAuthorizationRuleArgs = NotificationHubAuthorizationRuleArgs(
        authorizationRuleName = authorizationRuleName,
        location = location,
        namespaceName = namespaceName,
        notificationHubName = notificationHubName,
        properties = properties,
        resourceGroupName = resourceGroupName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy