from dataclasses import dataclass
from typing import NamedTuple

from ..enums import VirtualMachineRole


class NetlabHost(NamedTuple):
    vh_id: int
    vh_name: str

    def __str__(self) -> str:
        return f"{self.vh_name}/{self.vh_id}"


@dataclass
class ExistingPod:
    pod_id: int
    current_name: str
    current_role: VirtualMachineRole | None
    current_host: NetlabHost | None
    current_pod_type: str

    pt_apdid: str
    pt_org: str

    def get_host(self) -> NetlabHost | None:
        return self.current_host

    def get_name(self) -> str:
        return self.current_name

    def get_role(self) -> VirtualMachineRole | None:
        return self.current_role

    def get_pod_type(self) -> str:
        return self.current_pod_type
