# 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__ = [
    'GetSqlWarehousesResult',
    'AwaitableGetSqlWarehousesResult',
    'get_sql_warehouses',
    'get_sql_warehouses_output',
]

@pulumi.output_type
class GetSqlWarehousesResult:
    """
    A collection of values returned by getSqlWarehouses.
    """
    def __init__(__self__, id=None, ids=None, provider_config=None, warehouse_name_contains=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ids and not isinstance(ids, list):
            raise TypeError("Expected argument 'ids' to be a list")
        pulumi.set(__self__, "ids", ids)
        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 warehouse_name_contains and not isinstance(warehouse_name_contains, str):
            raise TypeError("Expected argument 'warehouse_name_contains' to be a str")
        pulumi.set(__self__, "warehouse_name_contains", warehouse_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
    def ids(self) -> Sequence[_builtins.str]:
        """
        list of SqlEndpoint ids
        """
        return pulumi.get(self, "ids")

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

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


class AwaitableGetSqlWarehousesResult(GetSqlWarehousesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSqlWarehousesResult(
            id=self.id,
            ids=self.ids,
            provider_config=self.provider_config,
            warehouse_name_contains=self.warehouse_name_contains)


def get_sql_warehouses(ids: Optional[Sequence[_builtins.str]] = None,
                       provider_config: Optional[Union['GetSqlWarehousesProviderConfigArgs', 'GetSqlWarehousesProviderConfigArgsDict']] = None,
                       warehouse_name_contains: Optional[_builtins.str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSqlWarehousesResult:
    """
    Retrieves a list of SqlEndpoint ids, that were created by Pulumi or manually.

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

    ## Example Usage

    Retrieve IDs for all SQL warehouses:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_sql_warehouses()
    ```

    Retrieve IDs for all clusters having "Shared" in the warehouse name:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all_shared = databricks.get_sql_warehouses(warehouse_name_contains="shared")
    ```

    ## Related Resources

    The following resources are often used in the same context:

    * End to end workspace management guide.
    * InstanceProfile to manage AWS EC2 instance profiles that users can launch Cluster and access data, like databricks_mount.
    * SqlDashboard to manage Databricks SQL [Dashboards](https://docs.databricks.com/sql/user/dashboards/index.html).
    * SqlGlobalConfig to configure the security policy, databricks_instance_profile, and [data access properties](https://docs.databricks.com/sql/admin/data-access-configuration.html) for all get_sql_warehouse of workspace.
    * Grants to manage data access in Unity Catalog.


    :param Sequence[_builtins.str] ids: list of SqlEndpoint ids
    :param Union['GetSqlWarehousesProviderConfigArgs', 'GetSqlWarehousesProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
    :param _builtins.str warehouse_name_contains: Only return SqlEndpoint ids that match the given name string.
    """
    __args__ = dict()
    __args__['ids'] = ids
    __args__['providerConfig'] = provider_config
    __args__['warehouseNameContains'] = warehouse_name_contains
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getSqlWarehouses:getSqlWarehouses', __args__, opts=opts, typ=GetSqlWarehousesResult).value

    return AwaitableGetSqlWarehousesResult(
        id=pulumi.get(__ret__, 'id'),
        ids=pulumi.get(__ret__, 'ids'),
        provider_config=pulumi.get(__ret__, 'provider_config'),
        warehouse_name_contains=pulumi.get(__ret__, 'warehouse_name_contains'))
def get_sql_warehouses_output(ids: Optional[pulumi.Input[Optional[Sequence[_builtins.str]]]] = None,
                              provider_config: Optional[pulumi.Input[Optional[Union['GetSqlWarehousesProviderConfigArgs', 'GetSqlWarehousesProviderConfigArgsDict']]]] = None,
                              warehouse_name_contains: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                              opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetSqlWarehousesResult]:
    """
    Retrieves a list of SqlEndpoint ids, that were created by Pulumi or manually.

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

    ## Example Usage

    Retrieve IDs for all SQL warehouses:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_sql_warehouses()
    ```

    Retrieve IDs for all clusters having "Shared" in the warehouse name:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all_shared = databricks.get_sql_warehouses(warehouse_name_contains="shared")
    ```

    ## Related Resources

    The following resources are often used in the same context:

    * End to end workspace management guide.
    * InstanceProfile to manage AWS EC2 instance profiles that users can launch Cluster and access data, like databricks_mount.
    * SqlDashboard to manage Databricks SQL [Dashboards](https://docs.databricks.com/sql/user/dashboards/index.html).
    * SqlGlobalConfig to configure the security policy, databricks_instance_profile, and [data access properties](https://docs.databricks.com/sql/admin/data-access-configuration.html) for all get_sql_warehouse of workspace.
    * Grants to manage data access in Unity Catalog.


    :param Sequence[_builtins.str] ids: list of SqlEndpoint ids
    :param Union['GetSqlWarehousesProviderConfigArgs', 'GetSqlWarehousesProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
    :param _builtins.str warehouse_name_contains: Only return SqlEndpoint ids that match the given name string.
    """
    __args__ = dict()
    __args__['ids'] = ids
    __args__['providerConfig'] = provider_config
    __args__['warehouseNameContains'] = warehouse_name_contains
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getSqlWarehouses:getSqlWarehouses', __args__, opts=opts, typ=GetSqlWarehousesResult)
    return __ret__.apply(lambda __response__: GetSqlWarehousesResult(
        id=pulumi.get(__response__, 'id'),
        ids=pulumi.get(__response__, 'ids'),
        provider_config=pulumi.get(__response__, 'provider_config'),
        warehouse_name_contains=pulumi.get(__response__, 'warehouse_name_contains')))
