# 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__ = [
    'GetDataQualityRefreshesResult',
    'AwaitableGetDataQualityRefreshesResult',
    'get_data_quality_refreshes',
    'get_data_quality_refreshes_output',
]

@pulumi.output_type
class GetDataQualityRefreshesResult:
    """
    A collection of values returned by getDataQualityRefreshes.
    """
    def __init__(__self__, id=None, object_id=None, object_type=None, page_size=None, refreshes=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if object_id and not isinstance(object_id, str):
            raise TypeError("Expected argument 'object_id' to be a str")
        pulumi.set(__self__, "object_id", object_id)
        if object_type and not isinstance(object_type, str):
            raise TypeError("Expected argument 'object_type' to be a str")
        pulumi.set(__self__, "object_type", object_type)
        if page_size and not isinstance(page_size, int):
            raise TypeError("Expected argument 'page_size' to be a int")
        pulumi.set(__self__, "page_size", page_size)
        if refreshes and not isinstance(refreshes, list):
            raise TypeError("Expected argument 'refreshes' to be a list")
        pulumi.set(__self__, "refreshes", refreshes)

    @_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="objectId")
    def object_id(self) -> _builtins.str:
        """
        (string) - The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`.
        """
        return pulumi.get(self, "object_id")

    @_builtins.property
    @pulumi.getter(name="objectType")
    def object_type(self) -> _builtins.str:
        """
        (string) - The type of the monitored object. Can be one of the following: `schema`or `table`
        """
        return pulumi.get(self, "object_type")

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

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


class AwaitableGetDataQualityRefreshesResult(GetDataQualityRefreshesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDataQualityRefreshesResult(
            id=self.id,
            object_id=self.object_id,
            object_type=self.object_type,
            page_size=self.page_size,
            refreshes=self.refreshes)


def get_data_quality_refreshes(object_id: Optional[_builtins.str] = None,
                               object_type: Optional[_builtins.str] = None,
                               page_size: Optional[_builtins.int] = None,
                               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDataQualityRefreshesResult:
    """
    [![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 can be used to fetch the list of data quality refreshes on a Unity Catalog table.

    The caller must either:
    1. be an owner of the table's parent catalog
    2. have **USE_CATALOG** on the table's parent catalog and be an owner of the table's parent schema.
    3. have the following permissions:
       - **USE_CATALOG** on the table's parent catalog
       - **USE_SCHEMA** on the table's parent schema
       - **SELECT** privilege on the table.

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

    ## Example Usage

    Getting a list of all data quality refresh for a given table:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_table(name="my_catalog.my_schema.my_table")
    all = databricks.get_data_quality_refreshes(object_type="table",
        object_id=this.id)
    ```


    :param _builtins.str object_id: The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`.
           
           Find the `schema_id` from either:
           1. The [schema_id](https://docs.databricks.com/api/workspace/schemas/get#schema_id) of the `Schemas` resource.
           2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `schema` > go to the `Details` tab > the `Schema ID` field.
           
           Find the `table_id` from either:
           1. The [table_id](https://docs.databricks.com/api/workspace/tables/get#table_id) of the `Tables` resource.
           2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `table` > go to the `Details` tab > the `Table ID` field
    :param _builtins.str object_type: The type of the monitored object. Can be one of the following: `schema` or `table`
    """
    __args__ = dict()
    __args__['objectId'] = object_id
    __args__['objectType'] = object_type
    __args__['pageSize'] = page_size
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getDataQualityRefreshes:getDataQualityRefreshes', __args__, opts=opts, typ=GetDataQualityRefreshesResult).value

    return AwaitableGetDataQualityRefreshesResult(
        id=pulumi.get(__ret__, 'id'),
        object_id=pulumi.get(__ret__, 'object_id'),
        object_type=pulumi.get(__ret__, 'object_type'),
        page_size=pulumi.get(__ret__, 'page_size'),
        refreshes=pulumi.get(__ret__, 'refreshes'))
def get_data_quality_refreshes_output(object_id: Optional[pulumi.Input[_builtins.str]] = None,
                                      object_type: Optional[pulumi.Input[_builtins.str]] = None,
                                      page_size: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDataQualityRefreshesResult]:
    """
    [![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 can be used to fetch the list of data quality refreshes on a Unity Catalog table.

    The caller must either:
    1. be an owner of the table's parent catalog
    2. have **USE_CATALOG** on the table's parent catalog and be an owner of the table's parent schema.
    3. have the following permissions:
       - **USE_CATALOG** on the table's parent catalog
       - **USE_SCHEMA** on the table's parent schema
       - **SELECT** privilege on the table.

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

    ## Example Usage

    Getting a list of all data quality refresh for a given table:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_table(name="my_catalog.my_schema.my_table")
    all = databricks.get_data_quality_refreshes(object_type="table",
        object_id=this.id)
    ```


    :param _builtins.str object_id: The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`.
           
           Find the `schema_id` from either:
           1. The [schema_id](https://docs.databricks.com/api/workspace/schemas/get#schema_id) of the `Schemas` resource.
           2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `schema` > go to the `Details` tab > the `Schema ID` field.
           
           Find the `table_id` from either:
           1. The [table_id](https://docs.databricks.com/api/workspace/tables/get#table_id) of the `Tables` resource.
           2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `table` > go to the `Details` tab > the `Table ID` field
    :param _builtins.str object_type: The type of the monitored object. Can be one of the following: `schema` or `table`
    """
    __args__ = dict()
    __args__['objectId'] = object_id
    __args__['objectType'] = object_type
    __args__['pageSize'] = page_size
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getDataQualityRefreshes:getDataQualityRefreshes', __args__, opts=opts, typ=GetDataQualityRefreshesResult)
    return __ret__.apply(lambda __response__: GetDataQualityRefreshesResult(
        id=pulumi.get(__response__, 'id'),
        object_id=pulumi.get(__response__, 'object_id'),
        object_type=pulumi.get(__response__, 'object_type'),
        page_size=pulumi.get(__response__, 'page_size'),
        refreshes=pulumi.get(__response__, 'refreshes')))
