# Generated by ariadne-codegen
# Source: ../graphql

from typing import List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import InterfaceStateEnum


class Topology(BaseModel):
    topology: Optional["TopologyTopology"]


class TopologyTopology(BaseModel):
    type: Optional[str]
    metric: Optional[str]
    version: Optional[str]
    protocol: Optional[str]
    nodes: Optional[List[Optional["TopologyTopologyNodes"]]]
    links: Optional[List[Optional["TopologyTopologyLinks"]]]


class TopologyTopologyNodes(BaseModel):
    id: Optional[str]
    label: Optional[str]
    properties: Optional["TopologyTopologyNodesProperties"]


class TopologyTopologyNodesProperties(BaseModel):
    device: Optional["TopologyTopologyNodesPropertiesDevice"]


class TopologyTopologyNodesPropertiesDevice(BaseModel):
    id: str
    hostname: Optional[str]
    ip: Optional[str]


class TopologyTopologyLinks(BaseModel):
    source: Optional[str]
    target: Optional[str]
    cost: Optional[int]
    properties: Optional["TopologyTopologyLinksProperties"]


class TopologyTopologyLinksProperties(BaseModel):
    source_interface: Optional["TopologyTopologyLinksPropertiesSourceInterface"] = (
        Field(alias="sourceInterface")
    )
    target_interface: Optional["TopologyTopologyLinksPropertiesTargetInterface"] = (
        Field(alias="targetInterface")
    )


class TopologyTopologyLinksPropertiesSourceInterface(BaseModel):
    id: str
    name: Optional[str]
    state: Optional[InterfaceStateEnum]


class TopologyTopologyLinksPropertiesTargetInterface(BaseModel):
    id: str
    name: Optional[str]
    state: Optional[InterfaceStateEnum]


Topology.model_rebuild()
TopologyTopology.model_rebuild()
TopologyTopologyNodes.model_rebuild()
TopologyTopologyNodesProperties.model_rebuild()
TopologyTopologyLinks.model_rebuild()
TopologyTopologyLinksProperties.model_rebuild()
