# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

__all__ = [
    'GetDiscoveryJobsResultResult',
    'AwaitableGetDiscoveryJobsResultResult',
    'get_discovery_jobs_result',
    'get_discovery_jobs_result_output',
]

@pulumi.output_type
class GetDiscoveryJobsResultResult:
    """
    A collection of values returned by getDiscoveryJobsResult.
    """
    def __init__(__self__, app_defined_child_column_keys=None, app_name=None, column_name=None, data_type=None, db_defined_child_column_keys=None, discovery_job_id=None, discovery_type=None, estimated_data_value_count=None, id=None, is_result_applied=None, key=None, modified_attributes=None, object=None, object_type=None, parent_column_keys=None, planned_action=None, relation_type=None, result_key=None, sample_data_values=None, schema_name=None, sensitive_columnkey=None, sensitive_type_id=None):
        if app_defined_child_column_keys and not isinstance(app_defined_child_column_keys, list):
            raise TypeError("Expected argument 'app_defined_child_column_keys' to be a list")
        pulumi.set(__self__, "app_defined_child_column_keys", app_defined_child_column_keys)
        if app_name and not isinstance(app_name, str):
            raise TypeError("Expected argument 'app_name' to be a str")
        pulumi.set(__self__, "app_name", app_name)
        if column_name and not isinstance(column_name, str):
            raise TypeError("Expected argument 'column_name' to be a str")
        pulumi.set(__self__, "column_name", column_name)
        if data_type and not isinstance(data_type, str):
            raise TypeError("Expected argument 'data_type' to be a str")
        pulumi.set(__self__, "data_type", data_type)
        if db_defined_child_column_keys and not isinstance(db_defined_child_column_keys, list):
            raise TypeError("Expected argument 'db_defined_child_column_keys' to be a list")
        pulumi.set(__self__, "db_defined_child_column_keys", db_defined_child_column_keys)
        if discovery_job_id and not isinstance(discovery_job_id, str):
            raise TypeError("Expected argument 'discovery_job_id' to be a str")
        pulumi.set(__self__, "discovery_job_id", discovery_job_id)
        if discovery_type and not isinstance(discovery_type, str):
            raise TypeError("Expected argument 'discovery_type' to be a str")
        if discovery_type is not None:
            warnings.warn("""The 'oci_data_safe_discovery_jobs_result' resource has been deprecated. It is no longer supported.""", DeprecationWarning)
            pulumi.log.warn("""discovery_type is deprecated: The 'oci_data_safe_discovery_jobs_result' resource has been deprecated. It is no longer supported.""")

        pulumi.set(__self__, "discovery_type", discovery_type)
        if estimated_data_value_count and not isinstance(estimated_data_value_count, str):
            raise TypeError("Expected argument 'estimated_data_value_count' to be a str")
        pulumi.set(__self__, "estimated_data_value_count", estimated_data_value_count)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if is_result_applied and not isinstance(is_result_applied, bool):
            raise TypeError("Expected argument 'is_result_applied' to be a bool")
        pulumi.set(__self__, "is_result_applied", is_result_applied)
        if key and not isinstance(key, str):
            raise TypeError("Expected argument 'key' to be a str")
        if key is not None:
            warnings.warn("""The 'oci_data_safe_discovery_jobs_result' resource has been deprecated. It is no longer supported.""", DeprecationWarning)
            pulumi.log.warn("""key is deprecated: The 'oci_data_safe_discovery_jobs_result' resource has been deprecated. It is no longer supported.""")

        pulumi.set(__self__, "key", key)
        if modified_attributes and not isinstance(modified_attributes, list):
            raise TypeError("Expected argument 'modified_attributes' to be a list")
        pulumi.set(__self__, "modified_attributes", modified_attributes)
        if object and not isinstance(object, str):
            raise TypeError("Expected argument 'object' to be a str")
        pulumi.set(__self__, "object", object)
        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 parent_column_keys and not isinstance(parent_column_keys, list):
            raise TypeError("Expected argument 'parent_column_keys' to be a list")
        pulumi.set(__self__, "parent_column_keys", parent_column_keys)
        if planned_action and not isinstance(planned_action, str):
            raise TypeError("Expected argument 'planned_action' to be a str")
        pulumi.set(__self__, "planned_action", planned_action)
        if relation_type and not isinstance(relation_type, str):
            raise TypeError("Expected argument 'relation_type' to be a str")
        pulumi.set(__self__, "relation_type", relation_type)
        if result_key and not isinstance(result_key, str):
            raise TypeError("Expected argument 'result_key' to be a str")
        pulumi.set(__self__, "result_key", result_key)
        if sample_data_values and not isinstance(sample_data_values, list):
            raise TypeError("Expected argument 'sample_data_values' to be a list")
        pulumi.set(__self__, "sample_data_values", sample_data_values)
        if schema_name and not isinstance(schema_name, str):
            raise TypeError("Expected argument 'schema_name' to be a str")
        pulumi.set(__self__, "schema_name", schema_name)
        if sensitive_columnkey and not isinstance(sensitive_columnkey, str):
            raise TypeError("Expected argument 'sensitive_columnkey' to be a str")
        pulumi.set(__self__, "sensitive_columnkey", sensitive_columnkey)
        if sensitive_type_id and not isinstance(sensitive_type_id, str):
            raise TypeError("Expected argument 'sensitive_type_id' to be a str")
        pulumi.set(__self__, "sensitive_type_id", sensitive_type_id)

    @property
    @pulumi.getter(name="appDefinedChildColumnKeys")
    def app_defined_child_column_keys(self) -> Sequence[str]:
        """
        Unique keys identifying the columns that are application-level (non-dictionary) children of the sensitive column.
        """
        return pulumi.get(self, "app_defined_child_column_keys")

    @property
    @pulumi.getter(name="appName")
    def app_name(self) -> str:
        """
        The name of the application. An application is an entity that is identified by a schema and stores sensitive information for that schema. Its value will be same as schemaName, if no value is passed.
        """
        return pulumi.get(self, "app_name")

    @property
    @pulumi.getter(name="columnName")
    def column_name(self) -> str:
        """
        The name of the sensitive column.
        """
        return pulumi.get(self, "column_name")

    @property
    @pulumi.getter(name="dataType")
    def data_type(self) -> str:
        """
        The data type of the sensitive column.
        """
        return pulumi.get(self, "data_type")

    @property
    @pulumi.getter(name="dbDefinedChildColumnKeys")
    def db_defined_child_column_keys(self) -> Sequence[str]:
        """
        Unique keys identifying the columns that are database-level (dictionary-defined) children of the sensitive column.
        """
        return pulumi.get(self, "db_defined_child_column_keys")

    @property
    @pulumi.getter(name="discoveryJobId")
    def discovery_job_id(self) -> str:
        """
        The OCID of the discovery job.
        """
        return pulumi.get(self, "discovery_job_id")

    @property
    @pulumi.getter(name="discoveryType")
    def discovery_type(self) -> str:
        """
        The type of the discovery result. It can be one of the following three types: NEW: A new sensitive column in the target database that is not in the sensitive data model. DELETED: A column that is present in the sensitive data model but has been deleted from the target database. MODIFIED: A column that is present in the target database as well as the sensitive data model but some of its attributes have been modified.
        """
        return pulumi.get(self, "discovery_type")

    @property
    @pulumi.getter(name="estimatedDataValueCount")
    def estimated_data_value_count(self) -> str:
        """
        The estimated number of data values the column has in the associated database.
        """
        return pulumi.get(self, "estimated_data_value_count")

    @property
    @pulumi.getter
    def id(self) -> str:
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="isResultApplied")
    def is_result_applied(self) -> bool:
        """
        Indicates if the discovery result has been processed. You can update this attribute using the PatchDiscoveryJobResults operation to track whether the discovery result has already been processed and applied to the sensitive data model.
        """
        return pulumi.get(self, "is_result_applied")

    @property
    @pulumi.getter
    def key(self) -> str:
        """
        The unique key that identifies the discovery result.
        """
        return pulumi.get(self, "key")

    @property
    @pulumi.getter(name="modifiedAttributes")
    def modified_attributes(self) -> Sequence['outputs.GetDiscoveryJobsResultModifiedAttributeResult']:
        """
        The attributes of a sensitive column that have been modified in the target database. It's populated only in the case of MODIFIED discovery results and shows the new values of the modified attributes.
        """
        return pulumi.get(self, "modified_attributes")

    @property
    @pulumi.getter
    def object(self) -> str:
        """
        The database object that contains the sensitive column.
        """
        return pulumi.get(self, "object")

    @property
    @pulumi.getter(name="objectType")
    def object_type(self) -> str:
        """
        The type of the database object that contains the sensitive column.
        """
        return pulumi.get(self, "object_type")

    @property
    @pulumi.getter(name="parentColumnKeys")
    def parent_column_keys(self) -> Sequence[str]:
        """
        Unique keys identifying the columns that are parents of the sensitive column. At present, it tracks a single parent only.
        """
        return pulumi.get(self, "parent_column_keys")

    @property
    @pulumi.getter(name="plannedAction")
    def planned_action(self) -> str:
        """
        Specifies how to process the discovery result. It's set to NONE by default. Use the PatchDiscoveryJobResults operation to update this attribute. You can choose one of the following options: ACCEPT: To accept the discovery result and update the sensitive data model to reflect the changes. REJECT: To reject the discovery result so that it doesn't change the sensitive data model. INVALIDATE: To invalidate a newly discovered column. It adds the column to the sensitive data model but marks it as invalid. It helps track false positives and ensure that they aren't reported by future discovery jobs. After specifying the planned action, you can use the ApplyDiscoveryJobResults operation to automatically process the discovery results.
        """
        return pulumi.get(self, "planned_action")

    @property
    @pulumi.getter(name="relationType")
    def relation_type(self) -> str:
        """
        The type of referential relationship the sensitive column has with its parent. NONE indicates that the sensitive column does not have a parent. DB_DEFINED indicates that the relationship is defined in the database dictionary. APP_DEFINED indicates that the relationship is defined at the application level and not in the database dictionary.
        """
        return pulumi.get(self, "relation_type")

    @property
    @pulumi.getter(name="resultKey")
    def result_key(self) -> str:
        return pulumi.get(self, "result_key")

    @property
    @pulumi.getter(name="sampleDataValues")
    def sample_data_values(self) -> Sequence[str]:
        """
        Original data values collected for the sensitive column from the associated database. Sample data helps review the column and ensure that it actually contains sensitive data. Note that sample data is retrieved by a data discovery job only if the isSampleDataCollectionEnabled attribute is set to true. At present, only one data value is collected per sensitive column.
        """
        return pulumi.get(self, "sample_data_values")

    @property
    @pulumi.getter(name="schemaName")
    def schema_name(self) -> str:
        """
        The database schema that contains the sensitive column.
        """
        return pulumi.get(self, "schema_name")

    @property
    @pulumi.getter(name="sensitiveColumnkey")
    def sensitive_columnkey(self) -> str:
        """
        The unique key that identifies the sensitive column represented by the discovery result.
        """
        return pulumi.get(self, "sensitive_columnkey")

    @property
    @pulumi.getter(name="sensitiveTypeId")
    def sensitive_type_id(self) -> str:
        """
        The OCID of the sensitive type associated with the sensitive column.
        """
        return pulumi.get(self, "sensitive_type_id")


class AwaitableGetDiscoveryJobsResultResult(GetDiscoveryJobsResultResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDiscoveryJobsResultResult(
            app_defined_child_column_keys=self.app_defined_child_column_keys,
            app_name=self.app_name,
            column_name=self.column_name,
            data_type=self.data_type,
            db_defined_child_column_keys=self.db_defined_child_column_keys,
            discovery_job_id=self.discovery_job_id,
            discovery_type=self.discovery_type,
            estimated_data_value_count=self.estimated_data_value_count,
            id=self.id,
            is_result_applied=self.is_result_applied,
            key=self.key,
            modified_attributes=self.modified_attributes,
            object=self.object,
            object_type=self.object_type,
            parent_column_keys=self.parent_column_keys,
            planned_action=self.planned_action,
            relation_type=self.relation_type,
            result_key=self.result_key,
            sample_data_values=self.sample_data_values,
            schema_name=self.schema_name,
            sensitive_columnkey=self.sensitive_columnkey,
            sensitive_type_id=self.sensitive_type_id)


def get_discovery_jobs_result(discovery_job_id: Optional[str] = None,
                              result_key: Optional[str] = None,
                              opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDiscoveryJobsResultResult:
    """
    This data source provides details about a specific Discovery Jobs Result resource in Oracle Cloud Infrastructure Data Safe service.

    Gets the details of the specified discovery result.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_discovery_jobs_result = oci.DataSafe.get_discovery_jobs_result(discovery_job_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        result_key=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str discovery_job_id: The OCID of the discovery job.
    :param str result_key: The unique key that identifies the discovery result.
    """
    __args__ = dict()
    __args__['discoveryJobId'] = discovery_job_id
    __args__['resultKey'] = result_key
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:DataSafe/getDiscoveryJobsResult:getDiscoveryJobsResult', __args__, opts=opts, typ=GetDiscoveryJobsResultResult).value

    return AwaitableGetDiscoveryJobsResultResult(
        app_defined_child_column_keys=__ret__.app_defined_child_column_keys,
        app_name=__ret__.app_name,
        column_name=__ret__.column_name,
        data_type=__ret__.data_type,
        db_defined_child_column_keys=__ret__.db_defined_child_column_keys,
        discovery_job_id=__ret__.discovery_job_id,
        discovery_type=__ret__.discovery_type,
        estimated_data_value_count=__ret__.estimated_data_value_count,
        id=__ret__.id,
        is_result_applied=__ret__.is_result_applied,
        key=__ret__.key,
        modified_attributes=__ret__.modified_attributes,
        object=__ret__.object,
        object_type=__ret__.object_type,
        parent_column_keys=__ret__.parent_column_keys,
        planned_action=__ret__.planned_action,
        relation_type=__ret__.relation_type,
        result_key=__ret__.result_key,
        sample_data_values=__ret__.sample_data_values,
        schema_name=__ret__.schema_name,
        sensitive_columnkey=__ret__.sensitive_columnkey,
        sensitive_type_id=__ret__.sensitive_type_id)


@_utilities.lift_output_func(get_discovery_jobs_result)
def get_discovery_jobs_result_output(discovery_job_id: Optional[pulumi.Input[str]] = None,
                                     result_key: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetDiscoveryJobsResultResult]:
    """
    This data source provides details about a specific Discovery Jobs Result resource in Oracle Cloud Infrastructure Data Safe service.

    Gets the details of the specified discovery result.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_discovery_jobs_result = oci.DataSafe.get_discovery_jobs_result(discovery_job_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        result_key=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str discovery_job_id: The OCID of the discovery job.
    :param str result_key: The unique key that identifies the discovery result.
    """
    ...
