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

com.pulumi.azure.mobile.kotlin.NetworkDataNetwork.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.mobile.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

/**
 * Builder for [NetworkDataNetwork].
 */
@PulumiTagMarker
public class NetworkDataNetworkResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: NetworkDataNetworkArgs = NetworkDataNetworkArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend NetworkDataNetworkArgsBuilder.() -> Unit) {
        val builder = NetworkDataNetworkArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): NetworkDataNetwork {
        val builtJavaResource = com.pulumi.azure.mobile.NetworkDataNetwork(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return NetworkDataNetwork(builtJavaResource)
    }
}

/**
 * Manages a Mobile Network Data Network.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "East Us",
 * });
 * const exampleNetwork = new azure.mobile.Network("example", {
 *     name: "example-mn",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     mobileCountryCode: "001",
 *     mobileNetworkCode: "01",
 * });
 * const exampleNetworkDataNetwork = new azure.mobile.NetworkDataNetwork("example", {
 *     name: "example-mndn",
 *     mobileNetworkId: exampleNetwork.id,
 *     location: example.location,
 *     description: "example description",
 *     tags: {
 *         key: "value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="East Us")
 * example_network = azure.mobile.Network("example",
 *     name="example-mn",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     mobile_country_code="001",
 *     mobile_network_code="01")
 * example_network_data_network = azure.mobile.NetworkDataNetwork("example",
 *     name="example-mndn",
 *     mobile_network_id=example_network.id,
 *     location=example.location,
 *     description="example description",
 *     tags={
 *         "key": "value",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "East Us",
 *     });
 *     var exampleNetwork = new Azure.Mobile.Network("example", new()
 *     {
 *         Name = "example-mn",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         MobileCountryCode = "001",
 *         MobileNetworkCode = "01",
 *     });
 *     var exampleNetworkDataNetwork = new Azure.Mobile.NetworkDataNetwork("example", new()
 *     {
 *         Name = "example-mndn",
 *         MobileNetworkId = exampleNetwork.Id,
 *         Location = example.Location,
 *         Description = "example description",
 *         Tags =
 *         {
 *             { "key", "value" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("East Us"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetwork, err := mobile.NewNetwork(ctx, "example", &mobile.NetworkArgs{
 * 			Name:              pulumi.String("example-mn"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			MobileCountryCode: pulumi.String("001"),
 * 			MobileNetworkCode: pulumi.String("01"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = mobile.NewNetworkDataNetwork(ctx, "example", &mobile.NetworkDataNetworkArgs{
 * 			Name:            pulumi.String("example-mndn"),
 * 			MobileNetworkId: exampleNetwork.ID(),
 * 			Location:        example.Location,
 * 			Description:     pulumi.String("example description"),
 * 			Tags: pulumi.StringMap{
 * 				"key": pulumi.String("value"),
 * 			},
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.mobile.Network;
 * import com.pulumi.azure.mobile.NetworkArgs;
 * import com.pulumi.azure.mobile.NetworkDataNetwork;
 * import com.pulumi.azure.mobile.NetworkDataNetworkArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("East Us")
 *             .build());
 *         var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
 *             .name("example-mn")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .mobileCountryCode("001")
 *             .mobileNetworkCode("01")
 *             .build());
 *         var exampleNetworkDataNetwork = new NetworkDataNetwork("exampleNetworkDataNetwork", NetworkDataNetworkArgs.builder()
 *             .name("example-mndn")
 *             .mobileNetworkId(exampleNetwork.id())
 *             .location(example.location())
 *             .description("example description")
 *             .tags(Map.of("key", "value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: East Us
 *   exampleNetwork:
 *     type: azure:mobile:Network
 *     name: example
 *     properties:
 *       name: example-mn
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       mobileCountryCode: '001'
 *       mobileNetworkCode: '01'
 *   exampleNetworkDataNetwork:
 *     type: azure:mobile:NetworkDataNetwork
 *     name: example
 *     properties:
 *       name: example-mndn
 *       mobileNetworkId: ${exampleNetwork.id}
 *       location: ${example.location}
 *       description: example description
 *       tags:
 *         key: value
 * ```
 * 
 * ## Import
 * Mobile Network Data Network can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:mobile/networkDataNetwork:NetworkDataNetwork example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.MobileNetwork/mobileNetworks/mobileNetwork1/dataNetworks/dataNetwork1
 * ```
 */
public class NetworkDataNetwork internal constructor(
    override val javaResource: com.pulumi.azure.mobile.NetworkDataNetwork,
) : KotlinCustomResource(javaResource, NetworkDataNetworkMapper) {
    /**
     * A description of this Mobile Network Data Network.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the Azure Region where the Mobile Network Data Network should exist. Changing this forces a new Mobile Network Data Network to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Specifies the ID of the Mobile Network. Changing this forces a new Mobile Network Data Network to be created.
     */
    public val mobileNetworkId: Output
        get() = javaResource.mobileNetworkId().applyValue({ args0 -> args0 })

    /**
     * Specifies the name which should be used for this Mobile Network Data Network. Changing this forces a new Mobile Network Data Network to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags which should be assigned to the Mobile Network Data Network.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

public object NetworkDataNetworkMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.mobile.NetworkDataNetwork::class == javaResource::class

    override fun map(javaResource: Resource): NetworkDataNetwork = NetworkDataNetwork(
        javaResource as
            com.pulumi.azure.mobile.NetworkDataNetwork,
    )
}

/**
 * @see [NetworkDataNetwork].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [NetworkDataNetwork].
 */
public suspend fun networkDataNetwork(
    name: String,
    block: suspend NetworkDataNetworkResourceBuilder.() -> Unit,
): NetworkDataNetwork {
    val builder = NetworkDataNetworkResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [NetworkDataNetwork].
 * @param name The _unique_ name of the resulting resource.
 */
public fun networkDataNetwork(name: String): NetworkDataNetwork {
    val builder = NetworkDataNetworkResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy