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

import com.pulumi.azure.Utilities;
import com.pulumi.azure.iot.EndpointServicebusQueueArgs;
import com.pulumi.azure.iot.inputs.EndpointServicebusQueueState;
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.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages an IotHub ServiceBus Queue Endpoint
 * 
 * &gt; **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported.
 * 
 * ## 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.servicebus.Namespace;
 * import com.pulumi.azure.servicebus.NamespaceArgs;
 * import com.pulumi.azure.servicebus.Queue;
 * import com.pulumi.azure.servicebus.QueueArgs;
 * import com.pulumi.azure.servicebus.QueueAuthorizationRule;
 * import com.pulumi.azure.servicebus.QueueAuthorizationRuleArgs;
 * import com.pulumi.azure.iot.IoTHub;
 * import com.pulumi.azure.iot.IoTHubArgs;
 * import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
 * import com.pulumi.azure.iot.EndpointServicebusQueue;
 * import com.pulumi.azure.iot.EndpointServicebusQueueArgs;
 * 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;West Europe&#34;)
 *             .build());
 * 
 *         var exampleNamespace = new Namespace(&#34;exampleNamespace&#34;, NamespaceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .sku(&#34;Standard&#34;)
 *             .build());
 * 
 *         var exampleQueue = new Queue(&#34;exampleQueue&#34;, QueueArgs.builder()        
 *             .namespaceId(exampleNamespace.id())
 *             .enablePartitioning(true)
 *             .build());
 * 
 *         var exampleQueueAuthorizationRule = new QueueAuthorizationRule(&#34;exampleQueueAuthorizationRule&#34;, QueueAuthorizationRuleArgs.builder()        
 *             .queueId(exampleQueue.id())
 *             .listen(false)
 *             .send(true)
 *             .manage(false)
 *             .build());
 * 
 *         var exampleIoTHub = new IoTHub(&#34;exampleIoTHub&#34;, IoTHubArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .sku(IoTHubSkuArgs.builder()
 *                 .name(&#34;B1&#34;)
 *                 .capacity(&#34;1&#34;)
 *                 .build())
 *             .tags(Map.of(&#34;purpose&#34;, &#34;example&#34;))
 *             .build());
 * 
 *         var exampleEndpointServicebusQueue = new EndpointServicebusQueue(&#34;exampleEndpointServicebusQueue&#34;, EndpointServicebusQueueArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .iothubId(exampleIoTHub.id())
 *             .connectionString(exampleQueueAuthorizationRule.primaryConnectionString())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * IoTHub ServiceBus Queue Endpoint can be imported using the `resource id`, e.g. g
 * 
 * ```sh
 *  $ pulumi import azure:iot/endpointServicebusQueue:EndpointServicebusQueue servicebus_queue1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1/endpoints/servicebusqueue_endpoint1
 * ```
 * 
 */
@ResourceType(type="azure:iot/endpointServicebusQueue:EndpointServicebusQueue")
public class EndpointServicebusQueue extends com.pulumi.resources.CustomResource {
    /**
     * Type used to authenticate against the Service Bus Queue endpoint. Possible values are `keyBased` and `identityBased`. Defaults to `keyBased`.
     * 
     */
    @Export(name="authenticationType", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> authenticationType;

    /**
     * @return Type used to authenticate against the Service Bus Queue endpoint. Possible values are `keyBased` and `identityBased`. Defaults to `keyBased`.
     * 
     */
    public Output<Optional<String>> authenticationType() {
        return Codegen.optional(this.authenticationType);
    }
    /**
     * The connection string for the endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `keyBased`.
     * 
     */
    @Export(name="connectionString", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> connectionString;

    /**
     * @return The connection string for the endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `keyBased`.
     * 
     */
    public Output<Optional<String>> connectionString() {
        return Codegen.optional(this.connectionString);
    }
    /**
     * URI of the Service Bus endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
     * 
     */
    @Export(name="endpointUri", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> endpointUri;

    /**
     * @return URI of the Service Bus endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
     * 
     */
    public Output<Optional<String>> endpointUri() {
        return Codegen.optional(this.endpointUri);
    }
    /**
     * Name of the Service Bus Queue. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
     * 
     */
    @Export(name="entityPath", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> entityPath;

    /**
     * @return Name of the Service Bus Queue. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
     * 
     */
    public Output<Optional<String>> entityPath() {
        return Codegen.optional(this.entityPath);
    }
    /**
     * ID of the User Managed Identity used to authenticate against the Service Bus Queue endpoint.
     * 
     * &gt; **NOTE:** `identity_id` can only be specified when `authentication_type` is `identityBased`. It must be one of the `identity_ids` of the Iot Hub. If not specified when `authentication_type` is `identityBased`, System Assigned Managed Identity of the Iot Hub will be used.
     * 
     */
    @Export(name="identityId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> identityId;

    /**
     * @return ID of the User Managed Identity used to authenticate against the Service Bus Queue endpoint.
     * 
     * &gt; **NOTE:** `identity_id` can only be specified when `authentication_type` is `identityBased`. It must be one of the `identity_ids` of the Iot Hub. If not specified when `authentication_type` is `identityBased`, System Assigned Managed Identity of the Iot Hub will be used.
     * 
     */
    public Output<Optional<String>> identityId() {
        return Codegen.optional(this.identityId);
    }
    /**
     * The IoTHub ID for the endpoint. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="iothubId", refs={String.class}, tree="[0]")
    private Output<String> iothubId;

    /**
     * @return The IoTHub ID for the endpoint. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> iothubId() {
        return this.iothubId;
    }
    /**
     * The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`. 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 endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The name of the resource group under which the Service Bus Queue has been created. 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 under which the Service Bus Queue has been created. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }

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

    private EndpointServicebusQueue(String name, Output<String> id, @Nullable EndpointServicebusQueueState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:iot/endpointServicebusQueue:EndpointServicebusQueue", 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(
                "connectionString"
            ))
            .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 EndpointServicebusQueue get(String name, Output<String> id, @Nullable EndpointServicebusQueueState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new EndpointServicebusQueue(name, id, state, options);
    }
}
