// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.mobile;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.mobile.NetworkServiceArgs;
import com.pulumi.azure.mobile.inputs.NetworkServiceState;
import com.pulumi.azure.mobile.outputs.NetworkServicePccRule;
import com.pulumi.azure.mobile.outputs.NetworkServiceServiceQosPolicy;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Mobile Network Service.
 * 
 * ## Example Usage
 * ```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.NetworkService;
 * import com.pulumi.azure.mobile.NetworkServiceArgs;
 * import com.pulumi.azure.mobile.inputs.NetworkServicePccRuleArgs;
 * import com.pulumi.azure.mobile.inputs.NetworkServicePccRuleQosPolicyArgs;
 * import com.pulumi.azure.mobile.inputs.NetworkServicePccRuleQosPolicyGuaranteedBitRateArgs;
 * import com.pulumi.azure.mobile.inputs.NetworkServicePccRuleQosPolicyMaximumBitRateArgs;
 * import com.pulumi.azure.mobile.inputs.NetworkServiceServiceQosPolicyArgs;
 * import com.pulumi.azure.mobile.inputs.NetworkServiceServiceQosPolicyMaximumBitRateArgs;
 * 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 exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;east us&#34;)
 *             .build());
 * 
 *         var exampleNetwork = new Network(&#34;exampleNetwork&#34;, NetworkArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .mobileCountryCode(&#34;001&#34;)
 *             .mobileNetworkCode(&#34;01&#34;)
 *             .build());
 * 
 *         var exampleNetworkService = new NetworkService(&#34;exampleNetworkService&#34;, NetworkServiceArgs.builder()        
 *             .mobileNetworkId(exampleNetwork.id())
 *             .location(exampleResourceGroup.location())
 *             .servicePrecedence(0)
 *             .pccRules(NetworkServicePccRuleArgs.builder()
 *                 .name(&#34;default-rule&#34;)
 *                 .precedence(1)
 *                 .trafficControlEnabled(true)
 *                 .qosPolicy(NetworkServicePccRuleQosPolicyArgs.builder()
 *                     .allocationAndRetentionPriorityLevel(9)
 *                     .qosIndicator(9)
 *                     .preemptionCapability(&#34;NotPreempt&#34;)
 *                     .preemptionVulnerability(&#34;Preemptable&#34;)
 *                     .guaranteedBitRate(NetworkServicePccRuleQosPolicyGuaranteedBitRateArgs.builder()
 *                         .downlink(&#34;100 Mbps&#34;)
 *                         .uplink(&#34;10 Mbps&#34;)
 *                         .build())
 *                     .maximumBitRate(NetworkServicePccRuleQosPolicyMaximumBitRateArgs.builder()
 *                         .downlink(&#34;1 Gbps&#34;)
 *                         .uplink(&#34;100 Mbps&#34;)
 *                         .build())
 *                     .build())
 *                 .serviceDataFlowTemplates(NetworkServicePccRuleServiceDataFlowTemplateArgs.builder()
 *                     .direction(&#34;Uplink&#34;)
 *                     .name(&#34;IP-to-server&#34;)
 *                     .ports()
 *                     .protocols(&#34;ip&#34;)
 *                     .remoteIpLists(&#34;10.3.4.0/24&#34;)
 *                     .build())
 *                 .build())
 *             .serviceQosPolicy(NetworkServiceServiceQosPolicyArgs.builder()
 *                 .allocationAndRetentionPriorityLevel(9)
 *                 .qosIndicator(9)
 *                 .preemptionCapability(&#34;NotPreempt&#34;)
 *                 .preemptionVulnerability(&#34;Preemptable&#34;)
 *                 .maximumBitRate(NetworkServiceServiceQosPolicyMaximumBitRateArgs.builder()
 *                     .downlink(&#34;1 Gbps&#34;)
 *                     .uplink(&#34;100 Mbps&#34;)
 *                     .build())
 *                 .build())
 *             .tags(Map.of(&#34;key&#34;, &#34;value&#34;))
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Mobile Network Service can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:mobile/networkService:NetworkService example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.MobileNetwork/mobileNetworks/mobileNetwork1/services/service1
 * ```
 * 
 */
