// *** 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.webpubsub;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.webpubsub.ServiceArgs;
import com.pulumi.azure.webpubsub.inputs.ServiceState;
import com.pulumi.azure.webpubsub.outputs.ServiceIdentity;
import com.pulumi.azure.webpubsub.outputs.ServiceLiveTrace;
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.Boolean;
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 an Azure Web PubSub 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.webpubsub.Service;
 * import com.pulumi.azure.webpubsub.ServiceArgs;
 * import com.pulumi.azure.webpubsub.inputs.ServiceLiveTraceArgs;
 * import com.pulumi.azure.webpubsub.inputs.ServiceIdentityArgs;
 * 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 exampleService = new Service(&#34;exampleService&#34;, ServiceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .sku(&#34;Standard_S1&#34;)
 *             .capacity(1)
 *             .publicNetworkAccessEnabled(false)
 *             .liveTrace(ServiceLiveTraceArgs.builder()
 *                 .enabled(true)
 *                 .messagingLogsEnabled(true)
 *                 .connectivityLogsEnabled(false)
 *                 .build())
 *             .identity(ServiceIdentityArgs.builder()
 *                 .type(&#34;SystemAssigned&#34;)
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Web PubSub services can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:webpubsub/service:Service example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SignalRService/webPubSub/pubsub1
 * ```
 * 
 */
@ResourceType(type="azure:webpubsub/service:Service")
public class Service extends com.pulumi.resources.CustomResource {
    /**
     * Whether to enable AAD auth? Defaults to `true`.
     * 
     */
    @Export(name="aadAuthEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> aadAuthEnabled;

    /**
     * @return Whether to enable AAD auth? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> aadAuthEnabled() {
        return Codegen.optional(this.aadAuthEnabled);
    }
    /**
     * Specifies the number of units associated with this Web PubSub resource. Valid values are: Free: `1`, Standard: `1`, `2`, `5`, `10`, `20`, `50`, `100`.
     * 
     */
    @Export(name="capacity", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> capacity;

    /**
     * @return Specifies the number of units associated with this Web PubSub resource. Valid values are: Free: `1`, Standard: `1`, `2`, `5`, `10`, `20`, `50`, `100`.
     * 
     */
    public Output<Optional<Integer>> capacity() {
        return Codegen.optional(this.capacity);
    }
    /**
     * The publicly accessible IP of the Web PubSub service.
     * 
     */
    @Export(name="externalIp", refs={String.class}, tree="[0]")
    private Output<String> externalIp;

    /**
     * @return The publicly accessible IP of the Web PubSub service.
     * 
     */
    public Output<String> externalIp() {
        return this.externalIp;
    }
    /**
     * The FQDN of the Web PubSub service.
     * 
     */
    @Export(name="hostname", refs={String.class}, tree="[0]")
    private Output<String> hostname;

    /**
     * @return The FQDN of the Web PubSub service.
     * 
     */
    public Output<String> hostname() {
        return this.hostname;
    }
    /**
     * An `identity` block as defined below.
     * 
     */
    @Export(name="identity", refs={ServiceIdentity.class}, tree="[0]")
    private Output</* @Nullable */ ServiceIdentity> identity;

    /**
     * @return An `identity` block as defined below.
     * 
     */
    public Output<Optional<ServiceIdentity>> identity() {
        return Codegen.optional(this.identity);
    }
    /**
     * A `live_trace` block as defined below.
     * 
     */
    @Export(name="liveTrace", refs={ServiceLiveTrace.class}, tree="[0]")
    private Output</* @Nullable */ ServiceLiveTrace> liveTrace;

    /**
     * @return A `live_trace` block as defined below.
     * 
     */
    public Output<Optional<ServiceLiveTrace>> liveTrace() {
        return Codegen.optional(this.liveTrace);
    }
    /**
     * Whether to enable local auth? Defaults to `true`.
     * 
     */
    @Export(name="localAuthEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> localAuthEnabled;

    /**
     * @return Whether to enable local auth? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> localAuthEnabled() {
        return Codegen.optional(this.localAuthEnabled);
    }
    /**
     * Specifies the supported Azure location where the Web PubSub service exists. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return Specifies the supported Azure location where the Web PubSub service exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * The name of the Web PubSub service. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name of the Web PubSub service. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The primary access key for the Web PubSub service.
     * 
     */
    @Export(name="primaryAccessKey", refs={String.class}, tree="[0]")
    private Output<String> primaryAccessKey;

    /**
     * @return The primary access key for the Web PubSub service.
     * 
     */
    public Output<String> primaryAccessKey() {
        return this.primaryAccessKey;
    }
    /**
     * The primary connection string for the Web PubSub service.
     * 
     */
    @Export(name="primaryConnectionString", refs={String.class}, tree="[0]")
    private Output<String> primaryConnectionString;

    /**
     * @return The primary connection string for the Web PubSub service.
     * 
     */
    public Output<String> primaryConnectionString() {
        return this.primaryConnectionString;
    }
    /**
     * Whether to enable public network access? Defaults to `true`.
     * 
     */
    @Export(name="publicNetworkAccessEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> publicNetworkAccessEnabled;

    /**
     * @return Whether to enable public network access? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> publicNetworkAccessEnabled() {
        return Codegen.optional(this.publicNetworkAccessEnabled);
    }
    /**
     * The publicly accessible port of the Web PubSub service which is designed for browser/client use.
     * 
     */
    @Export(name="publicPort", refs={Integer.class}, tree="[0]")
    private Output<Integer> publicPort;

    /**
     * @return The publicly accessible port of the Web PubSub service which is designed for browser/client use.
     * 
     */
    public Output<Integer> publicPort() {
        return this.publicPort;
    }
    /**
     * The name of the resource group in which to create the Web PubSub service. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the resource group in which to create the Web PubSub service. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * The secondary access key for the Web PubSub service.
     * 
     */
    @Export(name="secondaryAccessKey", refs={String.class}, tree="[0]")
    private Output<String> secondaryAccessKey;

    /**
     * @return The secondary access key for the Web PubSub service.
     * 
     */
    public Output<String> secondaryAccessKey() {
        return this.secondaryAccessKey;
    }
    /**
     * The secondary connection string for the Web PubSub service.
     * 
     */
    @Export(name="secondaryConnectionString", refs={String.class}, tree="[0]")
    private Output<String> secondaryConnectionString;

    /**
     * @return The secondary connection string for the Web PubSub service.
     * 
     */
    public Output<String> secondaryConnectionString() {
        return this.secondaryConnectionString;
    }
    /**
     * The publicly accessible port of the Web PubSub service which is designed for customer server side use.
     * 
     */
    @Export(name="serverPort", refs={Integer.class}, tree="[0]")
    private Output<Integer> serverPort;

    /**
     * @return The publicly accessible port of the Web PubSub service which is designed for customer server side use.
     * 
     */
    public Output<Integer> serverPort() {
        return this.serverPort;
    }
    /**
     * Specifies which SKU to use. Possible values are `Free_F1`, `Standard_S1`, and `Premium_P1`.
     * 
     */
    @Export(name="sku", refs={String.class}, tree="[0]")
    private Output<String> sku;

    /**
     * @return Specifies which SKU to use. Possible values are `Free_F1`, `Standard_S1`, and `Premium_P1`.
     * 
     */
    public Output<String> sku() {
        return this.sku;
    }
    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }
    /**
     * Whether to request client certificate during TLS handshake? Defaults to `false`.
     * 
     */
    @Export(name="tlsClientCertEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> tlsClientCertEnabled;

    /**
     * @return Whether to request client certificate during TLS handshake? Defaults to `false`.
     * 
     */
    public Output<Optional<Boolean>> tlsClientCertEnabled() {
        return Codegen.optional(this.tlsClientCertEnabled);
    }
    @Export(name="version", refs={String.class}, tree="[0]")
    private Output<String> version;

    public Output<String> version() {
        return this.version;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public Service(String name) {
        this(name, ServiceArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public Service(String name, ServiceArgs 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 Service(String name, ServiceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:webpubsub/service:Service", name, args == null ? ServiceArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private Service(String name, Output<String> id, @Nullable ServiceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:webpubsub/service:Service", 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())
            .additionalSecretOutputs(List.of(
                "primaryAccessKey",
                "primaryConnectionString",
                "secondaryAccessKey",
                "secondaryConnectionString"
            ))
            .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 Service get(String name, Output<String> id, @Nullable ServiceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new Service(name, id, state, options);
    }
}
