# 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__ = [
    'GetDataQualityMonitorResult',
    'AwaitableGetDataQualityMonitorResult',
    'get_data_quality_monitor',
    'get_data_quality_monitor_output',
]

@pulumi.output_type
class GetDataQualityMonitorResult:
    """
    A collection of values returned by getDataQualityMonitor.
    """
    def __init__(__self__, anomaly_detection_config=None, data_profiling_config=None, id=None, object_id=None, object_type=None):
        if anomaly_detection_config and not isinstance(anomaly_detection_config, dict):
            raise TypeError("Expected argument 'anomaly_detection_config' to be a dict")
        pulumi.set(__self__, "anomaly_detection_config", anomaly_detection_config)
        if data_profiling_config and not isinstance(data_profiling_config, dict):
            raise TypeError("Expected argument 'data_profiling_config' to be a dict")
        pulumi.set(__self__, "data_profiling_config", data_profiling_config)
        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)

    @_builtins.property
    @pulumi.getter(name="anomalyDetectionConfig")
    def anomaly_detection_config(self) -> 'outputs.GetDataQualityMonitorAnomalyDetectionConfigResult':
        """
        (AnomalyDetectionConfig) - Anomaly Detection Configuration, applicable to `schema` object types
        """
        return pulumi.get(self, "anomaly_detection_config")

    @_builtins.property
    @pulumi.getter(name="dataProfilingConfig")
    def data_profiling_config(self) -> 'outputs.GetDataQualityMonitorDataProfilingConfigResult':
        """
        (DataProfilingConfig) - Data Profiling Configuration, applicable to `table` object types. Exactly one `Analysis Configuration`
        must be present
        """
        return pulumi.get(self, "data_profiling_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="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")


class AwaitableGetDataQualityMonitorResult(GetDataQualityMonitorResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDataQualityMonitorResult(
            anomaly_detection_config=self.anomaly_detection_config,
            data_profiling_config=self.data_profiling_config,
            id=self.id,
            object_id=self.object_id,
            object_type=self.object_type)


def get_data_quality_monitor(object_id: Optional[_builtins.str] = None,
                             object_type: Optional[_builtins.str] = None,
                             opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDataQualityMonitorResult:
    """
    [![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 a data quality monitor.

    For the `table` `object_type`, 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 data quality monitor by Unity Catalog object type (currently supports `schema` and `table`) and object id:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_schema(name="my_catalog.my_schema")
    this_get_data_quality_monitor = databricks.get_data_quality_monitor(object_type="schema",
        object_id=this.schema_info.schema_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
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getDataQualityMonitor:getDataQualityMonitor', __args__, opts=opts, typ=GetDataQualityMonitorResult).value

    return AwaitableGetDataQualityMonitorResult(
        anomaly_detection_config=pulumi.get(__ret__, 'anomaly_detection_config'),
        data_profiling_config=pulumi.get(__ret__, 'data_profiling_config'),
        id=pulumi.get(__ret__, 'id'),
        object_id=pulumi.get(__ret__, 'object_id'),
        object_type=pulumi.get(__ret__, 'object_type'))
def get_data_quality_monitor_output(object_id: Optional[pulumi.Input[_builtins.str]] = None,
                                    object_type: Optional[pulumi.Input[_builtins.str]] = None,
                                    opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDataQualityMonitorResult]:
    """
    [![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 a data quality monitor.

    For the `table` `object_type`, 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 data quality monitor by Unity Catalog object type (currently supports `schema` and `table`) and object id:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_schema(name="my_catalog.my_schema")
    this_get_data_quality_monitor = databricks.get_data_quality_monitor(object_type="schema",
        object_id=this.schema_info.schema_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
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getDataQualityMonitor:getDataQualityMonitor', __args__, opts=opts, typ=GetDataQualityMonitorResult)
    return __ret__.apply(lambda __response__: GetDataQualityMonitorResult(
        anomaly_detection_config=pulumi.get(__response__, 'anomaly_detection_config'),
        data_profiling_config=pulumi.get(__response__, 'data_profiling_config'),
        id=pulumi.get(__response__, 'id'),
        object_id=pulumi.get(__response__, 'object_id'),
        object_type=pulumi.get(__response__, 'object_type')))
