# 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__ = [
    'GetShareResult',
    'AwaitableGetShareResult',
    'get_share',
    'get_share_output',
]

@pulumi.output_type
class GetShareResult:
    """
    A collection of values returned by getShare.
    """
    def __init__(__self__, comment=None, created_at=None, created_by=None, effective_owner=None, id=None, name=None, objects=None, owner=None, provider_config=None, storage_location=None, storage_root=None, updated_at=None, updated_by=None):
        if comment and not isinstance(comment, str):
            raise TypeError("Expected argument 'comment' to be a str")
        pulumi.set(__self__, "comment", comment)
        if created_at and not isinstance(created_at, int):
            raise TypeError("Expected argument 'created_at' to be a int")
        pulumi.set(__self__, "created_at", created_at)
        if created_by and not isinstance(created_by, str):
            raise TypeError("Expected argument 'created_by' to be a str")
        pulumi.set(__self__, "created_by", created_by)
        if effective_owner and not isinstance(effective_owner, str):
            raise TypeError("Expected argument 'effective_owner' to be a str")
        pulumi.set(__self__, "effective_owner", effective_owner)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if objects and not isinstance(objects, list):
            raise TypeError("Expected argument 'objects' to be a list")
        pulumi.set(__self__, "objects", objects)
        if owner and not isinstance(owner, str):
            raise TypeError("Expected argument 'owner' to be a str")
        pulumi.set(__self__, "owner", owner)
        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 storage_location and not isinstance(storage_location, str):
            raise TypeError("Expected argument 'storage_location' to be a str")
        pulumi.set(__self__, "storage_location", storage_location)
        if storage_root and not isinstance(storage_root, str):
            raise TypeError("Expected argument 'storage_root' to be a str")
        pulumi.set(__self__, "storage_root", storage_root)
        if updated_at and not isinstance(updated_at, int):
            raise TypeError("Expected argument 'updated_at' to be a int")
        pulumi.set(__self__, "updated_at", updated_at)
        if updated_by and not isinstance(updated_by, str):
            raise TypeError("Expected argument 'updated_by' to be a str")
        pulumi.set(__self__, "updated_by", updated_by)

    @_builtins.property
    @pulumi.getter
    def comment(self) -> Optional[_builtins.str]:
        """
        Description about the object.
        """
        return pulumi.get(self, "comment")

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> _builtins.int:
        """
        Time when the share was created.
        """
        return pulumi.get(self, "created_at")

    @_builtins.property
    @pulumi.getter(name="createdBy")
    def created_by(self) -> _builtins.str:
        """
        The principal that created the share.
        """
        return pulumi.get(self, "created_by")

    @_builtins.property
    @pulumi.getter(name="effectiveOwner")
    def effective_owner(self) -> _builtins.str:
        return pulumi.get(self, "effective_owner")

    @_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 name(self) -> Optional[_builtins.str]:
        """
        Full name of the object being shared.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def objects(self) -> Optional[Sequence['outputs.GetShareObjectResult']]:
        """
        arrays containing details of each object in the share.
        """
        return pulumi.get(self, "objects")

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

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

    @_builtins.property
    @pulumi.getter(name="storageLocation")
    def storage_location(self) -> _builtins.str:
        return pulumi.get(self, "storage_location")

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

    @_builtins.property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> _builtins.int:
        return pulumi.get(self, "updated_at")

    @_builtins.property
    @pulumi.getter(name="updatedBy")
    def updated_by(self) -> _builtins.str:
        return pulumi.get(self, "updated_by")


class AwaitableGetShareResult(GetShareResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetShareResult(
            comment=self.comment,
            created_at=self.created_at,
            created_by=self.created_by,
            effective_owner=self.effective_owner,
            id=self.id,
            name=self.name,
            objects=self.objects,
            owner=self.owner,
            provider_config=self.provider_config,
            storage_location=self.storage_location,
            storage_root=self.storage_root,
            updated_at=self.updated_at,
            updated_by=self.updated_by)


def get_share(comment: Optional[_builtins.str] = None,
              name: Optional[_builtins.str] = None,
              objects: Optional[Sequence[Union['GetShareObjectArgs', 'GetShareObjectArgsDict']]] = None,
              owner: Optional[_builtins.str] = None,
              provider_config: Optional[Union['GetShareProviderConfigArgs', 'GetShareProviderConfigArgsDict']] = None,
              storage_root: Optional[_builtins.str] = None,
              opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetShareResult:
    """
    Retrieves details about a Share that were created by Pulumi or manually.

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

    ## Example Usage

    Getting details of an existing share in the metastore

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_share(name="this")
    pulumi.export("createdBy", this.created_by)
    ```

    ## 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 _builtins.str comment: Description about the object.
    :param _builtins.str name: The name of the share
    :param Sequence[Union['GetShareObjectArgs', 'GetShareObjectArgsDict']] objects: arrays containing details of each object in the share.
    :param Union['GetShareProviderConfigArgs', 'GetShareProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
    """
    __args__ = dict()
    __args__['comment'] = comment
    __args__['name'] = name
    __args__['objects'] = objects
    __args__['owner'] = owner
    __args__['providerConfig'] = provider_config
    __args__['storageRoot'] = storage_root
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getShare:getShare', __args__, opts=opts, typ=GetShareResult).value

    return AwaitableGetShareResult(
        comment=pulumi.get(__ret__, 'comment'),
        created_at=pulumi.get(__ret__, 'created_at'),
        created_by=pulumi.get(__ret__, 'created_by'),
        effective_owner=pulumi.get(__ret__, 'effective_owner'),
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        objects=pulumi.get(__ret__, 'objects'),
        owner=pulumi.get(__ret__, 'owner'),
        provider_config=pulumi.get(__ret__, 'provider_config'),
        storage_location=pulumi.get(__ret__, 'storage_location'),
        storage_root=pulumi.get(__ret__, 'storage_root'),
        updated_at=pulumi.get(__ret__, 'updated_at'),
        updated_by=pulumi.get(__ret__, 'updated_by'))
def get_share_output(comment: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                     name: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                     objects: Optional[pulumi.Input[Optional[Sequence[Union['GetShareObjectArgs', 'GetShareObjectArgsDict']]]]] = None,
                     owner: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                     provider_config: Optional[pulumi.Input[Optional[Union['GetShareProviderConfigArgs', 'GetShareProviderConfigArgsDict']]]] = None,
                     storage_root: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                     opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetShareResult]:
    """
    Retrieves details about a Share that were created by Pulumi or manually.

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

    ## Example Usage

    Getting details of an existing share in the metastore

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_share(name="this")
    pulumi.export("createdBy", this.created_by)
    ```

    ## 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 _builtins.str comment: Description about the object.
    :param _builtins.str name: The name of the share
    :param Sequence[Union['GetShareObjectArgs', 'GetShareObjectArgsDict']] objects: arrays containing details of each object in the share.
    :param Union['GetShareProviderConfigArgs', 'GetShareProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
    """
    __args__ = dict()
    __args__['comment'] = comment
    __args__['name'] = name
    __args__['objects'] = objects
    __args__['owner'] = owner
    __args__['providerConfig'] = provider_config
    __args__['storageRoot'] = storage_root
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getShare:getShare', __args__, opts=opts, typ=GetShareResult)
    return __ret__.apply(lambda __response__: GetShareResult(
        comment=pulumi.get(__response__, 'comment'),
        created_at=pulumi.get(__response__, 'created_at'),
        created_by=pulumi.get(__response__, 'created_by'),
        effective_owner=pulumi.get(__response__, 'effective_owner'),
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        objects=pulumi.get(__response__, 'objects'),
        owner=pulumi.get(__response__, 'owner'),
        provider_config=pulumi.get(__response__, 'provider_config'),
        storage_location=pulumi.get(__response__, 'storage_location'),
        storage_root=pulumi.get(__response__, 'storage_root'),
        updated_at=pulumi.get(__response__, 'updated_at'),
        updated_by=pulumi.get(__response__, 'updated_by')))
