# 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

__all__ = ['DataQualityRefreshArgs', 'DataQualityRefresh']

@pulumi.input_type
class DataQualityRefreshArgs:
    def __init__(__self__, *,
                 object_id: pulumi.Input[_builtins.str],
                 object_type: pulumi.Input[_builtins.str]):
        """
        The set of arguments for constructing a DataQualityRefresh resource.
        :param pulumi.Input[_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 pulumi.Input[_builtins.str] object_type: The type of the monitored object. Can be one of the following: `schema`or `table`
        """
        pulumi.set(__self__, "object_id", object_id)
        pulumi.set(__self__, "object_type", object_type)

    @_builtins.property
    @pulumi.getter(name="objectId")
    def object_id(self) -> pulumi.Input[_builtins.str]:
        """
        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
        """
        return pulumi.get(self, "object_id")

    @object_id.setter
    def object_id(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "object_id", value)

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

    @object_type.setter
    def object_type(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "object_type", value)


@pulumi.input_type
class _DataQualityRefreshState:
    def __init__(__self__, *,
                 end_time_ms: Optional[pulumi.Input[_builtins.int]] = None,
                 message: Optional[pulumi.Input[_builtins.str]] = None,
                 object_id: Optional[pulumi.Input[_builtins.str]] = None,
                 object_type: Optional[pulumi.Input[_builtins.str]] = None,
                 refresh_id: Optional[pulumi.Input[_builtins.int]] = None,
                 start_time_ms: Optional[pulumi.Input[_builtins.int]] = None,
                 state: Optional[pulumi.Input[_builtins.str]] = None,
                 trigger: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering DataQualityRefresh resources.
        :param pulumi.Input[_builtins.int] end_time_ms: (integer) - Time when the refresh ended (milliseconds since 1/1/1970 UTC)
        :param pulumi.Input[_builtins.str] message: (string) - An optional message to give insight into the current state of the refresh (e.g. FAILURE messages)
        :param pulumi.Input[_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 pulumi.Input[_builtins.str] object_type: The type of the monitored object. Can be one of the following: `schema`or `table`
        :param pulumi.Input[_builtins.int] refresh_id: (integer) - Unique id of the refresh operation
        :param pulumi.Input[_builtins.int] start_time_ms: (integer) - Time when the refresh started (milliseconds since 1/1/1970 UTC)
        :param pulumi.Input[_builtins.str] state: (string) - The current state of the refresh. Possible values are: `MONITOR_REFRESH_STATE_CANCELED`, `MONITOR_REFRESH_STATE_FAILED`, `MONITOR_REFRESH_STATE_PENDING`, `MONITOR_REFRESH_STATE_RUNNING`, `MONITOR_REFRESH_STATE_SUCCESS`, `MONITOR_REFRESH_STATE_UNKNOWN`
        :param pulumi.Input[_builtins.str] trigger: (string) - What triggered the refresh. Possible values are: `MONITOR_REFRESH_TRIGGER_DATA_CHANGE`, `MONITOR_REFRESH_TRIGGER_MANUAL`, `MONITOR_REFRESH_TRIGGER_SCHEDULE`, `MONITOR_REFRESH_TRIGGER_UNKNOWN`
        """
        if end_time_ms is not None:
            pulumi.set(__self__, "end_time_ms", end_time_ms)
        if message is not None:
            pulumi.set(__self__, "message", message)
        if object_id is not None:
            pulumi.set(__self__, "object_id", object_id)
        if object_type is not None:
            pulumi.set(__self__, "object_type", object_type)
        if refresh_id is not None:
            pulumi.set(__self__, "refresh_id", refresh_id)
        if start_time_ms is not None:
            pulumi.set(__self__, "start_time_ms", start_time_ms)
        if state is not None:
            pulumi.set(__self__, "state", state)
        if trigger is not None:
            pulumi.set(__self__, "trigger", trigger)

    @_builtins.property
    @pulumi.getter(name="endTimeMs")
    def end_time_ms(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        (integer) - Time when the refresh ended (milliseconds since 1/1/1970 UTC)
        """
        return pulumi.get(self, "end_time_ms")

    @end_time_ms.setter
    def end_time_ms(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "end_time_ms", value)

    @_builtins.property
    @pulumi.getter
    def message(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - An optional message to give insight into the current state of the refresh (e.g. FAILURE messages)
        """
        return pulumi.get(self, "message")

    @message.setter
    def message(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "message", value)

    @_builtins.property
    @pulumi.getter(name="objectId")
    def object_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        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
        """
        return pulumi.get(self, "object_id")

    @object_id.setter
    def object_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "object_id", value)

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

    @object_type.setter
    def object_type(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "object_type", value)

    @_builtins.property
    @pulumi.getter(name="refreshId")
    def refresh_id(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        (integer) - Unique id of the refresh operation
        """
        return pulumi.get(self, "refresh_id")

    @refresh_id.setter
    def refresh_id(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "refresh_id", value)

    @_builtins.property
    @pulumi.getter(name="startTimeMs")
    def start_time_ms(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        (integer) - Time when the refresh started (milliseconds since 1/1/1970 UTC)
        """
        return pulumi.get(self, "start_time_ms")

    @start_time_ms.setter
    def start_time_ms(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "start_time_ms", value)

    @_builtins.property
    @pulumi.getter
    def state(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The current state of the refresh. Possible values are: `MONITOR_REFRESH_STATE_CANCELED`, `MONITOR_REFRESH_STATE_FAILED`, `MONITOR_REFRESH_STATE_PENDING`, `MONITOR_REFRESH_STATE_RUNNING`, `MONITOR_REFRESH_STATE_SUCCESS`, `MONITOR_REFRESH_STATE_UNKNOWN`
        """
        return pulumi.get(self, "state")

    @state.setter
    def state(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "state", value)

    @_builtins.property
    @pulumi.getter
    def trigger(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - What triggered the refresh. Possible values are: `MONITOR_REFRESH_TRIGGER_DATA_CHANGE`, `MONITOR_REFRESH_TRIGGER_MANUAL`, `MONITOR_REFRESH_TRIGGER_SCHEDULE`, `MONITOR_REFRESH_TRIGGER_UNKNOWN`
        """
        return pulumi.get(self, "trigger")

    @trigger.setter
    def trigger(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "trigger", value)


@pulumi.type_token("databricks:index/dataQualityRefresh:DataQualityRefresh")
class DataQualityRefresh(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 object_id: Optional[pulumi.Input[_builtins.str]] = None,
                 object_type: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        [![Public Beta](https://img.shields.io/badge/Release_Stage-Public_Beta-orange)](https://docs.databricks.com/aws/en/release-notes/release-types)

        This resource allows you to refresh the data quality monitoring checks on Unity Catalog tables.

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

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

        ## Example Usage

        ## Import

        As of Pulumi v1.5, resources can be imported through configuration.

        hcl

        import {

          id = "object_type,object_id,refresh_id"

          to = databricks_data_quality_refresh.this

        }

        If you are using an older version of Pulumi, import the resource using the `pulumi import` command as follows:

        ```sh
        $ pulumi import databricks:index/dataQualityRefresh:DataQualityRefresh this "object_type,object_id,refresh_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_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 pulumi.Input[_builtins.str] object_type: The type of the monitored object. Can be one of the following: `schema`or `table`
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: DataQualityRefreshArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        [![Public Beta](https://img.shields.io/badge/Release_Stage-Public_Beta-orange)](https://docs.databricks.com/aws/en/release-notes/release-types)

        This resource allows you to refresh the data quality monitoring checks on Unity Catalog tables.

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

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

        ## Example Usage

        ## Import

        As of Pulumi v1.5, resources can be imported through configuration.

        hcl

        import {

          id = "object_type,object_id,refresh_id"

          to = databricks_data_quality_refresh.this

        }

        If you are using an older version of Pulumi, import the resource using the `pulumi import` command as follows:

        ```sh
        $ pulumi import databricks:index/dataQualityRefresh:DataQualityRefresh this "object_type,object_id,refresh_id"
        ```

        :param str resource_name: The name of the resource.
        :param DataQualityRefreshArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(DataQualityRefreshArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 object_id: Optional[pulumi.Input[_builtins.str]] = None,
                 object_type: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = DataQualityRefreshArgs.__new__(DataQualityRefreshArgs)

            if object_id is None and not opts.urn:
                raise TypeError("Missing required property 'object_id'")
            __props__.__dict__["object_id"] = object_id
            if object_type is None and not opts.urn:
                raise TypeError("Missing required property 'object_type'")
            __props__.__dict__["object_type"] = object_type
            __props__.__dict__["end_time_ms"] = None
            __props__.__dict__["message"] = None
            __props__.__dict__["refresh_id"] = None
            __props__.__dict__["start_time_ms"] = None
            __props__.__dict__["state"] = None
            __props__.__dict__["trigger"] = None
        super(DataQualityRefresh, __self__).__init__(
            'databricks:index/dataQualityRefresh:DataQualityRefresh',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            end_time_ms: Optional[pulumi.Input[_builtins.int]] = None,
            message: Optional[pulumi.Input[_builtins.str]] = None,
            object_id: Optional[pulumi.Input[_builtins.str]] = None,
            object_type: Optional[pulumi.Input[_builtins.str]] = None,
            refresh_id: Optional[pulumi.Input[_builtins.int]] = None,
            start_time_ms: Optional[pulumi.Input[_builtins.int]] = None,
            state: Optional[pulumi.Input[_builtins.str]] = None,
            trigger: Optional[pulumi.Input[_builtins.str]] = None) -> 'DataQualityRefresh':
        """
        Get an existing DataQualityRefresh resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.int] end_time_ms: (integer) - Time when the refresh ended (milliseconds since 1/1/1970 UTC)
        :param pulumi.Input[_builtins.str] message: (string) - An optional message to give insight into the current state of the refresh (e.g. FAILURE messages)
        :param pulumi.Input[_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 pulumi.Input[_builtins.str] object_type: The type of the monitored object. Can be one of the following: `schema`or `table`
        :param pulumi.Input[_builtins.int] refresh_id: (integer) - Unique id of the refresh operation
        :param pulumi.Input[_builtins.int] start_time_ms: (integer) - Time when the refresh started (milliseconds since 1/1/1970 UTC)
        :param pulumi.Input[_builtins.str] state: (string) - The current state of the refresh. Possible values are: `MONITOR_REFRESH_STATE_CANCELED`, `MONITOR_REFRESH_STATE_FAILED`, `MONITOR_REFRESH_STATE_PENDING`, `MONITOR_REFRESH_STATE_RUNNING`, `MONITOR_REFRESH_STATE_SUCCESS`, `MONITOR_REFRESH_STATE_UNKNOWN`
        :param pulumi.Input[_builtins.str] trigger: (string) - What triggered the refresh. Possible values are: `MONITOR_REFRESH_TRIGGER_DATA_CHANGE`, `MONITOR_REFRESH_TRIGGER_MANUAL`, `MONITOR_REFRESH_TRIGGER_SCHEDULE`, `MONITOR_REFRESH_TRIGGER_UNKNOWN`
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _DataQualityRefreshState.__new__(_DataQualityRefreshState)

        __props__.__dict__["end_time_ms"] = end_time_ms
        __props__.__dict__["message"] = message
        __props__.__dict__["object_id"] = object_id
        __props__.__dict__["object_type"] = object_type
        __props__.__dict__["refresh_id"] = refresh_id
        __props__.__dict__["start_time_ms"] = start_time_ms
        __props__.__dict__["state"] = state
        __props__.__dict__["trigger"] = trigger
        return DataQualityRefresh(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="endTimeMs")
    def end_time_ms(self) -> pulumi.Output[_builtins.int]:
        """
        (integer) - Time when the refresh ended (milliseconds since 1/1/1970 UTC)
        """
        return pulumi.get(self, "end_time_ms")

    @_builtins.property
    @pulumi.getter
    def message(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - An optional message to give insight into the current state of the refresh (e.g. FAILURE messages)
        """
        return pulumi.get(self, "message")

    @_builtins.property
    @pulumi.getter(name="objectId")
    def object_id(self) -> pulumi.Output[_builtins.str]:
        """
        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
        """
        return pulumi.get(self, "object_id")

    @_builtins.property
    @pulumi.getter(name="objectType")
    def object_type(self) -> pulumi.Output[_builtins.str]:
        """
        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="refreshId")
    def refresh_id(self) -> pulumi.Output[_builtins.int]:
        """
        (integer) - Unique id of the refresh operation
        """
        return pulumi.get(self, "refresh_id")

    @_builtins.property
    @pulumi.getter(name="startTimeMs")
    def start_time_ms(self) -> pulumi.Output[_builtins.int]:
        """
        (integer) - Time when the refresh started (milliseconds since 1/1/1970 UTC)
        """
        return pulumi.get(self, "start_time_ms")

    @_builtins.property
    @pulumi.getter
    def state(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The current state of the refresh. Possible values are: `MONITOR_REFRESH_STATE_CANCELED`, `MONITOR_REFRESH_STATE_FAILED`, `MONITOR_REFRESH_STATE_PENDING`, `MONITOR_REFRESH_STATE_RUNNING`, `MONITOR_REFRESH_STATE_SUCCESS`, `MONITOR_REFRESH_STATE_UNKNOWN`
        """
        return pulumi.get(self, "state")

    @_builtins.property
    @pulumi.getter
    def trigger(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - What triggered the refresh. Possible values are: `MONITOR_REFRESH_TRIGGER_DATA_CHANGE`, `MONITOR_REFRESH_TRIGGER_MANUAL`, `MONITOR_REFRESH_TRIGGER_SCHEDULE`, `MONITOR_REFRESH_TRIGGER_UNKNOWN`
        """
        return pulumi.get(self, "trigger")

