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

com.pulumi.azurenative.network.kotlin.UserRuleArgs.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.network.kotlin

import com.pulumi.azurenative.network.UserRuleArgs.builder
import com.pulumi.azurenative.network.kotlin.enums.SecurityConfigurationRuleDirection
import com.pulumi.azurenative.network.kotlin.enums.SecurityConfigurationRuleProtocol
import com.pulumi.azurenative.network.kotlin.inputs.AddressPrefixItemArgs
import com.pulumi.azurenative.network.kotlin.inputs.AddressPrefixItemArgsBuilder
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

/**
 * Network security user rule.
 * Azure REST API version: 2022-04-01-preview. Prior API version in Azure Native 1.x: 2021-02-01-preview.
 * Other available API versions: 2021-05-01-preview.
 * ## Example Usage
 * ### Create a default user rule
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var userRule = new AzureNative.Network.UserRule("userRule", new()
 *     {
 *         ConfigurationName = "myTestSecurityConfig",
 *         NetworkManagerName = "testNetworkManager",
 *         ResourceGroupName = "rg1",
 *         RuleCollectionName = "testRuleCollection",
 *         RuleName = "SampleDefaultUserRule",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := network.NewUserRule(ctx, "userRule", &network.UserRuleArgs{
 * 			ConfigurationName:  pulumi.String("myTestSecurityConfig"),
 * 			NetworkManagerName: pulumi.String("testNetworkManager"),
 * 			ResourceGroupName:  pulumi.String("rg1"),
 * 			RuleCollectionName: pulumi.String("testRuleCollection"),
 * 			RuleName:           pulumi.String("SampleDefaultUserRule"),
 * 		})
 * 		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.network.UserRule;
 * import com.pulumi.azurenative.network.UserRuleArgs;
 * 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 userRule = new UserRule("userRule", UserRuleArgs.builder()
 *             .configurationName("myTestSecurityConfig")
 *             .networkManagerName("testNetworkManager")
 *             .resourceGroupName("rg1")
 *             .ruleCollectionName("testRuleCollection")
 *             .ruleName("SampleDefaultUserRule")
 *             .build());
 *     }
 * }
 * ```
 * ### Create a user rule
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var userRule = new AzureNative.Network.UserRule("userRule", new()
 *     {
 *         ConfigurationName = "myTestSecurityConfig",
 *         Description = "Sample User Rule",
 *         DestinationPortRanges = new[]
 *         {
 *             "22",
 *         },
 *         Destinations = new[]
 *         {
 *             new AzureNative.Network.Inputs.AddressPrefixItemArgs
 *             {
 *                 AddressPrefix = "*",
 *                 AddressPrefixType = AzureNative.Network.AddressPrefixType.IPPrefix,
 *             },
 *         },
 *         Direction = AzureNative.Network.SecurityConfigurationRuleDirection.Inbound,
 *         Kind = "Custom",
 *         NetworkManagerName = "testNetworkManager",
 *         Protocol = AzureNative.Network.SecurityConfigurationRuleProtocol.Tcp,
 *         ResourceGroupName = "rg1",
 *         RuleCollectionName = "testRuleCollection",
 *         RuleName = "SampleUserRule",
 *         SourcePortRanges = new[]
 *         {
 *             "0-65535",
 *         },
 *         Sources = new[]
 *         {
 *             new AzureNative.Network.Inputs.AddressPrefixItemArgs
 *             {
 *                 AddressPrefix = "*",
 *                 AddressPrefixType = AzureNative.Network.AddressPrefixType.IPPrefix,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := network.NewUserRule(ctx, "userRule", &network.UserRuleArgs{
 * 			ConfigurationName: pulumi.String("myTestSecurityConfig"),
 * 			Description:       pulumi.String("Sample User Rule"),
 * 			DestinationPortRanges: pulumi.StringArray{
 * 				pulumi.String("22"),
 * 			},
 * 			Destinations: network.AddressPrefixItemArray{
 * 				&network.AddressPrefixItemArgs{
 * 					AddressPrefix:     pulumi.String("*"),
 * 					AddressPrefixType: pulumi.String(network.AddressPrefixTypeIPPrefix),
 * 				},
 * 			},
 * 			Direction:          pulumi.String(network.SecurityConfigurationRuleDirectionInbound),
 * 			Kind:               pulumi.String("Custom"),
 * 			NetworkManagerName: pulumi.String("testNetworkManager"),
 * 			Protocol:           pulumi.String(network.SecurityConfigurationRuleProtocolTcp),
 * 			ResourceGroupName:  pulumi.String("rg1"),
 * 			RuleCollectionName: pulumi.String("testRuleCollection"),
 * 			RuleName:           pulumi.String("SampleUserRule"),
 * 			SourcePortRanges: pulumi.StringArray{
 * 				pulumi.String("0-65535"),
 * 			},
 * 			Sources: network.AddressPrefixItemArray{
 * 				&network.AddressPrefixItemArgs{
 * 					AddressPrefix:     pulumi.String("*"),
 * 					AddressPrefixType: pulumi.String(network.AddressPrefixTypeIPPrefix),
 * 				},
 * 			},
 * 		})
 * 		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.network.UserRule;
 * import com.pulumi.azurenative.network.UserRuleArgs;
 * import com.pulumi.azurenative.network.inputs.AddressPrefixItemArgs;
 * 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 userRule = new UserRule("userRule", UserRuleArgs.builder()
 *             .configurationName("myTestSecurityConfig")
 *             .description("Sample User Rule")
 *             .destinationPortRanges("22")
 *             .destinations(AddressPrefixItemArgs.builder()
 *                 .addressPrefix("*")
 *                 .addressPrefixType("IPPrefix")
 *                 .build())
 *             .direction("Inbound")
 *             .kind("Custom")
 *             .networkManagerName("testNetworkManager")
 *             .protocol("Tcp")
 *             .resourceGroupName("rg1")
 *             .ruleCollectionName("testRuleCollection")
 *             .ruleName("SampleUserRule")
 *             .sourcePortRanges("0-65535")
 *             .sources(AddressPrefixItemArgs.builder()
 *                 .addressPrefix("*")
 *                 .addressPrefixType("IPPrefix")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:network:UserRule SampleUserRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}
 * ```
 * @property configurationName The name of the network manager Security Configuration.
 * @property description A description for this rule.
 * @property destinationPortRanges The destination port ranges.
 * @property destinations The destination address prefixes. CIDR or destination IP ranges.
 * @property direction Indicates if the traffic matched against the rule in inbound or outbound.
 * @property kind Whether the rule is custom or default.
 * Expected value is 'Custom'.
 * @property networkManagerName The name of the network manager.
 * @property protocol Network protocol this rule applies to.
 * @property resourceGroupName The name of the resource group.
 * @property ruleCollectionName The name of the network manager security Configuration rule collection.
 * @property ruleName The name of the rule.
 * @property sourcePortRanges The source port ranges.
 * @property sources The CIDR or source IP ranges.
 */
