# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
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__ = [
    'GetNotificationDestinationsResult',
    'AwaitableGetNotificationDestinationsResult',
    'get_notification_destinations',
    'get_notification_destinations_output',
]

@pulumi.output_type
class GetNotificationDestinationsResult:
    """
    A collection of values returned by getNotificationDestinations.
    """
    def __init__(__self__, display_name_contains=None, id=None, notification_destinations=None, provider_config=None, type=None):
        if display_name_contains and not isinstance(display_name_contains, str):
            raise TypeError("Expected argument 'display_name_contains' to be a str")
        pulumi.set(__self__, "display_name_contains", display_name_contains)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if notification_destinations and not isinstance(notification_destinations, list):
            raise TypeError("Expected argument 'notification_destinations' to be a list")
        pulumi.set(__self__, "notification_destinations", notification_destinations)
        if provider_config and not isinstance(provider_config, dict):
            raise TypeError("Expected argument 'provider_config' to be a dict")
        pulumi.set(__self__, "provider_config", provider_config)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)

    @_builtins.property
    @pulumi.getter(name="displayNameContains")
    def display_name_contains(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "display_name_contains")

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

    @_builtins.property
    @pulumi.getter(name="notificationDestinations")
    def notification_destinations(self) -> Sequence['outputs.GetNotificationDestinationsNotificationDestinationResult']:
        """
        A list of Notification Destinations matching the specified criteria. Each element contains the following attributes:
        """
        return pulumi.get(self, "notification_destinations")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional['outputs.GetNotificationDestinationsProviderConfigResult']:
        return pulumi.get(self, "provider_config")

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


class AwaitableGetNotificationDestinationsResult(GetNotificationDestinationsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetNotificationDestinationsResult(
            display_name_contains=self.display_name_contains,
            id=self.id,
            notification_destinations=self.notification_destinations,
            provider_config=self.provider_config,
            type=self.type)


def get_notification_destinations(display_name_contains: Optional[_builtins.str] = None,
                                  provider_config: Optional[Union['GetNotificationDestinationsProviderConfigArgs', 'GetNotificationDestinationsProviderConfigArgsDict']] = None,
                                  type: Optional[_builtins.str] = None,
                                  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetNotificationDestinationsResult:
    """
    This data source allows you to retrieve information about [Notification Destinations](https://docs.databricks.com/api/workspace/notificationdestinations). Notification Destinations are used to send notifications for query alerts and jobs to external systems such as email, Slack, Microsoft Teams, PagerDuty, or generic webhooks.

    > This data source can only be used with a workspace-level provider!

    ## Example Usage

    ```python
    import pulumi
    import pulumi_databricks as databricks

    email = databricks.NotificationDestination("email",
        display_name="Email Destination",
        config={
            "email": {
                "addresses": ["abc@gmail.com"],
            },
        })
    slack = databricks.NotificationDestination("slack",
        display_name="Slack Destination",
        config={
            "slack": {
                "url": "https://hooks.slack.com/services/...",
            },
        })
    # Lists all notification desitnations
    this = databricks.get_notification_destinations()
    # List destinations of specific type and name
    filtered_notification = databricks.get_notification_destinations(display_name_contains="Destination",
        type="EMAIL")
    ```


    :param _builtins.str display_name_contains: A **case-insensitive** substring to filter Notification Destinations by their display name.
    :param _builtins.str type: The type of the Notification Destination to filter by. Valid values are: 
           * `EMAIL` - Filters Notification Destinations of type Email.
           * `MICROSOFT_TEAMS` - Filters Notification Destinations of type Microsoft Teams.
           * `PAGERDUTY` - Filters Notification Destinations of type PagerDuty.
           * `SLACK` - Filters Notification Destinations of type Slack.
           * `WEBHOOK` - Filters Notification Destinations of type Webhook.
    """
    __args__ = dict()
    __args__['displayNameContains'] = display_name_contains
    __args__['providerConfig'] = provider_config
    __args__['type'] = type
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getNotificationDestinations:getNotificationDestinations', __args__, opts=opts, typ=GetNotificationDestinationsResult).value

    return AwaitableGetNotificationDestinationsResult(
        display_name_contains=pulumi.get(__ret__, 'display_name_contains'),
        id=pulumi.get(__ret__, 'id'),
        notification_destinations=pulumi.get(__ret__, 'notification_destinations'),
        provider_config=pulumi.get(__ret__, 'provider_config'),
        type=pulumi.get(__ret__, 'type'))
def get_notification_destinations_output(display_name_contains: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                                         provider_config: Optional[pulumi.Input[Optional[Union['GetNotificationDestinationsProviderConfigArgs', 'GetNotificationDestinationsProviderConfigArgsDict']]]] = None,
                                         type: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                                         opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetNotificationDestinationsResult]:
    """
    This data source allows you to retrieve information about [Notification Destinations](https://docs.databricks.com/api/workspace/notificationdestinations). Notification Destinations are used to send notifications for query alerts and jobs to external systems such as email, Slack, Microsoft Teams, PagerDuty, or generic webhooks.

    > This data source can only be used with a workspace-level provider!

    ## Example Usage

    ```python
    import pulumi
    import pulumi_databricks as databricks

    email = databricks.NotificationDestination("email",
        display_name="Email Destination",
        config={
            "email": {
                "addresses": ["abc@gmail.com"],
            },
        })
    slack = databricks.NotificationDestination("slack",
        display_name="Slack Destination",
        config={
            "slack": {
                "url": "https://hooks.slack.com/services/...",
            },
        })
    # Lists all notification desitnations
    this = databricks.get_notification_destinations()
    # List destinations of specific type and name
    filtered_notification = databricks.get_notification_destinations(display_name_contains="Destination",
        type="EMAIL")
    ```


    :param _builtins.str display_name_contains: A **case-insensitive** substring to filter Notification Destinations by their display name.
    :param _builtins.str type: The type of the Notification Destination to filter by. Valid values are: 
           * `EMAIL` - Filters Notification Destinations of type Email.
           * `MICROSOFT_TEAMS` - Filters Notification Destinations of type Microsoft Teams.
           * `PAGERDUTY` - Filters Notification Destinations of type PagerDuty.
           * `SLACK` - Filters Notification Destinations of type Slack.
           * `WEBHOOK` - Filters Notification Destinations of type Webhook.
    """
    __args__ = dict()
    __args__['displayNameContains'] = display_name_contains
    __args__['providerConfig'] = provider_config
    __args__['type'] = type
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getNotificationDestinations:getNotificationDestinations', __args__, opts=opts, typ=GetNotificationDestinationsResult)
    return __ret__.apply(lambda __response__: GetNotificationDestinationsResult(
        display_name_contains=pulumi.get(__response__, 'display_name_contains'),
        id=pulumi.get(__response__, 'id'),
        notification_destinations=pulumi.get(__response__, 'notification_destinations'),
        provider_config=pulumi.get(__response__, 'provider_config'),
        type=pulumi.get(__response__, 'type')))
