# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

__all__ = [
    'GetIotHubResult',
    'AwaitableGetIotHubResult',
    'get_iot_hub',
    'get_iot_hub_output',
]

@pulumi.output_type
class GetIotHubResult:
    """
    A collection of values returned by getIotHub.
    """
    def __init__(__self__, hostname=None, id=None, identities=None, name=None, METHOD_NAME=None, tags=None):
        if hostname and not isinstance(hostname, str):
            raise TypeError("Expected argument 'hostname' to be a str")
        pulumi.set(__self__, "hostname", hostname)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if identities and not isinstance(identities, list):
            raise TypeError("Expected argument 'identities' to be a list")
        pulumi.set(__self__, "identities", identities)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if METHOD_NAME and not isinstance(METHOD_NAME, str):
            raise TypeError("Expected argument 'resource_group_name' to be a str")
        pulumi.set(__self__, "resource_group_name", METHOD_NAME)
        if tags and not isinstance(tags, dict):
            raise TypeError("Expected argument 'tags' to be a dict")
        pulumi.set(__self__, "tags", tags)

    @property
    @pulumi.getter
    def hostname(self) -> str:
        """
        The Hostname of the IoTHub.
        """
        return pulumi.get(self, "hostname")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def identities(self) -> Sequence['outputs.GetIotHubIdentityResult']:
        """
        A `identity` block as defined below.
        """
        return pulumi.get(self, "identities")

    @property
    @pulumi.getter
    def name(self) -> str:
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="resourceGroupName")
    def METHOD_NAME(self) -> str:
        return pulumi.get(self, "resource_group_name")

    @property
    @pulumi.getter
    def tags(self) -> Optional[Mapping[str, str]]:
        return pulumi.get(self, "tags")


class AwaitableGetIotHubResult(GetIotHubResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetIotHubResult(
            hostname=self.hostname,
            id=self.id,
            identities=self.identities,
            name=self.name,
            METHOD_NAME=self.METHOD_NAME,
            tags=self.tags)


def get_iot_hub(name: Optional[str] = None,
                METHOD_NAME: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None,
                opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetIotHubResult:
    """
    Use this data source to access information about an existing IoTHub.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.iot.get_iot_hub(name="existing",
        resource_group_name="existing")
    pulumi.export("id", example.id)
    ```


    :param str name: The name of this IoTHub.
    :param str resource_group_name: The name of the Resource Group where the IoTHub exists.
    :param Mapping[str, str] tags: A mapping of tags which should be assigned to the IoTHub.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['resourceGroupName'] = METHOD_NAME
    __args__['tags'] = tags
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('azure:iot/getIotHub:getIotHub', __args__, opts=opts, typ=GetIotHubResult).value

    return AwaitableGetIotHubResult(
        hostname=pulumi.get(__ret__, 'hostname'),
        id=pulumi.get(__ret__, 'id'),
        identities=pulumi.get(__ret__, 'identities'),
        name=pulumi.get(__ret__, 'name'),
        METHOD_NAME=pulumi.get(__ret__, 'resource_group_name'),
        tags=pulumi.get(__ret__, 'tags'))


@_utilities.lift_output_func(get_iot_hub)
def get_iot_hub_output(name: Optional[pulumi.Input[str]] = None,
                       METHOD_NAME: Optional[pulumi.Input[str]] = None,
                       tags: Optional[pulumi.Input[Optional[Mapping[str, str]]]] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetIotHubResult]:
    """
    Use this data source to access information about an existing IoTHub.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.iot.get_iot_hub(name="existing",
        resource_group_name="existing")
    pulumi.export("id", example.id)
    ```


    :param str name: The name of this IoTHub.
    :param str resource_group_name: The name of the Resource Group where the IoTHub exists.
    :param Mapping[str, str] tags: A mapping of tags which should be assigned to the IoTHub.
    """
    ...