# Path: cassiopeia/datastores/kernel/common.py
# def _get_latest_version(
#     query: MutableMapping[str, Any], context: PipelineContext
# ) -> str:
# def _get_default_locale(
#     query: MutableMapping[str, Any], context: PipelineContext
# ) -> str:
#     def __init__(self, server_url: str, port: int, http_client: HTTPClient = None):
#     def _get(
#         self,
#         endpoint: str,
#         parameters: MutableMapping[str, Any] = None,
#         connection: Curl = None,
#     ) -> Union[dict, list, Any]:
#     def get(
#         self,
#         type: Type[T],
#         query: MutableMapping[str, Any],
#         context: PipelineContext = None,
#     ) -> T:
#     def get_many(
#         self,
#         type: Type[T],
#         query: MutableMapping[str, Any],
#         context: PipelineContext = None,
#     ) -> Iterable[T]:
# T = TypeVar("T")
# class KernelSource(DataSource):
# 
# Path: cassiopeia/data.py
# class Platform(Enum):
#     brazil = "BR1"
#     europe_north_east = "EUN1"
#     europe_west = "EUW1"
#     japan = "JP1"
#     korea = "KR"
#     latin_america_north = "LA1"
#     latin_america_south = "LA2"
#     north_america = "NA1"
#     oceania = "OC1"
#     turkey = "TR1"
#     russia = "RU"
# 
#     @property
#     def region(self) -> "Region":
#         return getattr(Region, self.name)
# 
#     @property
#     def default_locale(self) -> str:
#         return DEFAULT_LOCALE[self]
# 
#     @staticmethod
#     def from_region(region):
#         try:
#             return region.platform
#         except AttributeError:
#             return Region(region).platform
# 
#     @property
#     def continent(self):
#         return self.region.continent
# 
# Path: cassiopeia/datastores/uniquekeys.py
# def convert_region_to_platform(query: MutableMapping[str, Any]) -> None:
#     if "region" in query and "platform" not in query:
#         try:
#             query["platform"] = Region(query["region"]).platform
#         except ValueError as e:
#             raise QueryValidationError from e
# 
#     if "regions" in query and "platforms" not in query:
#         query["platforms"] = _region_to_platform_generator(query["regions"])
# 
#     if "region" in query and not isinstance(query["region"], Region):
#         query["region"] = Region(query["region"])


from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator
from datapipelines import (
    DataSource,
    PipelineContext,
    Query,
    NotFoundError,
    validate_query,
)
from .common import KernelSource, APINotFoundError
from ...data import Platform
from ...dto.thirdpartycode import VerificationStringDto
from ..uniquekeys import convert_region_to_platform
        pass

    @DataSource.dispatch
    def get_many(
        self,
        type: Type[T],
        query: MutableMapping[str, Any],
        context: PipelineContext = None,
    ) -> Iterable[T]:
        pass

    #######################
    # Verification String #
    #######################

    _validate_get_verification_string_query = (
        Query.has("platform").as_(Platform).also.has("summoner.id").as_(str)
    )

    @get.register(VerificationStringDto)
    @validate_query(_validate_get_verification_string_query, convert_region_to_platform)
    def get_verification_string(
        self, query: MutableMapping[str, Any], context: PipelineContext = None
    ) -> VerificationStringDto:
        parameters = {"platform": query["platform"].value}
        endpoint = "lol/platform/v4/third-party-code/by-summoner/{summonerId}".format(
            summonerId=query["summoner.id"]
        )
        try:
            data = self._get(endpoint=endpoint, parameters=parameters)

# Path: cassiopeia/datastores/kernel/common.py
# def _get_latest_version(
#     query: MutableMapping[str, Any], context: PipelineContext
# ) -> str:
# def _get_default_locale(
#     query: MutableMapping[str, Any], context: PipelineContext
# ) -> str:
#     def __init__(self, server_url: str, port: int, http_client: HTTPClient = None):
#     def _get(
#         self,
#         endpoint: str,
#         parameters: MutableMapping[str, Any] = None,
#         connection: Curl = None,
#     ) -> Union[dict, list, Any]:
#     def get(
#         self,
#         type: Type[T],
#         query: MutableMapping[str, Any],
#         context: PipelineContext = None,
#     ) -> T:
#     def get_many(
#         self,
#         type: Type[T],
#         query: MutableMapping[str, Any],
#         context: PipelineContext = None,
#     ) -> Iterable[T]:
# T = TypeVar("T")
# class KernelSource(DataSource):
# 
# Path: cassiopeia/data.py
# class Platform(Enum):
#     brazil = "BR1"
#     europe_north_east = "EUN1"
#     europe_west = "EUW1"
#     japan = "JP1"
#     korea = "KR"
#     latin_america_north = "LA1"
#     latin_america_south = "LA2"
#     north_america = "NA1"
#     oceania = "OC1"
#     turkey = "TR1"
#     russia = "RU"
# 
#     @property
#     def region(self) -> "Region":
#         return getattr(Region, self.name)
# 
#     @property
#     def default_locale(self) -> str:
#         return DEFAULT_LOCALE[self]
# 
#     @staticmethod
#     def from_region(region):
#         try:
#             return region.platform
#         except AttributeError:
#             return Region(region).platform
# 
#     @property
#     def continent(self):
#         return self.region.continent
# 
# Path: cassiopeia/datastores/uniquekeys.py
# def convert_region_to_platform(query: MutableMapping[str, Any]) -> None:
#     if "region" in query and "platform" not in query:
#         try:
#             query["platform"] = Region(query["region"]).platform
#         except ValueError as e:
#             raise QueryValidationError from e
# 
#     if "regions" in query and "platforms" not in query:
#         query["platforms"] = _region_to_platform_generator(query["regions"])
# 
#     if "region" in query and not isinstance(query["region"], Region):
#         query["region"] = Region(query["region"])


# Path: cassiopeia/datastores/kernel/thirdpartycode.py
from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator
from datapipelines import (
    DataSource,
    PipelineContext,
    Query,
    NotFoundError,
    validate_query,
)
from .common import KernelSource, APINotFoundError
from ...data import Platform
from ...dto.thirdpartycode import VerificationStringDto
from ..uniquekeys import convert_region_to_platform

        pass

    @DataSource.dispatch
    def get_many(
        self,
        type: Type[T],
        query: MutableMapping[str, Any],
        context: PipelineContext = None,
    ) -> Iterable[T]:
        pass

    #######################
    # Verification String #
    #######################

    _validate_get_verification_string_query = (
        Query.has("platform").as_(Platform).also.has("summoner.id").as_(str)
    )

    @get.register(VerificationStringDto)
    @validate_query(_validate_get_verification_string_query, convert_region_to_platform)
    def get_verification_string(
        self, query: MutableMapping[str, Any], context: PipelineContext = None
    ) -> VerificationStringDto:
        parameters = {"platform": query["platform"].value}
        endpoint = "lol/platform/v4/third-party-code/by-summoner/{summonerId}".format(
            summonerId=query["summoner.id"]
        )
        try:
            data = self._get(endpoint=endpoint, parameters=parameters)

        except (ValueError, APINotFoundError) as error: