# 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__ = [
    'GetPolicyInfosResult',
    'AwaitableGetPolicyInfosResult',
    'get_policy_infos',
    'get_policy_infos_output',
]

@pulumi.output_type
class GetPolicyInfosResult:
    """
    A collection of values returned by getPolicyInfos.
    """
    def __init__(__self__, id=None, include_inherited=None, max_results=None, on_securable_fullname=None, on_securable_type=None, policies=None, provider_config=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if include_inherited and not isinstance(include_inherited, bool):
            raise TypeError("Expected argument 'include_inherited' to be a bool")
        pulumi.set(__self__, "include_inherited", include_inherited)
        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 on_securable_fullname and not isinstance(on_securable_fullname, str):
            raise TypeError("Expected argument 'on_securable_fullname' to be a str")
        pulumi.set(__self__, "on_securable_fullname", on_securable_fullname)
        if on_securable_type and not isinstance(on_securable_type, str):
            raise TypeError("Expected argument 'on_securable_type' to be a str")
        pulumi.set(__self__, "on_securable_type", on_securable_type)
        if policies and not isinstance(policies, list):
            raise TypeError("Expected argument 'policies' to be a list")
        pulumi.set(__self__, "policies", policies)
        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
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter(name="includeInherited")
    def include_inherited(self) -> Optional[_builtins.bool]:
        return pulumi.get(self, "include_inherited")

    @_builtins.property
    @pulumi.getter(name="maxResults")
    def max_results(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "max_results")

    @_builtins.property
    @pulumi.getter(name="onSecurableFullname")
    def on_securable_fullname(self) -> _builtins.str:
        """
        (string) - Full name of the securable on which the policy is defined.
        Required on create
        """
        return pulumi.get(self, "on_securable_fullname")

    @_builtins.property
    @pulumi.getter(name="onSecurableType")
    def on_securable_type(self) -> _builtins.str:
        """
        (string) - Type of the securable on which the policy is defined.
        Only `CATALOG`, `SCHEMA` and `TABLE` are supported at this moment.
        Required on create. Possible values are: `CATALOG`, `CLEAN_ROOM`, `CONNECTION`, `CREDENTIAL`, `EXTERNAL_LOCATION`, `EXTERNAL_METADATA`, `FUNCTION`, `METASTORE`, `PIPELINE`, `PROVIDER`, `RECIPIENT`, `SCHEMA`, `SHARE`, `STAGING_TABLE`, `STORAGE_CREDENTIAL`, `TABLE`, `VOLUME`
        """
        return pulumi.get(self, "on_securable_type")

    @_builtins.property
    @pulumi.getter
    def policies(self) -> Sequence['outputs.GetPolicyInfosPolicyResult']:
        return pulumi.get(self, "policies")

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


class AwaitableGetPolicyInfosResult(GetPolicyInfosResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetPolicyInfosResult(
            id=self.id,
            include_inherited=self.include_inherited,
            max_results=self.max_results,
            on_securable_fullname=self.on_securable_fullname,
            on_securable_type=self.on_securable_type,
            policies=self.policies,
            provider_config=self.provider_config)


def get_policy_infos(include_inherited: Optional[_builtins.bool] = None,
                     max_results: Optional[_builtins.int] = None,
                     on_securable_fullname: Optional[_builtins.str] = None,
                     on_securable_type: Optional[_builtins.str] = None,
                     provider_config: Optional[Union['GetPolicyInfosProviderConfigArgs', 'GetPolicyInfosProviderConfigArgsDict']] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPolicyInfosResult:
    """
    [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

    Retrieves a list of all ABAC (Attribute-Based Access Control) policies defined on a specific securable in Unity Catalog. Use this data source to query all policies for a given securable type and name.

    ABAC policies provide governance for enforcing compliance through data attributes, allowing flexible and comprehensive access control based on conditions rather than specific resources.

    ## Example Usage

    ### List All Policies on a Securable

    ```python
    import pulumi
    import pulumi_databricks as databricks

    catalog_policies = databricks.get_policy_infos(on_securable_type="CATALOG",
        on_securable_fullname="main")
    ```


    :param _builtins.bool include_inherited: Optional. Whether to include policies defined on parent securables.
           By default, the inherited policies are not included
    :param _builtins.int max_results: Optional.  Maximum number of policies to return on a single page (page length).
           - When not set or set to 0, the page length is set to a server configured value (recommended);
           - When set to a value greater than 0, the page length is the minimum of this value and a server configured value;
    :param _builtins.str on_securable_fullname: Required. The fully qualified name of securable to list policies for
    :param _builtins.str on_securable_type: Required. The type of the securable to list policies for
    :param Union['GetPolicyInfosProviderConfigArgs', 'GetPolicyInfosProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider.
    """
    __args__ = dict()
    __args__['includeInherited'] = include_inherited
    __args__['maxResults'] = max_results
    __args__['onSecurableFullname'] = on_securable_fullname
    __args__['onSecurableType'] = on_securable_type
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getPolicyInfos:getPolicyInfos', __args__, opts=opts, typ=GetPolicyInfosResult).value

    return AwaitableGetPolicyInfosResult(
        id=pulumi.get(__ret__, 'id'),
        include_inherited=pulumi.get(__ret__, 'include_inherited'),
        max_results=pulumi.get(__ret__, 'max_results'),
        on_securable_fullname=pulumi.get(__ret__, 'on_securable_fullname'),
        on_securable_type=pulumi.get(__ret__, 'on_securable_type'),
        policies=pulumi.get(__ret__, 'policies'),
        provider_config=pulumi.get(__ret__, 'provider_config'))
def get_policy_infos_output(include_inherited: Optional[pulumi.Input[Optional[_builtins.bool]]] = None,
                            max_results: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                            on_securable_fullname: Optional[pulumi.Input[_builtins.str]] = None,
                            on_securable_type: Optional[pulumi.Input[_builtins.str]] = None,
                            provider_config: Optional[pulumi.Input[Optional[Union['GetPolicyInfosProviderConfigArgs', 'GetPolicyInfosProviderConfigArgsDict']]]] = None,
                            opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetPolicyInfosResult]:
    """
    [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

    Retrieves a list of all ABAC (Attribute-Based Access Control) policies defined on a specific securable in Unity Catalog. Use this data source to query all policies for a given securable type and name.

    ABAC policies provide governance for enforcing compliance through data attributes, allowing flexible and comprehensive access control based on conditions rather than specific resources.

    ## Example Usage

    ### List All Policies on a Securable

    ```python
    import pulumi
    import pulumi_databricks as databricks

    catalog_policies = databricks.get_policy_infos(on_securable_type="CATALOG",
        on_securable_fullname="main")
    ```


    :param _builtins.bool include_inherited: Optional. Whether to include policies defined on parent securables.
           By default, the inherited policies are not included
    :param _builtins.int max_results: Optional.  Maximum number of policies to return on a single page (page length).
           - When not set or set to 0, the page length is set to a server configured value (recommended);
           - When set to a value greater than 0, the page length is the minimum of this value and a server configured value;
    :param _builtins.str on_securable_fullname: Required. The fully qualified name of securable to list policies for
    :param _builtins.str on_securable_type: Required. The type of the securable to list policies for
    :param Union['GetPolicyInfosProviderConfigArgs', 'GetPolicyInfosProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider.
    """
    __args__ = dict()
    __args__['includeInherited'] = include_inherited
    __args__['maxResults'] = max_results
    __args__['onSecurableFullname'] = on_securable_fullname
    __args__['onSecurableType'] = on_securable_type
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getPolicyInfos:getPolicyInfos', __args__, opts=opts, typ=GetPolicyInfosResult)
    return __ret__.apply(lambda __response__: GetPolicyInfosResult(
        id=pulumi.get(__response__, 'id'),
        include_inherited=pulumi.get(__response__, 'include_inherited'),
        max_results=pulumi.get(__response__, 'max_results'),
        on_securable_fullname=pulumi.get(__response__, 'on_securable_fullname'),
        on_securable_type=pulumi.get(__response__, 'on_securable_type'),
        policies=pulumi.get(__response__, 'policies'),
        provider_config=pulumi.get(__response__, 'provider_config')))
