# 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 sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['EventSubscriptionArgs', 'EventSubscription']

@pulumi.input_type
class EventSubscriptionArgs:
    def __init__(__self__, *,
                 scope: pulumi.Input[str],
                 advanced_filter: Optional[pulumi.Input['EventSubscriptionAdvancedFilterArgs']] = None,
                 advanced_filtering_on_arrays_enabled: Optional[pulumi.Input[bool]] = None,
                 azure_function_endpoint: Optional[pulumi.Input['EventSubscriptionAzureFunctionEndpointArgs']] = None,
                 dead_letter_identity: Optional[pulumi.Input['EventSubscriptionDeadLetterIdentityArgs']] = None,
                 delivery_identity: Optional[pulumi.Input['EventSubscriptionDeliveryIdentityArgs']] = None,
                 delivery_properties: Optional[pulumi.Input[Sequence[pulumi.Input['EventSubscriptionDeliveryPropertyArgs']]]] = None,
                 event_delivery_schema: Optional[pulumi.Input[str]] = None,
                 eventhub_endpoint_id: Optional[pulumi.Input[str]] = None,
                 expiration_time_utc: Optional[pulumi.Input[str]] = None,
                 hybrid_connection_endpoint_id: Optional[pulumi.Input[str]] = None,
                 included_event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 labels: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 retry_policy: Optional[pulumi.Input['EventSubscriptionRetryPolicyArgs']] = None,
                 service_bus_queue_endpoint_id: Optional[pulumi.Input[str]] = None,
                 service_bus_topic_endpoint_id: Optional[pulumi.Input[str]] = None,
                 storage_blob_dead_letter_destination: Optional[pulumi.Input['EventSubscriptionStorageBlobDeadLetterDestinationArgs']] = None,
                 storage_queue_endpoint: Optional[pulumi.Input['EventSubscriptionStorageQueueEndpointArgs']] = None,
                 subject_filter: Optional[pulumi.Input['EventSubscriptionSubjectFilterArgs']] = None,
                 webhook_endpoint: Optional[pulumi.Input['EventSubscriptionWebhookEndpointArgs']] = None):
        """
        The set of arguments for constructing a EventSubscription resource.
        :param pulumi.Input[str] scope: Specifies the scope at which the EventGrid Event Subscription should be created. Changing this forces a new resource to be created.
        :param pulumi.Input['EventSubscriptionAdvancedFilterArgs'] advanced_filter: A `advanced_filter` block as defined below.
        :param pulumi.Input[bool] advanced_filtering_on_arrays_enabled: Specifies whether advanced filters should be evaluated against an array of values instead of expecting a singular value. Defaults to `false`.
        :param pulumi.Input['EventSubscriptionAzureFunctionEndpointArgs'] azure_function_endpoint: An `azure_function_endpoint` block as defined below.
        :param pulumi.Input['EventSubscriptionDeadLetterIdentityArgs'] dead_letter_identity: A `dead_letter_identity` block as defined below.
               
               > **Note:** `storage_blob_dead_letter_destination` must be specified when a `dead_letter_identity` is specified
        :param pulumi.Input['EventSubscriptionDeliveryIdentityArgs'] delivery_identity: A `delivery_identity` block as defined below.
        :param pulumi.Input[Sequence[pulumi.Input['EventSubscriptionDeliveryPropertyArgs']]] delivery_properties: One or more `delivery_property` blocks as defined below.
        :param pulumi.Input[str] event_delivery_schema: Specifies the event delivery schema for the event subscription. Possible values include: `EventGridSchema`, `CloudEventSchemaV1_0`, `CustomInputSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
        :param pulumi.Input[str] eventhub_endpoint_id: Specifies the id where the Event Hub is located.
        :param pulumi.Input[str] expiration_time_utc: Specifies the expiration time of the event subscription (Datetime Format `RFC 3339`).
        :param pulumi.Input[str] hybrid_connection_endpoint_id: Specifies the id where the Hybrid Connection is located.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] included_event_types: A list of applicable event types that need to be part of the event subscription.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] labels: A list of labels to assign to the event subscription.
        :param pulumi.Input[str] name: Specifies the name of the EventGrid Event Subscription resource. Changing this forces a new resource to be created.
        :param pulumi.Input['EventSubscriptionRetryPolicyArgs'] retry_policy: A `retry_policy` block as defined below.
        :param pulumi.Input[str] service_bus_queue_endpoint_id: Specifies the id where the Service Bus Queue is located.
        :param pulumi.Input[str] service_bus_topic_endpoint_id: Specifies the id where the Service Bus Topic is located.
        :param pulumi.Input['EventSubscriptionStorageBlobDeadLetterDestinationArgs'] storage_blob_dead_letter_destination: A `storage_blob_dead_letter_destination` block as defined below.
        :param pulumi.Input['EventSubscriptionStorageQueueEndpointArgs'] storage_queue_endpoint: A `storage_queue_endpoint` block as defined below.
        :param pulumi.Input['EventSubscriptionSubjectFilterArgs'] subject_filter: A `subject_filter` block as defined below.
        :param pulumi.Input['EventSubscriptionWebhookEndpointArgs'] webhook_endpoint: A `webhook_endpoint` block as defined below.
               
               > **NOTE:** One of `eventhub_endpoint_id`, `hybrid_connection_endpoint_id`, `service_bus_queue_endpoint_id`, `service_bus_topic_endpoint_id`, `storage_queue_endpoint`, `webhook_endpoint` or `azure_function_endpoint` must be specified.
        """
        pulumi.set(__self__, "scope", scope)
        if advanced_filter is not None:
            pulumi.set(__self__, "advanced_filter", advanced_filter)
        if advanced_filtering_on_arrays_enabled is not None:
            pulumi.set(__self__, "advanced_filtering_on_arrays_enabled", advanced_filtering_on_arrays_enabled)
        if azure_function_endpoint is not None:
            pulumi.set(__self__, "azure_function_endpoint", azure_function_endpoint)
        if dead_letter_identity is not None:
            pulumi.set(__self__, "dead_letter_identity", dead_letter_identity)
        if delivery_identity is not None:
            pulumi.set(__self__, "delivery_identity", delivery_identity)
        if delivery_properties is not None:
            pulumi.set(__self__, "delivery_properties", delivery_properties)
        if event_delivery_schema is not None:
            pulumi.set(__self__, "event_delivery_schema", event_delivery_schema)
        if eventhub_endpoint_id is not None:
            pulumi.set(__self__, "eventhub_endpoint_id", eventhub_endpoint_id)
        if expiration_time_utc is not None:
            pulumi.set(__self__, "expiration_time_utc", expiration_time_utc)
        if hybrid_connection_endpoint_id is not None:
            pulumi.set(__self__, "hybrid_connection_endpoint_id", hybrid_connection_endpoint_id)
        if included_event_types is not None:
            pulumi.set(__self__, "included_event_types", included_event_types)
        if labels is not None:
            pulumi.set(__self__, "labels", labels)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if retry_policy is not None:
            pulumi.set(__self__, "retry_policy", retry_policy)
        if service_bus_queue_endpoint_id is not None:
            pulumi.set(__self__, "service_bus_queue_endpoint_id", service_bus_queue_endpoint_id)
        if service_bus_topic_endpoint_id is not None:
            pulumi.set(__self__, "service_bus_topic_endpoint_id", service_bus_topic_endpoint_id)
        if storage_blob_dead_letter_destination is not None:
            pulumi.set(__self__, "storage_blob_dead_letter_destination", storage_blob_dead_letter_destination)
        if storage_queue_endpoint is not None:
            pulumi.set(__self__, "storage_queue_endpoint", storage_queue_endpoint)
        if subject_filter is not None:
            pulumi.set(__self__, "subject_filter", subject_filter)
        if webhook_endpoint is not None:
            pulumi.set(__self__, "webhook_endpoint", webhook_endpoint)

    @property
    @pulumi.getter
    def scope(self) -> pulumi.Input[str]:
        """
        Specifies the scope at which the EventGrid Event Subscription should be created. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "scope")

    @scope.setter
    def scope(self, value: pulumi.Input[str]):
        pulumi.set(self, "scope", value)

    @property
    @pulumi.getter(name="advancedFilter")
    def advanced_filter(self) -> Optional[pulumi.Input['EventSubscriptionAdvancedFilterArgs']]:
        """
        A `advanced_filter` block as defined below.
        """
        return pulumi.get(self, "advanced_filter")

    @advanced_filter.setter
    def advanced_filter(self, value: Optional[pulumi.Input['EventSubscriptionAdvancedFilterArgs']]):
        pulumi.set(self, "advanced_filter", value)

    @property
    @pulumi.getter(name="advancedFilteringOnArraysEnabled")
    def advanced_filtering_on_arrays_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Specifies whether advanced filters should be evaluated against an array of values instead of expecting a singular value. Defaults to `false`.
        """
        return pulumi.get(self, "advanced_filtering_on_arrays_enabled")

    @advanced_filtering_on_arrays_enabled.setter
    def advanced_filtering_on_arrays_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "advanced_filtering_on_arrays_enabled", value)

    @property
    @pulumi.getter(name="azureFunctionEndpoint")
    def azure_function_endpoint(self) -> Optional[pulumi.Input['EventSubscriptionAzureFunctionEndpointArgs']]:
        """
        An `azure_function_endpoint` block as defined below.
        """
        return pulumi.get(self, "azure_function_endpoint")

    @azure_function_endpoint.setter
    def azure_function_endpoint(self, value: Optional[pulumi.Input['EventSubscriptionAzureFunctionEndpointArgs']]):
        pulumi.set(self, "azure_function_endpoint", value)

    @property
    @pulumi.getter(name="deadLetterIdentity")
    def dead_letter_identity(self) -> Optional[pulumi.Input['EventSubscriptionDeadLetterIdentityArgs']]:
        """
        A `dead_letter_identity` block as defined below.

        > **Note:** `storage_blob_dead_letter_destination` must be specified when a `dead_letter_identity` is specified
        """
        return pulumi.get(self, "dead_letter_identity")

    @dead_letter_identity.setter
    def dead_letter_identity(self, value: Optional[pulumi.Input['EventSubscriptionDeadLetterIdentityArgs']]):
        pulumi.set(self, "dead_letter_identity", value)

    @property
    @pulumi.getter(name="deliveryIdentity")
    def delivery_identity(self) -> Optional[pulumi.Input['EventSubscriptionDeliveryIdentityArgs']]:
        """
        A `delivery_identity` block as defined below.
        """
        return pulumi.get(self, "delivery_identity")

    @delivery_identity.setter
    def delivery_identity(self, value: Optional[pulumi.Input['EventSubscriptionDeliveryIdentityArgs']]):
        pulumi.set(self, "delivery_identity", value)

    @property
    @pulumi.getter(name="deliveryProperties")
    def delivery_properties(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EventSubscriptionDeliveryPropertyArgs']]]]:
        """
        One or more `delivery_property` blocks as defined below.
        """
        return pulumi.get(self, "delivery_properties")

    @delivery_properties.setter
    def delivery_properties(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['EventSubscriptionDeliveryPropertyArgs']]]]):
        pulumi.set(self, "delivery_properties", value)

    @property
    @pulumi.getter(name="eventDeliverySchema")
    def event_delivery_schema(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the event delivery schema for the event subscription. Possible values include: `EventGridSchema`, `CloudEventSchemaV1_0`, `CustomInputSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "event_delivery_schema")

    @event_delivery_schema.setter
    def event_delivery_schema(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "event_delivery_schema", value)

    @property
    @pulumi.getter(name="eventhubEndpointId")
    def eventhub_endpoint_id(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the id where the Event Hub is located.
        """
        return pulumi.get(self, "eventhub_endpoint_id")

    @eventhub_endpoint_id.setter
    def eventhub_endpoint_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "eventhub_endpoint_id", value)

    @property
    @pulumi.getter(name="expirationTimeUtc")
    def expiration_time_utc(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the expiration time of the event subscription (Datetime Format `RFC 3339`).
        """
        return pulumi.get(self, "expiration_time_utc")

    @expiration_time_utc.setter
    def expiration_time_utc(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "expiration_time_utc", value)

    @property
    @pulumi.getter(name="hybridConnectionEndpointId")
    def hybrid_connection_endpoint_id(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the id where the Hybrid Connection is located.
        """
        return pulumi.get(self, "hybrid_connection_endpoint_id")

    @hybrid_connection_endpoint_id.setter
    def hybrid_connection_endpoint_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "hybrid_connection_endpoint_id", value)

    @property
    @pulumi.getter(name="includedEventTypes")
    def included_event_types(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of applicable event types that need to be part of the event subscription.
        """
        return pulumi.get(self, "included_event_types")

    @included_event_types.setter
    def included_event_types(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "included_event_types", value)

    @property
    @pulumi.getter
    def labels(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of labels to assign to the event subscription.
        """
        return pulumi.get(self, "labels")

    @labels.setter
    def labels(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "labels", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the name of the EventGrid Event Subscription resource. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter(name="retryPolicy")
    def retry_policy(self) -> Optional[pulumi.Input['EventSubscriptionRetryPolicyArgs']]:
        """
        A `retry_policy` block as defined below.
        """
        return pulumi.get(self, "retry_policy")

    @retry_policy.setter
    def retry_policy(self, value: Optional[pulumi.Input['EventSubscriptionRetryPolicyArgs']]):
        pulumi.set(self, "retry_policy", value)

    @property
    @pulumi.getter(name="serviceBusQueueEndpointId")
    def service_bus_queue_endpoint_id(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the id where the Service Bus Queue is located.
        """
        return pulumi.get(self, "service_bus_queue_endpoint_id")

    @service_bus_queue_endpoint_id.setter
    def service_bus_queue_endpoint_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "service_bus_queue_endpoint_id", value)

    @property
    @pulumi.getter(name="serviceBusTopicEndpointId")
    def service_bus_topic_endpoint_id(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the id where the Service Bus Topic is located.
        """
        return pulumi.get(self, "service_bus_topic_endpoint_id")

    @service_bus_topic_endpoint_id.setter
    def service_bus_topic_endpoint_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "service_bus_topic_endpoint_id", value)

    @property
    @pulumi.getter(name="storageBlobDeadLetterDestination")
    def storage_blob_dead_letter_destination(self) -> Optional[pulumi.Input['EventSubscriptionStorageBlobDeadLetterDestinationArgs']]:
        """
        A `storage_blob_dead_letter_destination` block as defined below.
        """
        return pulumi.get(self, "storage_blob_dead_letter_destination")

    @storage_blob_dead_letter_destination.setter
    def storage_blob_dead_letter_destination(self, value: Optional[pulumi.Input['EventSubscriptionStorageBlobDeadLetterDestinationArgs']]):
        pulumi.set(self, "storage_blob_dead_letter_destination", value)

    @property
    @pulumi.getter(name="storageQueueEndpoint")
    def storage_queue_endpoint(self) -> Optional[pulumi.Input['EventSubscriptionStorageQueueEndpointArgs']]:
        """
        A `storage_queue_endpoint` block as defined below.
        """
        return pulumi.get(self, "storage_queue_endpoint")

    @storage_queue_endpoint.setter
    def storage_queue_endpoint(self, value: Optional[pulumi.Input['EventSubscriptionStorageQueueEndpointArgs']]):
        pulumi.set(self, "storage_queue_endpoint", value)

    @property
    @pulumi.getter(name="subjectFilter")
    def subject_filter(self) -> Optional[pulumi.Input['EventSubscriptionSubjectFilterArgs']]:
        """
        A `subject_filter` block as defined below.
        """
        return pulumi.get(self, "subject_filter")

    @subject_filter.setter
    def subject_filter(self, value: Optional[pulumi.Input['EventSubscriptionSubjectFilterArgs']]):
        pulumi.set(self, "subject_filter", value)

    @property
    @pulumi.getter(name="webhookEndpoint")
    def webhook_endpoint(self) -> Optional[pulumi.Input['EventSubscriptionWebhookEndpointArgs']]:
        """
        A `webhook_endpoint` block as defined below.

        > **NOTE:** One of `eventhub_endpoint_id`, `hybrid_connection_endpoint_id`, `service_bus_queue_endpoint_id`, `service_bus_topic_endpoint_id`, `storage_queue_endpoint`, `webhook_endpoint` or `azure_function_endpoint` must be specified.
        """
        return pulumi.get(self, "webhook_endpoint")

    @webhook_endpoint.setter
    def webhook_endpoint(self, value: Optional[pulumi.Input['EventSubscriptionWebhookEndpointArgs']]):
        pulumi.set(self, "webhook_endpoint", value)


@pulumi.input_type
class _EventSubscriptionState:
    def __init__(__self__, *,
                 advanced_filter: Optional[pulumi.Input['EventSubscriptionAdvancedFilterArgs']] = None,
                 advanced_filtering_on_arrays_enabled: Optional[pulumi.Input[bool]] = None,
                 azure_function_endpoint: Optional[pulumi.Input['EventSubscriptionAzureFunctionEndpointArgs']] = None,
                 dead_letter_identity: Optional[pulumi.Input['EventSubscriptionDeadLetterIdentityArgs']] = None,
                 delivery_identity: Optional[pulumi.Input['EventSubscriptionDeliveryIdentityArgs']] = None,
                 delivery_properties: Optional[pulumi.Input[Sequence[pulumi.Input['EventSubscriptionDeliveryPropertyArgs']]]] = None,
                 event_delivery_schema: Optional[pulumi.Input[str]] = None,
                 eventhub_endpoint_id: Optional[pulumi.Input[str]] = None,
                 expiration_time_utc: Optional[pulumi.Input[str]] = None,
                 hybrid_connection_endpoint_id: Optional[pulumi.Input[str]] = None,
                 included_event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 labels: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 retry_policy: Optional[pulumi.Input['EventSubscriptionRetryPolicyArgs']] = None,
                 scope: Optional[pulumi.Input[str]] = None,
                 service_bus_queue_endpoint_id: Optional[pulumi.Input[str]] = None,
                 service_bus_topic_endpoint_id: Optional[pulumi.Input[str]] = None,
                 storage_blob_dead_letter_destination: Optional[pulumi.Input['EventSubscriptionStorageBlobDeadLetterDestinationArgs']] = None,
                 storage_queue_endpoint: Optional[pulumi.Input['EventSubscriptionStorageQueueEndpointArgs']] = None,
                 subject_filter: Optional[pulumi.Input['EventSubscriptionSubjectFilterArgs']] = None,
                 webhook_endpoint: Optional[pulumi.Input['EventSubscriptionWebhookEndpointArgs']] = None):
        """
        Input properties used for looking up and filtering EventSubscription resources.
        :param pulumi.Input['EventSubscriptionAdvancedFilterArgs'] advanced_filter: A `advanced_filter` block as defined below.
        :param pulumi.Input[bool] advanced_filtering_on_arrays_enabled: Specifies whether advanced filters should be evaluated against an array of values instead of expecting a singular value. Defaults to `false`.
        :param pulumi.Input['EventSubscriptionAzureFunctionEndpointArgs'] azure_function_endpoint: An `azure_function_endpoint` block as defined below.
        :param pulumi.Input['EventSubscriptionDeadLetterIdentityArgs'] dead_letter_identity: A `dead_letter_identity` block as defined below.
               
               > **Note:** `storage_blob_dead_letter_destination` must be specified when a `dead_letter_identity` is specified
        :param pulumi.Input['EventSubscriptionDeliveryIdentityArgs'] delivery_identity: A `delivery_identity` block as defined below.
        :param pulumi.Input[Sequence[pulumi.Input['EventSubscriptionDeliveryPropertyArgs']]] delivery_properties: One or more `delivery_property` blocks as defined below.
        :param pulumi.Input[str] event_delivery_schema: Specifies the event delivery schema for the event subscription. Possible values include: `EventGridSchema`, `CloudEventSchemaV1_0`, `CustomInputSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
        :param pulumi.Input[str] eventhub_endpoint_id: Specifies the id where the Event Hub is located.
        :param pulumi.Input[str] expiration_time_utc: Specifies the expiration time of the event subscription (Datetime Format `RFC 3339`).
        :param pulumi.Input[str] hybrid_connection_endpoint_id: Specifies the id where the Hybrid Connection is located.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] included_event_types: A list of applicable event types that need to be part of the event subscription.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] labels: A list of labels to assign to the event subscription.
        :param pulumi.Input[str] name: Specifies the name of the EventGrid Event Subscription resource. Changing this forces a new resource to be created.
        :param pulumi.Input['EventSubscriptionRetryPolicyArgs'] retry_policy: A `retry_policy` block as defined below.
        :param pulumi.Input[str] scope: Specifies the scope at which the EventGrid Event Subscription should be created. Changing this forces a new resource to be created.
        :param pulumi.Input[str] service_bus_queue_endpoint_id: Specifies the id where the Service Bus Queue is located.
        :param pulumi.Input[str] service_bus_topic_endpoint_id: Specifies the id where the Service Bus Topic is located.
        :param pulumi.Input['EventSubscriptionStorageBlobDeadLetterDestinationArgs'] storage_blob_dead_letter_destination: A `storage_blob_dead_letter_destination` block as defined below.
        :param pulumi.Input['EventSubscriptionStorageQueueEndpointArgs'] storage_queue_endpoint: A `storage_queue_endpoint` block as defined below.
        :param pulumi.Input['EventSubscriptionSubjectFilterArgs'] subject_filter: A `subject_filter` block as defined below.
        :param pulumi.Input['EventSubscriptionWebhookEndpointArgs'] webhook_endpoint: A `webhook_endpoint` block as defined below.
               
               > **NOTE:** One of `eventhub_endpoint_id`, `hybrid_connection_endpoint_id`, `service_bus_queue_endpoint_id`, `service_bus_topic_endpoint_id`, `storage_queue_endpoint`, `webhook_endpoint` or `azure_function_endpoint` must be specified.
        """
        if advanced_filter is not None:
            pulumi.set(__self__, "advanced_filter", advanced_filter)
        if advanced_filtering_on_arrays_enabled is not None:
            pulumi.set(__self__, "advanced_filtering_on_arrays_enabled", advanced_filtering_on_arrays_enabled)
        if azure_function_endpoint is not None:
            pulumi.set(__self__, "azure_function_endpoint", azure_function_endpoint)
        if dead_letter_identity is not None:
            pulumi.set(__self__, "dead_letter_identity", dead_letter_identity)
        if delivery_identity is not None:
            pulumi.set(__self__, "delivery_identity", delivery_identity)
        if delivery_properties is not None:
            pulumi.set(__self__, "delivery_properties", delivery_properties)
        if event_delivery_schema is not None:
            pulumi.set(__self__, "event_delivery_schema", event_delivery_schema)
        if eventhub_endpoint_id is not None:
            pulumi.set(__self__, "eventhub_endpoint_id", eventhub_endpoint_id)
        if expiration_time_utc is not None:
            pulumi.set(__self__, "expiration_time_utc", expiration_time_utc)
        if hybrid_connection_endpoint_id is not None:
            pulumi.set(__self__, "hybrid_connection_endpoint_id", hybrid_connection_endpoint_id)
        if included_event_types is not None:
            pulumi.set(__self__, "included_event_types", included_event_types)
        if labels is not None:
            pulumi.set(__self__, "labels", labels)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if retry_policy is not None:
            pulumi.set(__self__, "retry_policy", retry_policy)
        if scope is not None:
            pulumi.set(__self__, "scope", scope)
        if service_bus_queue_endpoint_id is not None:
            pulumi.set(__self__, "service_bus_queue_endpoint_id", service_bus_queue_endpoint_id)
        if service_bus_topic_endpoint_id is not None:
            pulumi.set(__self__, "service_bus_topic_endpoint_id", service_bus_topic_endpoint_id)
        if storage_blob_dead_letter_destination is not None:
            pulumi.set(__self__, "storage_blob_dead_letter_destination", storage_blob_dead_letter_destination)
        if storage_queue_endpoint is not None:
            pulumi.set(__self__, "storage_queue_endpoint", storage_queue_endpoint)
        if subject_filter is not None:
            pulumi.set(__self__, "subject_filter", subject_filter)
        if webhook_endpoint is not None:
            pulumi.set(__self__, "webhook_endpoint", webhook_endpoint)

    @property
    @pulumi.getter(name="advancedFilter")
    def advanced_filter(self) -> Optional[pulumi.Input['EventSubscriptionAdvancedFilterArgs']]:
        """
        A `advanced_filter` block as defined below.
        """
        return pulumi.get(self, "advanced_filter")

    @advanced_filter.setter
    def advanced_filter(self, value: Optional[pulumi.Input['EventSubscriptionAdvancedFilterArgs']]):
        pulumi.set(self, "advanced_filter", value)

    @property
    @pulumi.getter(name="advancedFilteringOnArraysEnabled")
    def advanced_filtering_on_arrays_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Specifies whether advanced filters should be evaluated against an array of values instead of expecting a singular value. Defaults to `false`.
        """
        return pulumi.get(self, "advanced_filtering_on_arrays_enabled")

    @advanced_filtering_on_arrays_enabled.setter
    def advanced_filtering_on_arrays_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "advanced_filtering_on_arrays_enabled", value)

    @property
    @pulumi.getter(name="azureFunctionEndpoint")
    def azure_function_endpoint(self) -> Optional[pulumi.Input['EventSubscriptionAzureFunctionEndpointArgs']]:
        """
        An `azure_function_endpoint` block as defined below.
        """
        return pulumi.get(self, "azure_function_endpoint")

    @azure_function_endpoint.setter
    def azure_function_endpoint(self, value: Optional[pulumi.Input['EventSubscriptionAzureFunctionEndpointArgs']]):
        pulumi.set(self, "azure_function_endpoint", value)

    @property
    @pulumi.getter(name="deadLetterIdentity")
    def dead_letter_identity(self) -> Optional[pulumi.Input['EventSubscriptionDeadLetterIdentityArgs']]:
        """
        A `dead_letter_identity` block as defined below.

        > **Note:** `storage_blob_dead_letter_destination` must be specified when a `dead_letter_identity` is specified
        """
        return pulumi.get(self, "dead_letter_identity")

    @dead_letter_identity.setter
    def dead_letter_identity(self, value: Optional[pulumi.Input['EventSubscriptionDeadLetterIdentityArgs']]):
        pulumi.set(self, "dead_letter_identity", value)

    @property
    @pulumi.getter(name="deliveryIdentity")
    def delivery_identity(self) -> Optional[pulumi.Input['EventSubscriptionDeliveryIdentityArgs']]:
        """
        A `delivery_identity` block as defined below.
        """
        return pulumi.get(self, "delivery_identity")

    @delivery_identity.setter
    def delivery_identity(self, value: Optional[pulumi.Input['EventSubscriptionDeliveryIdentityArgs']]):
        pulumi.set(self, "delivery_identity", value)

    @property
    @pulumi.getter(name="deliveryProperties")
    def delivery_properties(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EventSubscriptionDeliveryPropertyArgs']]]]:
        """
        One or more `delivery_property` blocks as defined below.
        """
        return pulumi.get(self, "delivery_properties")

    @delivery_properties.setter
    def delivery_properties(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['EventSubscriptionDeliveryPropertyArgs']]]]):
        pulumi.set(self, "delivery_properties", value)

    @property
    @pulumi.getter(name="eventDeliverySchema")
    def event_delivery_schema(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the event delivery schema for the event subscription. Possible values include: `EventGridSchema`, `CloudEventSchemaV1_0`, `CustomInputSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "event_delivery_schema")

    @event_delivery_schema.setter
    def event_delivery_schema(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "event_delivery_schema", value)

    @property
    @pulumi.getter(name="eventhubEndpointId")
    def eventhub_endpoint_id(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the id where the Event Hub is located.
        """
        return pulumi.get(self, "eventhub_endpoint_id")

    @eventhub_endpoint_id.setter
    def eventhub_endpoint_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "eventhub_endpoint_id", value)

    @property
    @pulumi.getter(name="expirationTimeUtc")
    def expiration_time_utc(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the expiration time of the event subscription (Datetime Format `RFC 3339`).
        """
        return pulumi.get(self, "expiration_time_utc")

    @expiration_time_utc.setter
    def expiration_time_utc(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "expiration_time_utc", value)

    @property
    @pulumi.getter(name="hybridConnectionEndpointId")
    def hybrid_connection_endpoint_id(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the id where the Hybrid Connection is located.
        """
        return pulumi.get(self, "hybrid_connection_endpoint_id")

    @hybrid_connection_endpoint_id.setter
    def hybrid_connection_endpoint_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "hybrid_connection_endpoint_id", value)

    @property
    @pulumi.getter(name="includedEventTypes")
    def included_event_types(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of applicable event types that need to be part of the event subscription.
        """
        return pulumi.get(self, "included_event_types")

    @included_event_types.setter
    def included_event_types(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "included_event_types", value)

    @property
    @pulumi.getter
    def labels(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of labels to assign to the event subscription.
        """
        return pulumi.get(self, "labels")

    @labels.setter
    def labels(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "labels", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the name of the EventGrid Event Subscription resource. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter(name="retryPolicy")
    def retry_policy(self) -> Optional[pulumi.Input['EventSubscriptionRetryPolicyArgs']]:
        """
        A `retry_policy` block as defined below.
        """
        return pulumi.get(self, "retry_policy")

    @retry_policy.setter
    def retry_policy(self, value: Optional[pulumi.Input['EventSubscriptionRetryPolicyArgs']]):
        pulumi.set(self, "retry_policy", value)

    @property
    @pulumi.getter
    def scope(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the scope at which the EventGrid Event Subscription should be created. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "scope")

    @scope.setter
    def scope(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "scope", value)

    @property
    @pulumi.getter(name="serviceBusQueueEndpointId")
    def service_bus_queue_endpoint_id(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the id where the Service Bus Queue is located.
        """
        return pulumi.get(self, "service_bus_queue_endpoint_id")

    @service_bus_queue_endpoint_id.setter
    def service_bus_queue_endpoint_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "service_bus_queue_endpoint_id", value)

    @property
    @pulumi.getter(name="serviceBusTopicEndpointId")
    def service_bus_topic_endpoint_id(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the id where the Service Bus Topic is located.
        """
        return pulumi.get(self, "service_bus_topic_endpoint_id")

    @service_bus_topic_endpoint_id.setter
    def service_bus_topic_endpoint_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "service_bus_topic_endpoint_id", value)

    @property
    @pulumi.getter(name="storageBlobDeadLetterDestination")
    def storage_blob_dead_letter_destination(self) -> Optional[pulumi.Input['EventSubscriptionStorageBlobDeadLetterDestinationArgs']]:
        """
        A `storage_blob_dead_letter_destination` block as defined below.
        """
        return pulumi.get(self, "storage_blob_dead_letter_destination")

    @storage_blob_dead_letter_destination.setter
    def storage_blob_dead_letter_destination(self, value: Optional[pulumi.Input['EventSubscriptionStorageBlobDeadLetterDestinationArgs']]):
        pulumi.set(self, "storage_blob_dead_letter_destination", value)

    @property
    @pulumi.getter(name="storageQueueEndpoint")
    def storage_queue_endpoint(self) -> Optional[pulumi.Input['EventSubscriptionStorageQueueEndpointArgs']]:
        """
        A `storage_queue_endpoint` block as defined below.
        """
        return pulumi.get(self, "storage_queue_endpoint")

    @storage_queue_endpoint.setter
    def storage_queue_endpoint(self, value: Optional[pulumi.Input['EventSubscriptionStorageQueueEndpointArgs']]):
        pulumi.set(self, "storage_queue_endpoint", value)

    @property
    @pulumi.getter(name="subjectFilter")
    def subject_filter(self) -> Optional[pulumi.Input['EventSubscriptionSubjectFilterArgs']]:
        """
        A `subject_filter` block as defined below.
        """
        return pulumi.get(self, "subject_filter")

    @subject_filter.setter
    def subject_filter(self, value: Optional[pulumi.Input['EventSubscriptionSubjectFilterArgs']]):
        pulumi.set(self, "subject_filter", value)

    @property
    @pulumi.getter(name="webhookEndpoint")
    def webhook_endpoint(self) -> Optional[pulumi.Input['EventSubscriptionWebhookEndpointArgs']]:
        """
        A `webhook_endpoint` block as defined below.

        > **NOTE:** One of `eventhub_endpoint_id`, `hybrid_connection_endpoint_id`, `service_bus_queue_endpoint_id`, `service_bus_topic_endpoint_id`, `storage_queue_endpoint`, `webhook_endpoint` or `azure_function_endpoint` must be specified.
        """
        return pulumi.get(self, "webhook_endpoint")

    @webhook_endpoint.setter
    def webhook_endpoint(self, value: Optional[pulumi.Input['EventSubscriptionWebhookEndpointArgs']]):
        pulumi.set(self, "webhook_endpoint", value)


class EventSubscription(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 advanced_filter: Optional[pulumi.Input[Union['EventSubscriptionAdvancedFilterArgs', 'EventSubscriptionAdvancedFilterArgsDict']]] = None,
                 advanced_filtering_on_arrays_enabled: Optional[pulumi.Input[bool]] = None,
                 azure_function_endpoint: Optional[pulumi.Input[Union['EventSubscriptionAzureFunctionEndpointArgs', 'EventSubscriptionAzureFunctionEndpointArgsDict']]] = None,
                 dead_letter_identity: Optional[pulumi.Input[Union['EventSubscriptionDeadLetterIdentityArgs', 'EventSubscriptionDeadLetterIdentityArgsDict']]] = None,
                 delivery_identity: Optional[pulumi.Input[Union['EventSubscriptionDeliveryIdentityArgs', 'EventSubscriptionDeliveryIdentityArgsDict']]] = None,
                 delivery_properties: Optional[pulumi.Input[Sequence[pulumi.Input[Union['EventSubscriptionDeliveryPropertyArgs', 'EventSubscriptionDeliveryPropertyArgsDict']]]]] = None,
                 event_delivery_schema: Optional[pulumi.Input[str]] = None,
                 eventhub_endpoint_id: Optional[pulumi.Input[str]] = None,
                 expiration_time_utc: Optional[pulumi.Input[str]] = None,
                 hybrid_connection_endpoint_id: Optional[pulumi.Input[str]] = None,
                 included_event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 labels: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 retry_policy: Optional[pulumi.Input[Union['EventSubscriptionRetryPolicyArgs', 'EventSubscriptionRetryPolicyArgsDict']]] = None,
                 scope: Optional[pulumi.Input[str]] = None,
                 service_bus_queue_endpoint_id: Optional[pulumi.Input[str]] = None,
                 service_bus_topic_endpoint_id: Optional[pulumi.Input[str]] = None,
                 storage_blob_dead_letter_destination: Optional[pulumi.Input[Union['EventSubscriptionStorageBlobDeadLetterDestinationArgs', 'EventSubscriptionStorageBlobDeadLetterDestinationArgsDict']]] = None,
                 storage_queue_endpoint: Optional[pulumi.Input[Union['EventSubscriptionStorageQueueEndpointArgs', 'EventSubscriptionStorageQueueEndpointArgsDict']]] = None,
                 subject_filter: Optional[pulumi.Input[Union['EventSubscriptionSubjectFilterArgs', 'EventSubscriptionSubjectFilterArgsDict']]] = None,
                 webhook_endpoint: Optional[pulumi.Input[Union['EventSubscriptionWebhookEndpointArgs', 'EventSubscriptionWebhookEndpointArgsDict']]] = None,
                 __props__=None):
        """
        Manages an EventGrid Event Subscription

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example = azure.core.ResourceGroup("example",
            name="example-resources",
            location="West Europe")
        example_account = azure.storage.Account("example",
            name="exampleasa",
            resource_group_name=example.name,
            location=example.location,
            account_tier="Standard",
            account_replication_type="LRS",
            tags={
                "environment": "staging",
            })
        example_queue = azure.storage.Queue("example",
            name="example-astq",
            storage_account_name=example_account.name)
        example_event_subscription = azure.eventgrid.EventSubscription("example",
            name="example-aees",
            scope=example.id,
            storage_queue_endpoint={
                "storage_account_id": example_account.id,
                "queue_name": example_queue.name,
            })
        ```

        ## Import

        EventGrid Event Subscription's can be imported using the `resource id`, e.g.

        ```sh
        $ pulumi import azure:eventgrid/eventSubscription:EventSubscription eventSubscription1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventGrid/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscription1
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Union['EventSubscriptionAdvancedFilterArgs', 'EventSubscriptionAdvancedFilterArgsDict']] advanced_filter: A `advanced_filter` block as defined below.
        :param pulumi.Input[bool] advanced_filtering_on_arrays_enabled: Specifies whether advanced filters should be evaluated against an array of values instead of expecting a singular value. Defaults to `false`.
        :param pulumi.Input[Union['EventSubscriptionAzureFunctionEndpointArgs', 'EventSubscriptionAzureFunctionEndpointArgsDict']] azure_function_endpoint: An `azure_function_endpoint` block as defined below.
        :param pulumi.Input[Union['EventSubscriptionDeadLetterIdentityArgs', 'EventSubscriptionDeadLetterIdentityArgsDict']] dead_letter_identity: A `dead_letter_identity` block as defined below.
               
               > **Note:** `storage_blob_dead_letter_destination` must be specified when a `dead_letter_identity` is specified
        :param pulumi.Input[Union['EventSubscriptionDeliveryIdentityArgs', 'EventSubscriptionDeliveryIdentityArgsDict']] delivery_identity: A `delivery_identity` block as defined below.
        :param pulumi.Input[Sequence[pulumi.Input[Union['EventSubscriptionDeliveryPropertyArgs', 'EventSubscriptionDeliveryPropertyArgsDict']]]] delivery_properties: One or more `delivery_property` blocks as defined below.
        :param pulumi.Input[str] event_delivery_schema: Specifies the event delivery schema for the event subscription. Possible values include: `EventGridSchema`, `CloudEventSchemaV1_0`, `CustomInputSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
        :param pulumi.Input[str] eventhub_endpoint_id: Specifies the id where the Event Hub is located.
        :param pulumi.Input[str] expiration_time_utc: Specifies the expiration time of the event subscription (Datetime Format `RFC 3339`).
        :param pulumi.Input[str] hybrid_connection_endpoint_id: Specifies the id where the Hybrid Connection is located.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] included_event_types: A list of applicable event types that need to be part of the event subscription.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] labels: A list of labels to assign to the event subscription.
        :param pulumi.Input[str] name: Specifies the name of the EventGrid Event Subscription resource. Changing this forces a new resource to be created.
        :param pulumi.Input[Union['EventSubscriptionRetryPolicyArgs', 'EventSubscriptionRetryPolicyArgsDict']] retry_policy: A `retry_policy` block as defined below.
        :param pulumi.Input[str] scope: Specifies the scope at which the EventGrid Event Subscription should be created. Changing this forces a new resource to be created.
        :param pulumi.Input[str] service_bus_queue_endpoint_id: Specifies the id where the Service Bus Queue is located.
        :param pulumi.Input[str] service_bus_topic_endpoint_id: Specifies the id where the Service Bus Topic is located.
        :param pulumi.Input[Union['EventSubscriptionStorageBlobDeadLetterDestinationArgs', 'EventSubscriptionStorageBlobDeadLetterDestinationArgsDict']] storage_blob_dead_letter_destination: A `storage_blob_dead_letter_destination` block as defined below.
        :param pulumi.Input[Union['EventSubscriptionStorageQueueEndpointArgs', 'EventSubscriptionStorageQueueEndpointArgsDict']] storage_queue_endpoint: A `storage_queue_endpoint` block as defined below.
        :param pulumi.Input[Union['EventSubscriptionSubjectFilterArgs', 'EventSubscriptionSubjectFilterArgsDict']] subject_filter: A `subject_filter` block as defined below.
        :param pulumi.Input[Union['EventSubscriptionWebhookEndpointArgs', 'EventSubscriptionWebhookEndpointArgsDict']] webhook_endpoint: A `webhook_endpoint` block as defined below.
               
               > **NOTE:** One of `eventhub_endpoint_id`, `hybrid_connection_endpoint_id`, `service_bus_queue_endpoint_id`, `service_bus_topic_endpoint_id`, `storage_queue_endpoint`, `webhook_endpoint` or `azure_function_endpoint` must be specified.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: EventSubscriptionArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages an EventGrid Event Subscription

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example = azure.core.ResourceGroup("example",
            name="example-resources",
            location="West Europe")
        example_account = azure.storage.Account("example",
            name="exampleasa",
            resource_group_name=example.name,
            location=example.location,
            account_tier="Standard",
            account_replication_type="LRS",
            tags={
                "environment": "staging",
            })
        example_queue = azure.storage.Queue("example",
            name="example-astq",
            storage_account_name=example_account.name)
        example_event_subscription = azure.eventgrid.EventSubscription("example",
            name="example-aees",
            scope=example.id,
            storage_queue_endpoint={
                "storage_account_id": example_account.id,
                "queue_name": example_queue.name,
            })
        ```

        ## Import

        EventGrid Event Subscription's can be imported using the `resource id`, e.g.

        ```sh
        $ pulumi import azure:eventgrid/eventSubscription:EventSubscription eventSubscription1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventGrid/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscription1
        ```

        :param str resource_name: The name of the resource.
        :param EventSubscriptionArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(EventSubscriptionArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 advanced_filter: Optional[pulumi.Input[Union['EventSubscriptionAdvancedFilterArgs', 'EventSubscriptionAdvancedFilterArgsDict']]] = None,
                 advanced_filtering_on_arrays_enabled: Optional[pulumi.Input[bool]] = None,
                 azure_function_endpoint: Optional[pulumi.Input[Union['EventSubscriptionAzureFunctionEndpointArgs', 'EventSubscriptionAzureFunctionEndpointArgsDict']]] = None,
                 dead_letter_identity: Optional[pulumi.Input[Union['EventSubscriptionDeadLetterIdentityArgs', 'EventSubscriptionDeadLetterIdentityArgsDict']]] = None,
                 delivery_identity: Optional[pulumi.Input[Union['EventSubscriptionDeliveryIdentityArgs', 'EventSubscriptionDeliveryIdentityArgsDict']]] = None,
                 delivery_properties: Optional[pulumi.Input[Sequence[pulumi.Input[Union['EventSubscriptionDeliveryPropertyArgs', 'EventSubscriptionDeliveryPropertyArgsDict']]]]] = None,
                 event_delivery_schema: Optional[pulumi.Input[str]] = None,
                 eventhub_endpoint_id: Optional[pulumi.Input[str]] = None,
                 expiration_time_utc: Optional[pulumi.Input[str]] = None,
                 hybrid_connection_endpoint_id: Optional[pulumi.Input[str]] = None,
                 included_event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 labels: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 retry_policy: Optional[pulumi.Input[Union['EventSubscriptionRetryPolicyArgs', 'EventSubscriptionRetryPolicyArgsDict']]] = None,
                 scope: Optional[pulumi.Input[str]] = None,
                 service_bus_queue_endpoint_id: Optional[pulumi.Input[str]] = None,
                 service_bus_topic_endpoint_id: Optional[pulumi.Input[str]] = None,
                 storage_blob_dead_letter_destination: Optional[pulumi.Input[Union['EventSubscriptionStorageBlobDeadLetterDestinationArgs', 'EventSubscriptionStorageBlobDeadLetterDestinationArgsDict']]] = None,
                 storage_queue_endpoint: Optional[pulumi.Input[Union['EventSubscriptionStorageQueueEndpointArgs', 'EventSubscriptionStorageQueueEndpointArgsDict']]] = None,
                 subject_filter: Optional[pulumi.Input[Union['EventSubscriptionSubjectFilterArgs', 'EventSubscriptionSubjectFilterArgsDict']]] = None,
                 webhook_endpoint: Optional[pulumi.Input[Union['EventSubscriptionWebhookEndpointArgs', 'EventSubscriptionWebhookEndpointArgsDict']]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        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__ = EventSubscriptionArgs.__new__(EventSubscriptionArgs)

            __props__.__dict__["advanced_filter"] = advanced_filter
            __props__.__dict__["advanced_filtering_on_arrays_enabled"] = advanced_filtering_on_arrays_enabled
            __props__.__dict__["azure_function_endpoint"] = azure_function_endpoint
            __props__.__dict__["dead_letter_identity"] = dead_letter_identity
            __props__.__dict__["delivery_identity"] = delivery_identity
            __props__.__dict__["delivery_properties"] = delivery_properties
            __props__.__dict__["event_delivery_schema"] = event_delivery_schema
            __props__.__dict__["eventhub_endpoint_id"] = eventhub_endpoint_id
            __props__.__dict__["expiration_time_utc"] = expiration_time_utc
            __props__.__dict__["hybrid_connection_endpoint_id"] = hybrid_connection_endpoint_id
            __props__.__dict__["included_event_types"] = included_event_types
            __props__.__dict__["labels"] = labels
            __props__.__dict__["name"] = name
            __props__.__dict__["retry_policy"] = retry_policy
            if scope is None and not opts.urn:
                raise TypeError("Missing required property 'scope'")
            __props__.__dict__["scope"] = scope
            __props__.__dict__["service_bus_queue_endpoint_id"] = service_bus_queue_endpoint_id
            __props__.__dict__["service_bus_topic_endpoint_id"] = service_bus_topic_endpoint_id
            __props__.__dict__["storage_blob_dead_letter_destination"] = storage_blob_dead_letter_destination
            __props__.__dict__["storage_queue_endpoint"] = storage_queue_endpoint
            __props__.__dict__["subject_filter"] = subject_filter
            __props__.__dict__["webhook_endpoint"] = webhook_endpoint
        alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="azure:eventhub/eventSubscription:EventSubscription")])
        opts = pulumi.ResourceOptions.merge(opts, alias_opts)
        super(EventSubscription, __self__).__init__(
            'azure:eventgrid/eventSubscription:EventSubscription',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            advanced_filter: Optional[pulumi.Input[Union['EventSubscriptionAdvancedFilterArgs', 'EventSubscriptionAdvancedFilterArgsDict']]] = None,
            advanced_filtering_on_arrays_enabled: Optional[pulumi.Input[bool]] = None,
            azure_function_endpoint: Optional[pulumi.Input[Union['EventSubscriptionAzureFunctionEndpointArgs', 'EventSubscriptionAzureFunctionEndpointArgsDict']]] = None,
            dead_letter_identity: Optional[pulumi.Input[Union['EventSubscriptionDeadLetterIdentityArgs', 'EventSubscriptionDeadLetterIdentityArgsDict']]] = None,
            delivery_identity: Optional[pulumi.Input[Union['EventSubscriptionDeliveryIdentityArgs', 'EventSubscriptionDeliveryIdentityArgsDict']]] = None,
            delivery_properties: Optional[pulumi.Input[Sequence[pulumi.Input[Union['EventSubscriptionDeliveryPropertyArgs', 'EventSubscriptionDeliveryPropertyArgsDict']]]]] = None,
            event_delivery_schema: Optional[pulumi.Input[str]] = None,
            eventhub_endpoint_id: Optional[pulumi.Input[str]] = None,
            expiration_time_utc: Optional[pulumi.Input[str]] = None,
            hybrid_connection_endpoint_id: Optional[pulumi.Input[str]] = None,
            included_event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            labels: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            name: Optional[pulumi.Input[str]] = None,
            retry_policy: Optional[pulumi.Input[Union['EventSubscriptionRetryPolicyArgs', 'EventSubscriptionRetryPolicyArgsDict']]] = None,
            scope: Optional[pulumi.Input[str]] = None,
            service_bus_queue_endpoint_id: Optional[pulumi.Input[str]] = None,
            service_bus_topic_endpoint_id: Optional[pulumi.Input[str]] = None,
            storage_blob_dead_letter_destination: Optional[pulumi.Input[Union['EventSubscriptionStorageBlobDeadLetterDestinationArgs', 'EventSubscriptionStorageBlobDeadLetterDestinationArgsDict']]] = None,
            storage_queue_endpoint: Optional[pulumi.Input[Union['EventSubscriptionStorageQueueEndpointArgs', 'EventSubscriptionStorageQueueEndpointArgsDict']]] = None,
            subject_filter: Optional[pulumi.Input[Union['EventSubscriptionSubjectFilterArgs', 'EventSubscriptionSubjectFilterArgsDict']]] = None,
            webhook_endpoint: Optional[pulumi.Input[Union['EventSubscriptionWebhookEndpointArgs', 'EventSubscriptionWebhookEndpointArgsDict']]] = None) -> 'EventSubscription':
        """
        Get an existing EventSubscription 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 pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Union['EventSubscriptionAdvancedFilterArgs', 'EventSubscriptionAdvancedFilterArgsDict']] advanced_filter: A `advanced_filter` block as defined below.
        :param pulumi.Input[bool] advanced_filtering_on_arrays_enabled: Specifies whether advanced filters should be evaluated against an array of values instead of expecting a singular value. Defaults to `false`.
        :param pulumi.Input[Union['EventSubscriptionAzureFunctionEndpointArgs', 'EventSubscriptionAzureFunctionEndpointArgsDict']] azure_function_endpoint: An `azure_function_endpoint` block as defined below.
        :param pulumi.Input[Union['EventSubscriptionDeadLetterIdentityArgs', 'EventSubscriptionDeadLetterIdentityArgsDict']] dead_letter_identity: A `dead_letter_identity` block as defined below.
               
               > **Note:** `storage_blob_dead_letter_destination` must be specified when a `dead_letter_identity` is specified
        :param pulumi.Input[Union['EventSubscriptionDeliveryIdentityArgs', 'EventSubscriptionDeliveryIdentityArgsDict']] delivery_identity: A `delivery_identity` block as defined below.
        :param pulumi.Input[Sequence[pulumi.Input[Union['EventSubscriptionDeliveryPropertyArgs', 'EventSubscriptionDeliveryPropertyArgsDict']]]] delivery_properties: One or more `delivery_property` blocks as defined below.
        :param pulumi.Input[str] event_delivery_schema: Specifies the event delivery schema for the event subscription. Possible values include: `EventGridSchema`, `CloudEventSchemaV1_0`, `CustomInputSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
        :param pulumi.Input[str] eventhub_endpoint_id: Specifies the id where the Event Hub is located.
        :param pulumi.Input[str] expiration_time_utc: Specifies the expiration time of the event subscription (Datetime Format `RFC 3339`).
        :param pulumi.Input[str] hybrid_connection_endpoint_id: Specifies the id where the Hybrid Connection is located.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] included_event_types: A list of applicable event types that need to be part of the event subscription.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] labels: A list of labels to assign to the event subscription.
        :param pulumi.Input[str] name: Specifies the name of the EventGrid Event Subscription resource. Changing this forces a new resource to be created.
        :param pulumi.Input[Union['EventSubscriptionRetryPolicyArgs', 'EventSubscriptionRetryPolicyArgsDict']] retry_policy: A `retry_policy` block as defined below.
        :param pulumi.Input[str] scope: Specifies the scope at which the EventGrid Event Subscription should be created. Changing this forces a new resource to be created.
        :param pulumi.Input[str] service_bus_queue_endpoint_id: Specifies the id where the Service Bus Queue is located.
        :param pulumi.Input[str] service_bus_topic_endpoint_id: Specifies the id where the Service Bus Topic is located.
        :param pulumi.Input[Union['EventSubscriptionStorageBlobDeadLetterDestinationArgs', 'EventSubscriptionStorageBlobDeadLetterDestinationArgsDict']] storage_blob_dead_letter_destination: A `storage_blob_dead_letter_destination` block as defined below.
        :param pulumi.Input[Union['EventSubscriptionStorageQueueEndpointArgs', 'EventSubscriptionStorageQueueEndpointArgsDict']] storage_queue_endpoint: A `storage_queue_endpoint` block as defined below.
        :param pulumi.Input[Union['EventSubscriptionSubjectFilterArgs', 'EventSubscriptionSubjectFilterArgsDict']] subject_filter: A `subject_filter` block as defined below.
        :param pulumi.Input[Union['EventSubscriptionWebhookEndpointArgs', 'EventSubscriptionWebhookEndpointArgsDict']] webhook_endpoint: A `webhook_endpoint` block as defined below.
               
               > **NOTE:** One of `eventhub_endpoint_id`, `hybrid_connection_endpoint_id`, `service_bus_queue_endpoint_id`, `service_bus_topic_endpoint_id`, `storage_queue_endpoint`, `webhook_endpoint` or `azure_function_endpoint` must be specified.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _EventSubscriptionState.__new__(_EventSubscriptionState)

        __props__.__dict__["advanced_filter"] = advanced_filter
        __props__.__dict__["advanced_filtering_on_arrays_enabled"] = advanced_filtering_on_arrays_enabled
        __props__.__dict__["azure_function_endpoint"] = azure_function_endpoint
        __props__.__dict__["dead_letter_identity"] = dead_letter_identity
        __props__.__dict__["delivery_identity"] = delivery_identity
        __props__.__dict__["delivery_properties"] = delivery_properties
        __props__.__dict__["event_delivery_schema"] = event_delivery_schema
        __props__.__dict__["eventhub_endpoint_id"] = eventhub_endpoint_id
        __props__.__dict__["expiration_time_utc"] = expiration_time_utc
        __props__.__dict__["hybrid_connection_endpoint_id"] = hybrid_connection_endpoint_id
        __props__.__dict__["included_event_types"] = included_event_types
        __props__.__dict__["labels"] = labels
        __props__.__dict__["name"] = name
        __props__.__dict__["retry_policy"] = retry_policy
        __props__.__dict__["scope"] = scope
        __props__.__dict__["service_bus_queue_endpoint_id"] = service_bus_queue_endpoint_id
        __props__.__dict__["service_bus_topic_endpoint_id"] = service_bus_topic_endpoint_id
        __props__.__dict__["storage_blob_dead_letter_destination"] = storage_blob_dead_letter_destination
        __props__.__dict__["storage_queue_endpoint"] = storage_queue_endpoint
        __props__.__dict__["subject_filter"] = subject_filter
        __props__.__dict__["webhook_endpoint"] = webhook_endpoint
        return EventSubscription(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="advancedFilter")
    def advanced_filter(self) -> pulumi.Output[Optional['outputs.EventSubscriptionAdvancedFilter']]:
        """
        A `advanced_filter` block as defined below.
        """
        return pulumi.get(self, "advanced_filter")

    @property
    @pulumi.getter(name="advancedFilteringOnArraysEnabled")
    def advanced_filtering_on_arrays_enabled(self) -> pulumi.Output[Optional[bool]]:
        """
        Specifies whether advanced filters should be evaluated against an array of values instead of expecting a singular value. Defaults to `false`.
        """
        return pulumi.get(self, "advanced_filtering_on_arrays_enabled")

    @property
    @pulumi.getter(name="azureFunctionEndpoint")
    def azure_function_endpoint(self) -> pulumi.Output[Optional['outputs.EventSubscriptionAzureFunctionEndpoint']]:
        """
        An `azure_function_endpoint` block as defined below.
        """
        return pulumi.get(self, "azure_function_endpoint")

    @property
    @pulumi.getter(name="deadLetterIdentity")
    def dead_letter_identity(self) -> pulumi.Output[Optional['outputs.EventSubscriptionDeadLetterIdentity']]:
        """
        A `dead_letter_identity` block as defined below.

        > **Note:** `storage_blob_dead_letter_destination` must be specified when a `dead_letter_identity` is specified
        """
        return pulumi.get(self, "dead_letter_identity")

    @property
    @pulumi.getter(name="deliveryIdentity")
    def delivery_identity(self) -> pulumi.Output[Optional['outputs.EventSubscriptionDeliveryIdentity']]:
        """
        A `delivery_identity` block as defined below.
        """
        return pulumi.get(self, "delivery_identity")

    @property
    @pulumi.getter(name="deliveryProperties")
    def delivery_properties(self) -> pulumi.Output[Optional[Sequence['outputs.EventSubscriptionDeliveryProperty']]]:
        """
        One or more `delivery_property` blocks as defined below.
        """
        return pulumi.get(self, "delivery_properties")

    @property
    @pulumi.getter(name="eventDeliverySchema")
    def event_delivery_schema(self) -> pulumi.Output[Optional[str]]:
        """
        Specifies the event delivery schema for the event subscription. Possible values include: `EventGridSchema`, `CloudEventSchemaV1_0`, `CustomInputSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "event_delivery_schema")

    @property
    @pulumi.getter(name="eventhubEndpointId")
    def eventhub_endpoint_id(self) -> pulumi.Output[str]:
        """
        Specifies the id where the Event Hub is located.
        """
        return pulumi.get(self, "eventhub_endpoint_id")

    @property
    @pulumi.getter(name="expirationTimeUtc")
    def expiration_time_utc(self) -> pulumi.Output[Optional[str]]:
        """
        Specifies the expiration time of the event subscription (Datetime Format `RFC 3339`).
        """
        return pulumi.get(self, "expiration_time_utc")

    @property
    @pulumi.getter(name="hybridConnectionEndpointId")
    def hybrid_connection_endpoint_id(self) -> pulumi.Output[str]:
        """
        Specifies the id where the Hybrid Connection is located.
        """
        return pulumi.get(self, "hybrid_connection_endpoint_id")

    @property
    @pulumi.getter(name="includedEventTypes")
    def included_event_types(self) -> pulumi.Output[Sequence[str]]:
        """
        A list of applicable event types that need to be part of the event subscription.
        """
        return pulumi.get(self, "included_event_types")

    @property
    @pulumi.getter
    def labels(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        A list of labels to assign to the event subscription.
        """
        return pulumi.get(self, "labels")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Specifies the name of the EventGrid Event Subscription resource. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="retryPolicy")
    def retry_policy(self) -> pulumi.Output['outputs.EventSubscriptionRetryPolicy']:
        """
        A `retry_policy` block as defined below.
        """
        return pulumi.get(self, "retry_policy")

    @property
    @pulumi.getter
    def scope(self) -> pulumi.Output[str]:
        """
        Specifies the scope at which the EventGrid Event Subscription should be created. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "scope")

    @property
    @pulumi.getter(name="serviceBusQueueEndpointId")
    def service_bus_queue_endpoint_id(self) -> pulumi.Output[Optional[str]]:
        """
        Specifies the id where the Service Bus Queue is located.
        """
        return pulumi.get(self, "service_bus_queue_endpoint_id")

    @property
    @pulumi.getter(name="serviceBusTopicEndpointId")
    def service_bus_topic_endpoint_id(self) -> pulumi.Output[Optional[str]]:
        """
        Specifies the id where the Service Bus Topic is located.
        """
        return pulumi.get(self, "service_bus_topic_endpoint_id")

    @property
    @pulumi.getter(name="storageBlobDeadLetterDestination")
    def storage_blob_dead_letter_destination(self) -> pulumi.Output[Optional['outputs.EventSubscriptionStorageBlobDeadLetterDestination']]:
        """
        A `storage_blob_dead_letter_destination` block as defined below.
        """
        return pulumi.get(self, "storage_blob_dead_letter_destination")

    @property
    @pulumi.getter(name="storageQueueEndpoint")
    def storage_queue_endpoint(self) -> pulumi.Output[Optional['outputs.EventSubscriptionStorageQueueEndpoint']]:
        """
        A `storage_queue_endpoint` block as defined below.
        """
        return pulumi.get(self, "storage_queue_endpoint")

    @property
    @pulumi.getter(name="subjectFilter")
    def subject_filter(self) -> pulumi.Output[Optional['outputs.EventSubscriptionSubjectFilter']]:
        """
        A `subject_filter` block as defined below.
        """
        return pulumi.get(self, "subject_filter")

    @property
    @pulumi.getter(name="webhookEndpoint")
    def webhook_endpoint(self) -> pulumi.Output[Optional['outputs.EventSubscriptionWebhookEndpoint']]:
        """
        A `webhook_endpoint` block as defined below.

        > **NOTE:** One of `eventhub_endpoint_id`, `hybrid_connection_endpoint_id`, `service_bus_queue_endpoint_id`, `service_bus_topic_endpoint_id`, `storage_queue_endpoint`, `webhook_endpoint` or `azure_function_endpoint` must be specified.
        """
        return pulumi.get(self, "webhook_endpoint")

