# 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 warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables


class EventHub(pulumi.CustomResource):
    capture_description: pulumi.Output[dict]
    """
    A `capture_description` block as defined below.

      * `destination` (`dict`) - A `destination` block as defined below.
        * `archiveNameFormat` (`str`) - The Blob naming convention for archiving. e.g. `{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}`. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order
        * `blobContainerName` (`str`) - The name of the Container within the Blob Storage Account where messages should be archived.
        * `name` (`str`) - The Name of the Destination where the capture should take place. At this time the only supported value is `EventHubArchive.AzureBlockBlob`.
        * `storage_account_id` (`str`) - The ID of the Blob Storage Account where messages should be archived.

      * `enabled` (`bool`) - Specifies if the Capture Description is Enabled.
      * `encoding` (`str`) - Specifies the Encoding used for the Capture Description. Possible values are `Avro` and `AvroDeflate`.
      * `interval_in_seconds` (`float`) - Specifies the time interval in seconds at which the capture will happen. Values can be between `60` and `900` seconds. Defaults to `300` seconds.
      * `sizeLimitInBytes` (`float`) - Specifies the amount of data built up in your EventHub before a Capture Operation occurs. Value should be between `10485760` and `524288000`  bytes. Defaults to `314572800` bytes.
      * `skipEmptyArchives` (`bool`) - Specifies if empty files should not be emitted if no events occur during the Capture time window.  Defaults to `false`.
    """
    message_retention: pulumi.Output[float]
    """
    Specifies the number of days to retain the events for this Event Hub. Needs to be between 1 and 7 days; or 1 day when using a Basic SKU for the parent EventHub Namespace.
    """
    name: pulumi.Output[str]
    """
    Specifies the name of the EventHub Namespace resource. Changing this forces a new resource to be created.
    """
    namespace_name: pulumi.Output[str]
    """
    Specifies the name of the EventHub Namespace. Changing this forces a new resource to be created.
    """
    partition_count: pulumi.Output[float]
    """
    Specifies the current number of shards on the Event Hub. Changing this forces a new resource to be created.
    """
    partition_ids: pulumi.Output[list]
    """
    The identifiers for partitions created for Event Hubs.
    """
    resource_group_name: pulumi.Output[str]
    """
    The name of the resource group in which the EventHub's parent Namespace exists. Changing this forces a new resource to be created.
    """
    def __init__(__self__, resource_name, opts=None, capture_description=None, message_retention=None, name=None, namespace_name=None, partition_count=None, resource_group_name=None, __props__=None, __name__=None, __opts__=None):
        """
        Manages a Event Hubs as a nested resource within a Event Hubs namespace.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US")
        example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            sku="Standard",
            capacity=1,
            tags={
                "environment": "Production",
            })
        example_event_hub = azure.eventhub.EventHub("exampleEventHub",
            namespace_name=example_event_hub_namespace.name,
            resource_group_name=example_resource_group.name,
            partition_count=2,
            message_retention=1)
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] capture_description: A `capture_description` block as defined below.
        :param pulumi.Input[float] message_retention: Specifies the number of days to retain the events for this Event Hub. Needs to be between 1 and 7 days; or 1 day when using a Basic SKU for the parent EventHub Namespace.
        :param pulumi.Input[str] name: Specifies the name of the EventHub Namespace resource. Changing this forces a new resource to be created.
        :param pulumi.Input[str] namespace_name: Specifies the name of the EventHub Namespace. Changing this forces a new resource to be created.
        :param pulumi.Input[float] partition_count: Specifies the current number of shards on the Event Hub. Changing this forces a new resource to be created.
        :param pulumi.Input[str] resource_group_name: The name of the resource group in which the EventHub's parent Namespace exists. Changing this forces a new resource to be created.

        The **capture_description** object supports the following:

          * `destination` (`pulumi.Input[dict]`) - A `destination` block as defined below.
            * `archiveNameFormat` (`pulumi.Input[str]`) - The Blob naming convention for archiving. e.g. `{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}`. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order
            * `blobContainerName` (`pulumi.Input[str]`) - The name of the Container within the Blob Storage Account where messages should be archived.
            * `name` (`pulumi.Input[str]`) - The Name of the Destination where the capture should take place. At this time the only supported value is `EventHubArchive.AzureBlockBlob`.
            * `storage_account_id` (`pulumi.Input[str]`) - The ID of the Blob Storage Account where messages should be archived.

          * `enabled` (`pulumi.Input[bool]`) - Specifies if the Capture Description is Enabled.
          * `encoding` (`pulumi.Input[str]`) - Specifies the Encoding used for the Capture Description. Possible values are `Avro` and `AvroDeflate`.
          * `interval_in_seconds` (`pulumi.Input[float]`) - Specifies the time interval in seconds at which the capture will happen. Values can be between `60` and `900` seconds. Defaults to `300` seconds.
          * `sizeLimitInBytes` (`pulumi.Input[float]`) - Specifies the amount of data built up in your EventHub before a Capture Operation occurs. Value should be between `10485760` and `524288000`  bytes. Defaults to `314572800` bytes.
          * `skipEmptyArchives` (`pulumi.Input[bool]`) - Specifies if empty files should not be emitted if no events occur during the Capture time window.  Defaults to `false`.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['capture_description'] = capture_description
            if message_retention is None:
                raise TypeError("Missing required property 'message_retention'")
            __props__['message_retention'] = message_retention
            __props__['name'] = name
            if namespace_name is None:
                raise TypeError("Missing required property 'namespace_name'")
            __props__['namespace_name'] = namespace_name
            if partition_count is None:
                raise TypeError("Missing required property 'partition_count'")
            __props__['partition_count'] = partition_count
            if resource_group_name is None:
                raise TypeError("Missing required property 'resource_group_name'")
            __props__['resource_group_name'] = resource_group_name
            __props__['partition_ids'] = None
        super(EventHub, __self__).__init__(
            'azure:eventhub/eventHub:EventHub',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, capture_description=None, message_retention=None, name=None, namespace_name=None, partition_count=None, partition_ids=None, resource_group_name=None):
        """
        Get an existing EventHub resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] capture_description: A `capture_description` block as defined below.
        :param pulumi.Input[float] message_retention: Specifies the number of days to retain the events for this Event Hub. Needs to be between 1 and 7 days; or 1 day when using a Basic SKU for the parent EventHub Namespace.
        :param pulumi.Input[str] name: Specifies the name of the EventHub Namespace resource. Changing this forces a new resource to be created.
        :param pulumi.Input[str] namespace_name: Specifies the name of the EventHub Namespace. Changing this forces a new resource to be created.
        :param pulumi.Input[float] partition_count: Specifies the current number of shards on the Event Hub. Changing this forces a new resource to be created.
        :param pulumi.Input[list] partition_ids: The identifiers for partitions created for Event Hubs.
        :param pulumi.Input[str] resource_group_name: The name of the resource group in which the EventHub's parent Namespace exists. Changing this forces a new resource to be created.

        The **capture_description** object supports the following:

          * `destination` (`pulumi.Input[dict]`) - A `destination` block as defined below.
            * `archiveNameFormat` (`pulumi.Input[str]`) - The Blob naming convention for archiving. e.g. `{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}`. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order
            * `blobContainerName` (`pulumi.Input[str]`) - The name of the Container within the Blob Storage Account where messages should be archived.
            * `name` (`pulumi.Input[str]`) - The Name of the Destination where the capture should take place. At this time the only supported value is `EventHubArchive.AzureBlockBlob`.
            * `storage_account_id` (`pulumi.Input[str]`) - The ID of the Blob Storage Account where messages should be archived.

          * `enabled` (`pulumi.Input[bool]`) - Specifies if the Capture Description is Enabled.
          * `encoding` (`pulumi.Input[str]`) - Specifies the Encoding used for the Capture Description. Possible values are `Avro` and `AvroDeflate`.
          * `interval_in_seconds` (`pulumi.Input[float]`) - Specifies the time interval in seconds at which the capture will happen. Values can be between `60` and `900` seconds. Defaults to `300` seconds.
          * `sizeLimitInBytes` (`pulumi.Input[float]`) - Specifies the amount of data built up in your EventHub before a Capture Operation occurs. Value should be between `10485760` and `524288000`  bytes. Defaults to `314572800` bytes.
          * `skipEmptyArchives` (`pulumi.Input[bool]`) - Specifies if empty files should not be emitted if no events occur during the Capture time window.  Defaults to `false`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["capture_description"] = capture_description
        __props__["message_retention"] = message_retention
        __props__["name"] = name
        __props__["namespace_name"] = namespace_name
        __props__["partition_count"] = partition_count
        __props__["partition_ids"] = partition_ids
        __props__["resource_group_name"] = resource_group_name
        return EventHub(resource_name, opts=opts, __props__=__props__)

    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
