# 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
        elif self.scheme == EntityUriScheme.BIGQUERY:
            return self.get_db_primary_key()
        else:
            raise NotImplementedError(
                f"EntityUri.get_entity_id() for scheme '{self.scheme}' "
                f"is not yet supported in entity_uri '{self.complete_uri_string}'."
            )

    def get_db_primary_key(self) -> str:
        if self.scheme == EntityUriScheme.DATAPLEX:
            return (
                f"projects/{self.get_configs('projects')}/"
                f"locations/{self.get_configs('locations')}/"
                f"lakes/{self.get_configs('lakes')}/"
                f"zones/{self.get_configs('zones')}/"
                f"entities/{self.get_configs('entities')}"
            )
        elif self.scheme == EntityUriScheme.BIGQUERY:
            return (
                f"projects/{self.get_configs('projects')}/"
                f"datasets/{self.get_configs('datasets')}/"
                f"tables/{self.get_configs('tables')}"
            )
        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:

# 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

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

    def get_db_primary_key(self) -> str:
        if self.scheme == EntityUriScheme.DATAPLEX:
            return (
                f"projects/{self.get_configs('projects')}/"
                f"locations/{self.get_configs('locations')}/"
                f"lakes/{self.get_configs('lakes')}/"
                f"zones/{self.get_configs('zones')}/"
                f"entities/{self.get_configs('entities')}"
            )
        elif self.scheme == EntityUriScheme.BIGQUERY:
            return (
                f"projects/{self.get_configs('projects')}/"
                f"datasets/{self.get_configs('datasets')}/"
                f"tables/{self.get_configs('tables')}"
            )
        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