# 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

__all__ = [
    'GetEntityTagAssignmentsResult',
    'AwaitableGetEntityTagAssignmentsResult',
    'get_entity_tag_assignments',
    'get_entity_tag_assignments_output',
]

@pulumi.output_type
class GetEntityTagAssignmentsResult:
    """
    A collection of values returned by getEntityTagAssignments.
    """
    def __init__(__self__, entity_name=None, entity_type=None, id=None, max_results=None, tag_assignments=None):
        if entity_name and not isinstance(entity_name, str):
            raise TypeError("Expected argument 'entity_name' to be a str")
        pulumi.set(__self__, "entity_name", entity_name)
        if entity_type and not isinstance(entity_type, str):
            raise TypeError("Expected argument 'entity_type' to be a str")
        pulumi.set(__self__, "entity_type", entity_type)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if max_results and not isinstance(max_results, int):
            raise TypeError("Expected argument 'max_results' to be a int")
        pulumi.set(__self__, "max_results", max_results)
        if tag_assignments and not isinstance(tag_assignments, list):
            raise TypeError("Expected argument 'tag_assignments' to be a list")
        pulumi.set(__self__, "tag_assignments", tag_assignments)

    @_builtins.property
    @pulumi.getter(name="entityName")
    def entity_name(self) -> _builtins.str:
        """
        (string) - The fully qualified name of the entity to which the tag is assigned
        """
        return pulumi.get(self, "entity_name")

    @_builtins.property
    @pulumi.getter(name="entityType")
    def entity_type(self) -> _builtins.str:
        """
        (string) - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
        """
        return pulumi.get(self, "entity_type")

    @_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="maxResults")
    def max_results(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "max_results")

    @_builtins.property
    @pulumi.getter(name="tagAssignments")
    def tag_assignments(self) -> Sequence['outputs.GetEntityTagAssignmentsTagAssignmentResult']:
        return pulumi.get(self, "tag_assignments")


class AwaitableGetEntityTagAssignmentsResult(GetEntityTagAssignmentsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetEntityTagAssignmentsResult(
            entity_name=self.entity_name,
            entity_type=self.entity_type,
            id=self.id,
            max_results=self.max_results,
            tag_assignments=self.tag_assignments)


def get_entity_tag_assignments(entity_name: Optional[_builtins.str] = None,
                               entity_type: Optional[_builtins.str] = None,
                               max_results: Optional[_builtins.int] = None,
                               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetEntityTagAssignmentsResult:
    """
    [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source allows you to retrieve tag assignments that have been applied to a particular entity in Unity Catalog.

    ## Example Usage

    ### Get all tag assignments for a catalog

    ```python
    import pulumi
    import pulumi_databricks as databricks

    catalog_tags = databricks.get_entity_tag_assignments(entity_type="catalogs",
        entity_name="production_catalog")
    schema_tags = databricks.get_entity_tag_assignments(entity_type="schemas",
        entity_name="production_catalog.sales_data")
    table_tags = databricks.get_entity_tag_assignments(entity_type="tables",
        entity_name="production_catalog.sales_data.customer_orders")
    column_tags = databricks.get_entity_tag_assignments(entity_type="columns",
        entity_name="production_catalog.customer_data.users.email_address")
    volume_tags = databricks.get_entity_tag_assignments(entity_type="volumes",
        entity_name="production_catalog.raw_data.landing_zone")
    ```


    :param _builtins.str entity_name: The fully qualified name of the entity to which the tag is assigned
    :param _builtins.str entity_type: The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
    :param _builtins.int max_results: Optional. Maximum number of tag assignments to return in a single page
    """
    __args__ = dict()
    __args__['entityName'] = entity_name
    __args__['entityType'] = entity_type
    __args__['maxResults'] = max_results
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getEntityTagAssignments:getEntityTagAssignments', __args__, opts=opts, typ=GetEntityTagAssignmentsResult).value

    return AwaitableGetEntityTagAssignmentsResult(
        entity_name=pulumi.get(__ret__, 'entity_name'),
        entity_type=pulumi.get(__ret__, 'entity_type'),
        id=pulumi.get(__ret__, 'id'),
        max_results=pulumi.get(__ret__, 'max_results'),
        tag_assignments=pulumi.get(__ret__, 'tag_assignments'))
def get_entity_tag_assignments_output(entity_name: Optional[pulumi.Input[_builtins.str]] = None,
                                      entity_type: Optional[pulumi.Input[_builtins.str]] = None,
                                      max_results: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetEntityTagAssignmentsResult]:
    """
    [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source allows you to retrieve tag assignments that have been applied to a particular entity in Unity Catalog.

    ## Example Usage

    ### Get all tag assignments for a catalog

    ```python
    import pulumi
    import pulumi_databricks as databricks

    catalog_tags = databricks.get_entity_tag_assignments(entity_type="catalogs",
        entity_name="production_catalog")
    schema_tags = databricks.get_entity_tag_assignments(entity_type="schemas",
        entity_name="production_catalog.sales_data")
    table_tags = databricks.get_entity_tag_assignments(entity_type="tables",
        entity_name="production_catalog.sales_data.customer_orders")
    column_tags = databricks.get_entity_tag_assignments(entity_type="columns",
        entity_name="production_catalog.customer_data.users.email_address")
    volume_tags = databricks.get_entity_tag_assignments(entity_type="volumes",
        entity_name="production_catalog.raw_data.landing_zone")
    ```


    :param _builtins.str entity_name: The fully qualified name of the entity to which the tag is assigned
    :param _builtins.str entity_type: The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
    :param _builtins.int max_results: Optional. Maximum number of tag assignments to return in a single page
    """
    __args__ = dict()
    __args__['entityName'] = entity_name
    __args__['entityType'] = entity_type
    __args__['maxResults'] = max_results
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getEntityTagAssignments:getEntityTagAssignments', __args__, opts=opts, typ=GetEntityTagAssignmentsResult)
    return __ret__.apply(lambda __response__: GetEntityTagAssignmentsResult(
        entity_name=pulumi.get(__response__, 'entity_name'),
        entity_type=pulumi.get(__response__, 'entity_type'),
        id=pulumi.get(__response__, 'id'),
        max_results=pulumi.get(__response__, 'max_results'),
        tag_assignments=pulumi.get(__response__, 'tag_assignments')))
