# 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__ = [
    'GetDashboardsResult',
    'AwaitableGetDashboardsResult',
    'get_dashboards',
    'get_dashboards_output',
]

@pulumi.output_type
class GetDashboardsResult:
    """
    A collection of values returned by getDashboards.
    """
    def __init__(__self__, dashboard_name_contains=None, dashboards=None, id=None, provider_config=None):
        if dashboard_name_contains and not isinstance(dashboard_name_contains, str):
            raise TypeError("Expected argument 'dashboard_name_contains' to be a str")
        pulumi.set(__self__, "dashboard_name_contains", dashboard_name_contains)
        if dashboards and not isinstance(dashboards, list):
            raise TypeError("Expected argument 'dashboards' to be a list")
        pulumi.set(__self__, "dashboards", dashboards)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        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)

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

    @_builtins.property
    @pulumi.getter
    def dashboards(self) -> Sequence['outputs.GetDashboardsDashboardResult']:
        """
        A list of dashboards matching the specified criteria. Each element contains the following attributes:
        """
        return pulumi.get(self, "dashboards")

    @_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="providerConfig")
    def provider_config(self) -> Optional['outputs.GetDashboardsProviderConfigResult']:
        return pulumi.get(self, "provider_config")


class AwaitableGetDashboardsResult(GetDashboardsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDashboardsResult(
            dashboard_name_contains=self.dashboard_name_contains,
            dashboards=self.dashboards,
            id=self.id,
            provider_config=self.provider_config)


def get_dashboards(dashboard_name_contains: Optional[_builtins.str] = None,
                   provider_config: Optional[Union['GetDashboardsProviderConfigArgs', 'GetDashboardsProviderConfigArgsDict']] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDashboardsResult:
    """
    This data source allows you to retrieve information about Databricks [Dashboards](https://docs.databricks.com/en/dashboards/index.html).

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

    ## Example Usage

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_dashboards()
    dashboards_permissions = []
    for range in [{"key": k, "value": v} for [k, v] in enumerate([__item.dashboard_id for __item in all.dashboards])]:
        dashboards_permissions.append(databricks.Permissions(f"dashboards_permissions-{range['key']}",
            depends=[all],
            dashboard_id=range["value"],
            access_controls=[{
                "group_name": "Example Group",
                "permission_level": "CAN_MANAGE",
            }]))
    ```


    :param _builtins.str dashboard_name_contains: A **case-insensitive** substring to filter Dashboards by their name.
    """
    __args__ = dict()
    __args__['dashboardNameContains'] = dashboard_name_contains
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getDashboards:getDashboards', __args__, opts=opts, typ=GetDashboardsResult).value

    return AwaitableGetDashboardsResult(
        dashboard_name_contains=pulumi.get(__ret__, 'dashboard_name_contains'),
        dashboards=pulumi.get(__ret__, 'dashboards'),
        id=pulumi.get(__ret__, 'id'),
        provider_config=pulumi.get(__ret__, 'provider_config'))
def get_dashboards_output(dashboard_name_contains: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                          provider_config: Optional[pulumi.Input[Optional[Union['GetDashboardsProviderConfigArgs', 'GetDashboardsProviderConfigArgsDict']]]] = None,
                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDashboardsResult]:
    """
    This data source allows you to retrieve information about Databricks [Dashboards](https://docs.databricks.com/en/dashboards/index.html).

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

    ## Example Usage

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_dashboards()
    dashboards_permissions = []
    for range in [{"key": k, "value": v} for [k, v] in enumerate([__item.dashboard_id for __item in all.dashboards])]:
        dashboards_permissions.append(databricks.Permissions(f"dashboards_permissions-{range['key']}",
            depends=[all],
            dashboard_id=range["value"],
            access_controls=[{
                "group_name": "Example Group",
                "permission_level": "CAN_MANAGE",
            }]))
    ```


    :param _builtins.str dashboard_name_contains: A **case-insensitive** substring to filter Dashboards by their name.
    """
    __args__ = dict()
    __args__['dashboardNameContains'] = dashboard_name_contains
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getDashboards:getDashboards', __args__, opts=opts, typ=GetDashboardsResult)
    return __ret__.apply(lambda __response__: GetDashboardsResult(
        dashboard_name_contains=pulumi.get(__response__, 'dashboard_name_contains'),
        dashboards=pulumi.get(__response__, 'dashboards'),
        id=pulumi.get(__response__, 'id'),
        provider_config=pulumi.get(__response__, 'provider_config')))
