# 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
        )
        entity_uri.validate()
        return entity_uri

    def to_dict(self: EntityUri) -> dict:
        return {
            "uri": self.complete_uri_string,
            "scheme": self.scheme.value,
            "entity_id": self.get_entity_id(),
            "db_primary_key": self.get_db_primary_key(),
            "configs": self.configs_dict,
        }

    def validate(self: EntityUri) -> None:
        configs = self.configs_dict
        if "*" in self.uri_configs_string:
            raise NotImplementedError(
                f"EntityUri: '{self.complete_uri_string}' "
                f"does not yet support wildcard character: '*'."
            )
        unsupported_configs = UNSUPPORTED_URI_CONFIGS.search(self.uri_configs_string)
        if unsupported_configs:
            raise ValueError(
                f"EntityUri: '{self.complete_uri_string}' "
                f"contains unsupported entity_uri character: '{unsupported_configs.group(0)}'."
            )
        if self.scheme == EntityUriScheme.DATAPLEX:
            self._validate_dataplex_uri_fields(
                config_id=self.complete_uri_string, configs=configs
            )

# 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

        )
        entity_uri.validate()
        return entity_uri

    def to_dict(self: EntityUri) -> dict:
        return {
            "uri": self.complete_uri_string,
            "scheme": self.scheme.value,
            "entity_id": self.get_entity_id(),
            "db_primary_key": self.get_db_primary_key(),
            "configs": self.configs_dict,
        }

    def validate(self: EntityUri) -> None:
        configs = self.configs_dict
        if "*" in self.uri_configs_string:
            raise NotImplementedError(
                f"EntityUri: '{self.complete_uri_string}' "
                f"does not yet support wildcard character: '*'."
            )
        unsupported_configs = UNSUPPORTED_URI_CONFIGS.search(self.uri_configs_string)
        if unsupported_configs:
            raise ValueError(
                f"EntityUri: '{self.complete_uri_string}' "
                f"contains unsupported entity_uri character: '{unsupported_configs.group(0)}'."
            )
        if self.scheme == EntityUriScheme.DATAPLEX:
            self._validate_dataplex_uri_fields(
                config_id=self.complete_uri_string, configs=configs
            )

        elif self.scheme == EntityUriScheme.BIGQUERY: