# generated by datamodel-codegen:
#   filename:  cloud.json
#   timestamp: 2022-10-02T03:48:01+00:00

# NOT Used just tinkering as I determine how best to re-factor / structure things

from __future__ import annotations
from pathlib import Path

from typing import Any, List, Mapping, Union

from pydantic import BaseModel


class SerialConfig(BaseModel):
    baud: int
    cmd: str
    dbits: int
    flow: str
    line: str
    log_ptr: Any
    logfile: Any
    parity: str
    port: int
    sbits: int


class Udev(BaseModel):
    devname: Path
    devpath: Path
    by_id: Path = None
    by_path: Path = None
    lame_devpath: str = None
    current_tags: str = None
    id_bus: str = None
    id_ifnum: str = None
    id_model: str = None
    id_model_from_database: str = None
    id_model_id: str = None
    id_path: str = None
    id_pci_class_from_database: str = None
    id_pci_subclass_from_database: str = None
    id_serial: str = None
    id_serial_short: str = None
    id_type: str = None
    id_usb_class_from_database: str = None
    id_usb_driver: str = None
    id_usb_interfaces: str = None
    id_usb_protocol_from_database: str = None
    id_vendor: str = None
    id_vendor_from_database: str = None
    id_vendor_id: str = None
    root_dev: bool = None
    subsystem: str = None
    time_since_init: str = None


class Adapter(BaseModel):
    config: SerialConfig
    outlets: List
    udev: Udev


class Interface(BaseModel):
    ip: str
    isgw: bool
    mac: str


class Remote(BaseModel):
    name: str
    adapters: Mapping[Path, Adapter]
    api_port: int
    cpuserial: str
    interfaces: Mapping[str, Union[Interface, str]]
    last_ip: str
    rem_ip: str = None
    source: str
    upd_time: int
    user: str