public data class UserRuleArgs(
    public val configurationName: Output? = null,
    public val description: Output? = null,
    public val destinationPortRanges: Output>? = null,
    public val destinations: Output>? = null,
    public val direction: Output>? = null,
    public val kind: Output? = null,
    public val networkManagerName: Output? = null,
    public val protocol: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val ruleCollectionName: Output? = null,
    public val ruleName: Output? = null,
    public val sourcePortRanges: Output>? = null,
    public val sources: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.UserRuleArgs =
        com.pulumi.azurenative.network.UserRuleArgs.builder()
            .configurationName(configurationName?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .destinationPortRanges(destinationPortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .destinations(
                destinations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .direction(
                direction?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .kind(kind?.applyValue({ args0 -> args0 }))
            .networkManagerName(networkManagerName?.applyValue({ args0 -> args0 }))
            .protocol(
                protocol?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .ruleCollectionName(ruleCollectionName?.applyValue({ args0 -> args0 }))
            .ruleName(ruleName?.applyValue({ args0 -> args0 }))
            .sourcePortRanges(sourcePortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .sources(
                sources?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [UserRuleArgs].
 */
@PulumiTagMarker
public class UserRuleArgsBuilder internal constructor() {
    private var configurationName: Output? = null

    private var description: Output? = null

    private var destinationPortRanges: Output>? = null

    private var destinations: Output>? = null

    private var direction: Output>? = null

    private var kind: Output? = null

    private var networkManagerName: Output? = null

    private var protocol: Output>? = null

    private var resourceGroupName: Output? = null

    private var ruleCollectionName: Output? = null

    private var ruleName: Output? = null

    private var sourcePortRanges: Output>? = null

    private var sources: Output>? = null

    /**
     * @param value The name of the network manager Security Configuration.
     */
    @JvmName("bwcwdpgslmpgwjaj")
    public suspend fun configurationName(`value`: Output) {
        this.configurationName = value
    }

    /**
     * @param value A description for this rule.
     */
    @JvmName("fcmqqesvsiekrtgt")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The destination port ranges.
     */
    @JvmName("ekvtihhyljbagjqd")
    public suspend fun destinationPortRanges(`value`: Output>) {
        this.destinationPortRanges = value
    }

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

    /**
     * @param values The destination port ranges.
     */
    @JvmName("qjpgvcephqwlklsy")
    public suspend fun destinationPortRanges(values: List>) {
        this.destinationPortRanges = Output.all(values)
    }

    /**
     * @param value The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("roytrrriamftqnny")
    public suspend fun destinations(`value`: Output>) {
        this.destinations = value
    }

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

    /**
     * @param values The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("vtxlwaudgsiwbcsd")
    public suspend fun destinations(values: List>) {
        this.destinations = Output.all(values)
    }

    /**
     * @param value Indicates if the traffic matched against the rule in inbound or outbound.
     */
    @JvmName("savgltkrfquvnrov")
    public suspend fun direction(`value`: Output>) {
        this.direction = value
    }

    /**
     * @param value Whether the rule is custom or default.
     * Expected value is 'Custom'.
     */
    @JvmName("qbmwbflukkixldfd")
    public suspend fun kind(`value`: Output) {
        this.kind = value
    }

    /**
     * @param value The name of the network manager.
     */
    @JvmName("nvvnmgskhvmonyxm")
    public suspend fun networkManagerName(`value`: Output) {
        this.networkManagerName = value
    }

    /**
     * @param value Network protocol this rule applies to.
     */
    @JvmName("xsqwxbopelhsmtse")
    public suspend fun protocol(`value`: Output>) {
        this.protocol = value
    }

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

    /**
     * @param value The name of the network manager security Configuration rule collection.
     */
    @JvmName("xcvutydpguupylrg")
    public suspend fun ruleCollectionName(`value`: Output) {
        this.ruleCollectionName = value
    }

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

    /**
     * @param value The source port ranges.
     */
    @JvmName("eogeifqcnoysdajk")
    public suspend fun sourcePortRanges(`value`: Output>) {
        this.sourcePortRanges = value
    }

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

    /**
     * @param values The source port ranges.
     */
    @JvmName("qkfdhwpodrmbryjg")
    public suspend fun sourcePortRanges(values: List>) {
        this.sourcePortRanges = Output.all(values)
    }

    /**
     * @param value The CIDR or source IP ranges.
     */
    @JvmName("jupkxbkkojsjypeh")
    public suspend fun sources(`value`: Output>) {
        this.sources = value
    }

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

    /**
     * @param values The CIDR or source IP ranges.
     */
    @JvmName("mkcsspyvgoemstet")
    public suspend fun sources(values: List>) {
        this.sources = Output.all(values)
    }

    /**
     * @param value The name of the network manager Security Configuration.
     */
    @JvmName("rcditbpddaoypewe")
    public suspend fun configurationName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configurationName = mapped
    }

    /**
     * @param value A description for this rule.
     */
    @JvmName("sjjjuelcxefxksfi")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The destination port ranges.
     */
    @JvmName("xqksvkdwngnbwpit")
    public suspend fun destinationPortRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationPortRanges = mapped
    }

    /**
     * @param values The destination port ranges.
     */
    @JvmName("sgmxohyaifuskgpt")
    public suspend fun destinationPortRanges(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationPortRanges = mapped
    }

    /**
     * @param value The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("nwhphjfinjvnvhty")
    public suspend fun destinations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinations = mapped
    }

    /**
     * @param argument The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("qsktopyitymvacof")
    public suspend fun destinations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AddressPrefixItemArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param argument The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("kbntkjwnsklfpsdh")
    public suspend fun destinations(vararg argument: suspend AddressPrefixItemArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AddressPrefixItemArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param argument The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("ptncbihtprtdxnsn")
    public suspend fun destinations(argument: suspend AddressPrefixItemArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AddressPrefixItemArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param values The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("dvpjnulaqdgpdyyn")
    public suspend fun destinations(vararg values: AddressPrefixItemArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinations = mapped
    }

    /**
     * @param value Indicates if the traffic matched against the rule in inbound or outbound.
     */
    @JvmName("ixlraehlmbrjfbmj")
    public suspend fun direction(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Indicates if the traffic matched against the rule in inbound or outbound.
     */
    @JvmName("pqqbemvceklgyvxb")
    public fun direction(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Indicates if the traffic matched against the rule in inbound or outbound.
     */
    @JvmName("jdxcbrdbjfffrtpm")
    public fun direction(`value`: SecurityConfigurationRuleDirection) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Whether the rule is custom or default.
     * Expected value is 'Custom'.
     */
    @JvmName("xpvoranispgvgxmi")
    public suspend fun kind(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kind = mapped
    }

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

    /**
     * @param value Network protocol this rule applies to.
     */
    @JvmName("ihtakausukdbscec")
    public suspend fun protocol(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value Network protocol this rule applies to.
     */
    @JvmName("biunckutdbsxxuvf")
    public fun protocol(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value Network protocol this rule applies to.
     */
    @JvmName("iygenmdbjcpcaivb")
    public fun protocol(`value`: SecurityConfigurationRuleProtocol) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("hrcyiguktnrgtcka")
    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 network manager security Configuration rule collection.
     */
    @JvmName("iraromcqkcuxhylv")
    public suspend fun ruleCollectionName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleCollectionName = mapped
    }

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

    /**
     * @param value The source port ranges.
     */
    @JvmName("jyqilxdblvsqcird")
    public suspend fun sourcePortRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePortRanges = mapped
    }

    /**
     * @param values The source port ranges.
     */
    @JvmName("wtfhebasdmvcqsdr")
    public suspend fun sourcePortRanges(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourcePortRanges = mapped
    }

    /**
     * @param value The CIDR or source IP ranges.
     */
    @JvmName("duelmxxijcgicjno")
    public suspend fun sources(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sources = mapped
    }

    /**
     * @param argument The CIDR or source IP ranges.
     */
    @JvmName("pdwpygacfojvasyk")
    public suspend fun sources(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AddressPrefixItemArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.sources = mapped
    }

    /**
     * @param argument The CIDR or source IP ranges.
     */
    @JvmName("rsqkbtcymvrsvqih")
    public suspend fun sources(vararg argument: suspend AddressPrefixItemArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AddressPrefixItemArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.sources = mapped
    }

    /**
     * @param argument The CIDR or source IP ranges.
     */
    @JvmName("txnmntjifrcmsqnb")
    public suspend fun sources(argument: suspend AddressPrefixItemArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AddressPrefixItemArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.sources = mapped
    }

    /**
     * @param values The CIDR or source IP ranges.
     */
    @JvmName("mryairqiyqorsxew")
    public suspend fun sources(vararg values: AddressPrefixItemArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sources = mapped
    }

    internal fun build(): UserRuleArgs = UserRuleArgs(
        configurationName = configurationName,
        description = description,
        destinationPortRanges = destinationPortRanges,
        destinations = destinations,
        direction = direction,
        kind = kind,
        networkManagerName = networkManagerName,
        protocol = protocol,
        resourceGroupName = resourceGroupName,
        ruleCollectionName = ruleCollectionName,
        ruleName = ruleName,
        sourcePortRanges = sourcePortRanges,
        sources = sources,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy