# 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__ = [
    'GetSharesResult',
    'AwaitableGetSharesResult',
    'get_shares',
    'get_shares_output',
]

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

    @_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.GetSharesProviderConfigResult']:
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter
    def shares(self) -> Sequence[_builtins.str]:
        """
        list of Share names.
        """
        return pulumi.get(self, "shares")


class AwaitableGetSharesResult(GetSharesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSharesResult(
            id=self.id,
            provider_config=self.provider_config,
            shares=self.shares)


def get_shares(provider_config: Optional[Union['GetSharesProviderConfigArgs', 'GetSharesProviderConfigArgsDict']] = None,
               shares: Optional[Sequence[_builtins.str]] = None,
               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSharesResult:
    """
    Retrieves a list of Share name, that were created by Pulumi or manually.

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

    ## Example Usage

    Getting all existing shares in the metastore

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_shares()
    pulumi.export("shareName", this.shares)
    ```

    ## Related Resources

    The following resources are used in the same context:

    * Share to create Delta Sharing shares.
    * Recipient to create Delta Sharing recipients.
    * Grants to manage Delta Sharing permissions.


    :param Union['GetSharesProviderConfigArgs', 'GetSharesProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
    :param Sequence[_builtins.str] shares: list of Share names.
    """
    __args__ = dict()
    __args__['providerConfig'] = provider_config
    __args__['shares'] = shares
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getShares:getShares', __args__, opts=opts, typ=GetSharesResult).value

    return AwaitableGetSharesResult(
        id=pulumi.get(__ret__, 'id'),
        provider_config=pulumi.get(__ret__, 'provider_config'),
        shares=pulumi.get(__ret__, 'shares'))
def get_shares_output(provider_config: Optional[pulumi.Input[Optional[Union['GetSharesProviderConfigArgs', 'GetSharesProviderConfigArgsDict']]]] = None,
                      shares: Optional[pulumi.Input[Optional[Sequence[_builtins.str]]]] = None,
                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetSharesResult]:
    """
    Retrieves a list of Share name, that were created by Pulumi or manually.

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

    ## Example Usage

    Getting all existing shares in the metastore

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_shares()
    pulumi.export("shareName", this.shares)
    ```

    ## Related Resources

    The following resources are used in the same context:

    * Share to create Delta Sharing shares.
    * Recipient to create Delta Sharing recipients.
    * Grants to manage Delta Sharing permissions.


    :param Union['GetSharesProviderConfigArgs', 'GetSharesProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
    :param Sequence[_builtins.str] shares: list of Share names.
    """
    __args__ = dict()
    __args__['providerConfig'] = provider_config
    __args__['shares'] = shares
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getShares:getShares', __args__, opts=opts, typ=GetSharesResult)
    return __ret__.apply(lambda __response__: GetSharesResult(
        id=pulumi.get(__response__, 'id'),
        provider_config=pulumi.get(__response__, 'provider_config'),
        shares=pulumi.get(__response__, 'shares')))
