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

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

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

package com.pulumi.azure.mobile.kotlin

import com.pulumi.azure.mobile.kotlin.outputs.NetworkSliceSingleNetworkSliceSelectionAssistanceInformation
import com.pulumi.azure.mobile.kotlin.outputs.NetworkSliceSingleNetworkSliceSelectionAssistanceInformation.Companion.toKotlin
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 [NetworkSlice].
 */
@PulumiTagMarker
public class NetworkSliceResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: NetworkSliceArgs = NetworkSliceArgs()

    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 NetworkSliceArgsBuilder.() -> Unit) {
        val builder = NetworkSliceArgsBuilder()
        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(): NetworkSlice {
        val builtJavaResource = com.pulumi.azure.mobile.NetworkSlice(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return NetworkSlice(builtJavaResource)
    }
}

/**
 * Manages a Mobile Network Slice.
 * ## 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: "West Europe",
 * });
 * const exampleNetwork = new azure.mobile.Network("example", {
 *     name: "example-mn",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     mobileCountryCode: "001",
 *     mobileNetworkCode: "01",
 * });
 * const exampleNetworkSlice = new azure.mobile.NetworkSlice("example", {
 *     name: "example-mns",
 *     mobileNetworkId: exampleNetwork.id,
 *     location: example.location,
 *     description: "an example slice",
 *     singleNetworkSliceSelectionAssistanceInformation: {
 *         sliceServiceType: 1,
 *     },
 *     tags: {
 *         key: "value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * 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_slice = azure.mobile.NetworkSlice("example",
 *     name="example-mns",
 *     mobile_network_id=example_network.id,
 *     location=example.location,
 *     description="an example slice",
 *     single_network_slice_selection_assistance_information={
 *         "slice_service_type": 1,
 *     },
 *     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 = "West Europe",
 *     });
 *     var exampleNetwork = new Azure.Mobile.Network("example", new()
 *     {
 *         Name = "example-mn",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         MobileCountryCode = "001",
 *         MobileNetworkCode = "01",
 *     });
 *     var exampleNetworkSlice = new Azure.Mobile.NetworkSlice("example", new()
 *     {
 *         Name = "example-mns",
 *         MobileNetworkId = exampleNetwork.Id,
 *         Location = example.Location,
 *         Description = "an example slice",
 *         SingleNetworkSliceSelectionAssistanceInformation = new Azure.Mobile.Inputs.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs
 *         {
 *             SliceServiceType = 1,
 *         },
 *         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("West Europe"),
 * 		})
 * 		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.NewNetworkSlice(ctx, "example", &mobile.NetworkSliceArgs{
 * 			Name:            pulumi.String("example-mns"),
 * 			MobileNetworkId: exampleNetwork.ID(),
 * 			Location:        example.Location,
 * 			Description:     pulumi.String("an example slice"),
 * 			SingleNetworkSliceSelectionAssistanceInformation: &mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs{
 * 				SliceServiceType: pulumi.Int(1),
 * 			},
 * 			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.NetworkSlice;
 * import com.pulumi.azure.mobile.NetworkSliceArgs;
 * import com.pulumi.azure.mobile.inputs.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs;
 * 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("West Europe")
 *             .build());
 *         var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
 *             .name("example-mn")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .mobileCountryCode("001")
 *             .mobileNetworkCode("01")
 *             .build());
 *         var exampleNetworkSlice = new NetworkSlice("exampleNetworkSlice", NetworkSliceArgs.builder()
 *             .name("example-mns")
 *             .mobileNetworkId(exampleNetwork.id())
 *             .location(example.location())
 *             .description("an example slice")
 *             .singleNetworkSliceSelectionAssistanceInformation(NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs.builder()
 *                 .sliceServiceType(1)
 *                 .build())
 *             .tags(Map.of("key", "value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleNetwork:
 *     type: azure:mobile:Network
 *     name: example
 *     properties:
 *       name: example-mn
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       mobileCountryCode: '001'
 *       mobileNetworkCode: '01'
 *   exampleNetworkSlice:
 *     type: azure:mobile:NetworkSlice
 *     name: example
 *     properties:
 *       name: example-mns
 *       mobileNetworkId: ${exampleNetwork.id}
 *       location: ${example.location}
 *       description: an example slice
 *       singleNetworkSliceSelectionAssistanceInformation:
 *         sliceServiceType: 1
 *       tags:
 *         key: value
 * ```
 * 
 * ## Import
 * Mobile Network Slice can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:mobile/networkSlice:NetworkSlice example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.MobileNetwork/mobileNetworks/mobileNetwork1/slices/slice1
 * ```
 */
public class NetworkSlice internal constructor(
    override val javaResource: com.pulumi.azure.mobile.NetworkSlice,
) : KotlinCustomResource(javaResource, NetworkSliceMapper) {
    /**
     * A description for this Mobile Network Slice.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

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

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

    /**
     * A `single_network_slice_selection_assistance_information` block as defined below. Single-network slice selection assistance information (S-NSSAI). Unique at the scope of a mobile network.
     */
    public val singleNetworkSliceSelectionAssistanceInformation:
        Output
        get() = javaResource.singleNetworkSliceSelectionAssistanceInformation().applyValue({ args0 ->
            args0.let({ args0 -> toKotlin(args0) })
        })

    /**
     * A mapping of tags which should be assigned to the Mobile Network Slice.
     */
    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 NetworkSliceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.mobile.NetworkSlice::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy