# Path: cassiopeia/core/status.py
# class ShardStatusData(CoreData):
#     _renamed = {"region_tag": "platform"}
# 
#     def __call__(self, **kwargs):
#         if "services" in kwargs:
#             self.services = [
#                 ServiceData(**service) for service in kwargs.pop("services")
#             ]
#         super().__call__(**kwargs)
#         return self
# 
# class ShardStatus(CassiopeiaGhost):
#     _data_types = {ShardStatusData}
# 
#     def __init__(self, region: Union[Region, str] = None):
#         kwargs = {"region": region}
#         super().__init__(**kwargs)
# 
#     def __get_query__(self):
#         return {"region": self.region, "platform": self.platform}
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     @lazy
#     def region(self) -> Region:
#         return Region(self._data[ShardStatusData].region)
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     @lazy
#     def platform(self) -> Platform:
#         return self.region.platform
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def name(self) -> str:
#         return self._data[ShardStatusData].name
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def hostname(self) -> str:
#         return self._data[ShardStatusData].hostname
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def services(self) -> List[Service]:
#         return SearchableList(
#             [
#                 Service.from_data(service)
#                 for service in self._data[ShardStatusData].services
#             ]
#         )
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def slug(self) -> str:
#         return self._data[ShardStatusData].slug
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def locales(self) -> List[str]:
#         return self._data[ShardStatusData].locales


from typing import Type, TypeVar
from datapipelines import DataTransformer, PipelineContext
from ..core.status import ShardStatusData, ShardStatus
from ..dto.status import ShardStatusDto



T = TypeVar("T")
F = TypeVar("F")


class StatusTransformer(DataTransformer):
    @DataTransformer.dispatch
    def transform(
        self, target_type: Type[T], value: F, context: PipelineContext = None
    ) -> T:
        pass

    # Dto to Data

    @transform.register(ShardStatusDto, ShardStatusData)
    def shard_status_dto_to_data(
        self, value: ShardStatusDto, context: PipelineContext = None
    ) -> ShardStatusData:
        return ShardStatusData(**value)

    # Data to Core

    # @transform.register(ShardStatusData, ShardStatus)
    def shard_status_data_to_core(
        self, value: ShardStatusData, context: PipelineContext = None

# Path: cassiopeia/core/status.py
# class ShardStatusData(CoreData):
#     _renamed = {"region_tag": "platform"}
# 
#     def __call__(self, **kwargs):
#         if "services" in kwargs:
#             self.services = [
#                 ServiceData(**service) for service in kwargs.pop("services")
#             ]
#         super().__call__(**kwargs)
#         return self
# 
# class ShardStatus(CassiopeiaGhost):
#     _data_types = {ShardStatusData}
# 
#     def __init__(self, region: Union[Region, str] = None):
#         kwargs = {"region": region}
#         super().__init__(**kwargs)
# 
#     def __get_query__(self):
#         return {"region": self.region, "platform": self.platform}
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     @lazy
#     def region(self) -> Region:
#         return Region(self._data[ShardStatusData].region)
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     @lazy
#     def platform(self) -> Platform:
#         return self.region.platform
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def name(self) -> str:
#         return self._data[ShardStatusData].name
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def hostname(self) -> str:
#         return self._data[ShardStatusData].hostname
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def services(self) -> List[Service]:
#         return SearchableList(
#             [
#                 Service.from_data(service)
#                 for service in self._data[ShardStatusData].services
#             ]
#         )
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def slug(self) -> str:
#         return self._data[ShardStatusData].slug
# 
#     @CassiopeiaGhost.property(ShardStatusData)
#     @ghost_load_on
#     def locales(self) -> List[str]:
#         return self._data[ShardStatusData].locales


# Path: cassiopeia/transformers/status.py
from typing import Type, TypeVar
from datapipelines import DataTransformer, PipelineContext
from ..core.status import ShardStatusData, ShardStatus
from ..dto.status import ShardStatusDto




T = TypeVar("T")
F = TypeVar("F")


class StatusTransformer(DataTransformer):
    @DataTransformer.dispatch
    def transform(
        self, target_type: Type[T], value: F, context: PipelineContext = None
    ) -> T:
        pass

    # Dto to Data

    @transform.register(ShardStatusDto, ShardStatusData)
    def shard_status_dto_to_data(
        self, value: ShardStatusDto, context: PipelineContext = None
    ) -> ShardStatusData:
        return ShardStatusData(**value)

    # Data to Core

    # @transform.register(ShardStatusData, ShardStatus)
    def shard_status_data_to_core(
        self, value: ShardStatusData, context: PipelineContext = None

    ) -> ShardStatus: