# Path: clouddq/classes/entity_uri_schemes.py
# class EntityUriScheme(str, Enum):
#     """ """
# 
#     DATAPLEX = "DATAPLEX"
#     BIGQUERY = "BIGQUERY"
# 
#     @classmethod
#     def from_scheme(cls, scheme: str):
# 
#         try:
#             return cls(scheme.upper())
#         except ValueError:
#             raise NotImplementedError(f"{scheme} scheme is not implemented.")
# 
# Path: clouddq/classes/metadata_registry_defaults.py
# BIGQUERY_URI_FIELDS = ["projects", "datasets", "tables"]
# 
# Path: clouddq/classes/metadata_registry_defaults.py
# DATAPLEX_URI_FIELDS = ["projects", "locations", "lakes", "zones", "entities"]
# 
# Path: clouddq/classes/metadata_registry_defaults.py
# SAMPLE_DEFAULT_REGISTRIES_YAML = """
# metadata_registry_defaults:
#   dataplex:
#     projects: <my-gcp-project-id>
#     locations: <my-gcp-dataplex-region-id>
#     lakes: <my-gcp-dataplex-lake-id>
#     zones: <my-gcp-dataplex-zone-id>
# """


from dataclasses import dataclass
from clouddq.classes.entity_uri_schemes import EntityUriScheme
from clouddq.classes.metadata_registry_defaults import BIGQUERY_URI_FIELDS
from clouddq.classes.metadata_registry_defaults import DATAPLEX_URI_FIELDS
from clouddq.classes.metadata_registry_defaults import SAMPLE_DEFAULT_REGISTRIES_YAML
import logging
import re
import typing
        else:
            raise NotImplementedError(
                f"EntityUri.get_db_primary_key() for scheme '{self.scheme}' "
                f"is not yet supported in entity_uri '{self.complete_uri_string}'."
            )

    def _validate_dataplex_uri_fields(self, config_id: str, configs: dict) -> None:
        expected_fields = DATAPLEX_URI_FIELDS
        for field in expected_fields:
            value = configs.get(field, None)
            if not value:
                raise ValueError(
                    f"Required argument '{field}' not found in  entity_uri: {config_id}.\n"
                    f"Either add '{field}' to the URI or specify default Dataplex configs for "
                    f"projects/locations/lakes/zones as part of a YAML "
                    f"'metadata_default_registries' config, e.g.\n"
                    f"{SAMPLE_DEFAULT_REGISTRIES_YAML}"
                )

    def _validate_bigquery_uri_fields(self, config_id: str, configs: dict) -> None:
        expected_fields = BIGQUERY_URI_FIELDS
        for field in expected_fields:
            value = configs.get(field, None)
            if not value:
                raise ValueError(
                    value,
                    f"Required argument '{field}' not found in entity_uri: {config_id}.\n"
                    f"Either add '{field}' to the URI or specify default Dataplex "
                    f"projects/locations/lakes/zones configs as part of the YAML "
                    f"input config under headings 'metadata_default_registries', e.g.\n"

# Path: clouddq/classes/entity_uri_schemes.py
# class EntityUriScheme(str, Enum):
#     """ """
# 
#     DATAPLEX = "DATAPLEX"
#     BIGQUERY = "BIGQUERY"
# 
#     @classmethod
#     def from_scheme(cls, scheme: str):
# 
#         try:
#             return cls(scheme.upper())
#         except ValueError:
#             raise NotImplementedError(f"{scheme} scheme is not implemented.")
# 
# Path: clouddq/classes/metadata_registry_defaults.py
# BIGQUERY_URI_FIELDS = ["projects", "datasets", "tables"]
# 
# Path: clouddq/classes/metadata_registry_defaults.py
# DATAPLEX_URI_FIELDS = ["projects", "locations", "lakes", "zones", "entities"]
# 
# Path: clouddq/classes/metadata_registry_defaults.py
# SAMPLE_DEFAULT_REGISTRIES_YAML = """
# metadata_registry_defaults:
#   dataplex:
#     projects: <my-gcp-project-id>
#     locations: <my-gcp-dataplex-region-id>
#     lakes: <my-gcp-dataplex-lake-id>
#     zones: <my-gcp-dataplex-zone-id>
# """


# Path: clouddq/classes/dq_entity_uri.py
from dataclasses import dataclass
from clouddq.classes.entity_uri_schemes import EntityUriScheme
from clouddq.classes.metadata_registry_defaults import BIGQUERY_URI_FIELDS
from clouddq.classes.metadata_registry_defaults import DATAPLEX_URI_FIELDS
from clouddq.classes.metadata_registry_defaults import SAMPLE_DEFAULT_REGISTRIES_YAML
import logging
import re
import typing

        else:
            raise NotImplementedError(
                f"EntityUri.get_db_primary_key() for scheme '{self.scheme}' "
                f"is not yet supported in entity_uri '{self.complete_uri_string}'."
            )

    def _validate_dataplex_uri_fields(self, config_id: str, configs: dict) -> None:
        expected_fields = DATAPLEX_URI_FIELDS
        for field in expected_fields:
            value = configs.get(field, None)
            if not value:
                raise ValueError(
                    f"Required argument '{field}' not found in  entity_uri: {config_id}.\n"
                    f"Either add '{field}' to the URI or specify default Dataplex configs for "
                    f"projects/locations/lakes/zones as part of a YAML "
                    f"'metadata_default_registries' config, e.g.\n"
                    f"{SAMPLE_DEFAULT_REGISTRIES_YAML}"
                )

    def _validate_bigquery_uri_fields(self, config_id: str, configs: dict) -> None:
        expected_fields = BIGQUERY_URI_FIELDS
        for field in expected_fields:
            value = configs.get(field, None)
            if not value:
                raise ValueError(
                    value,
                    f"Required argument '{field}' not found in entity_uri: {config_id}.\n"
                    f"Either add '{field}' to the URI or specify default Dataplex "
                    f"projects/locations/lakes/zones configs as part of the YAML "
                    f"input config under headings 'metadata_default_registries', e.g.\n"

                    f"{SAMPLE_DEFAULT_REGISTRIES_YAML}",