@ResourceType(type="azure:mobile/networkService:NetworkService")
public class NetworkService extends com.pulumi.resources.CustomResource {
    /**
     * Specifies the Azure Region where the Mobile Network Service should exist. Changing this forces a new Mobile Network Service to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return Specifies the Azure Region where the Mobile Network Service should exist. Changing this forces a new Mobile Network Service to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * Specifies the ID of the Mobile Network Service. Changing this forces a new Mobile Network Service to be created.
     * 
     */
    @Export(name="mobileNetworkId", refs={String.class}, tree="[0]")
    private Output<String> mobileNetworkId;

    /**
     * @return Specifies the ID of the Mobile Network Service. Changing this forces a new Mobile Network Service to be created.
     * 
     */
    public Output<String> mobileNetworkId() {
        return this.mobileNetworkId;
    }
    /**
     * Specifies the name which should be used for this Mobile Network Service. Changing this forces a new Mobile Network Service to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return Specifies the name which should be used for this Mobile Network Service. Changing this forces a new Mobile Network Service to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * A `pcc_rule` block as defined below. The set of PCC Rules that make up this service.
     * 
     */
    @Export(name="pccRules", refs={List.class,NetworkServicePccRule.class}, tree="[0,1]")
    private Output<List<NetworkServicePccRule>> pccRules;

    /**
     * @return A `pcc_rule` block as defined below. The set of PCC Rules that make up this service.
     * 
     */
    public Output<List<NetworkServicePccRule>> pccRules() {
        return this.pccRules;
    }
    /**
     * A precedence value that is used to decide between services when identifying the QoS values to use for a particular SIM. A lower value means a higher priority. This value should be unique among all services configured in the mobile network. Must be between `0` and `255`.
     * 
     */
    @Export(name="servicePrecedence", refs={Integer.class}, tree="[0]")
    private Output<Integer> servicePrecedence;

    /**
     * @return A precedence value that is used to decide between services when identifying the QoS values to use for a particular SIM. A lower value means a higher priority. This value should be unique among all services configured in the mobile network. Must be between `0` and `255`.
     * 
     */
    public Output<Integer> servicePrecedence() {
        return this.servicePrecedence;
    }
    /**
     * A `service_qos_policy` block as defined below. The QoS policy to use for packets matching this service. This can be overridden for particular flows using the ruleQosPolicy field in a `pcc_rule`. If this field is not specified then the `sim_policy` of User Equipment (UE) will define the QoS settings.
     * 
     */
    @Export(name="serviceQosPolicy", refs={NetworkServiceServiceQosPolicy.class}, tree="[0]")
    private Output</* @Nullable */ NetworkServiceServiceQosPolicy> serviceQosPolicy;

    /**
     * @return A `service_qos_policy` block as defined below. The QoS policy to use for packets matching this service. This can be overridden for particular flows using the ruleQosPolicy field in a `pcc_rule`. If this field is not specified then the `sim_policy` of User Equipment (UE) will define the QoS settings.
     * 
     */
    public Output<Optional<NetworkServiceServiceQosPolicy>> serviceQosPolicy() {
        return Codegen.optional(this.serviceQosPolicy);
    }
    /**
     * A mapping of tags which should be assigned to the Mobile Network Service.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags which should be assigned to the Mobile Network Service.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public NetworkService(String name) {
        this(name, NetworkServiceArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public NetworkService(String name, NetworkServiceArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public NetworkService(String name, NetworkServiceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:mobile/networkService:NetworkService", name, args == null ? NetworkServiceArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private NetworkService(String name, Output<String> id, @Nullable NetworkServiceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:mobile/networkService:NetworkService", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static NetworkService get(String name, Output<String> id, @Nullable NetworkServiceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new NetworkService(name, id, state, options);
    }
}
