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

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import CheckResultEnum, ConnectionStateEnum, InterfaceStateEnum


class Devices(BaseModel):
    devices_elastic: Optional["DevicesDevicesElastic"] = Field(alias="devicesElastic")


class DevicesDevicesElastic(BaseModel):
    total_count: Optional[int] = Field(alias="totalCount")
    results: Optional[List[Optional["DevicesDevicesElasticResults"]]]


class DevicesDevicesElasticResults(BaseModel):
    id: str
    created_at: Optional[Any] = Field(alias="createdAt")
    updated_at: Optional[Any] = Field(alias="updatedAt")
    hostname: Optional[str]
    ip: Optional[str]
    connection_state: Optional[ConnectionStateEnum] = Field(alias="connectionState")
    connection_options: Optional[Any] = Field(alias="connectionOptions")
    facts: Optional[Any]
    software_release: Optional[str] = Field(alias="softwareRelease")
    platform: Optional["DevicesDevicesElasticResultsPlatform"]
    vendor: Optional[str]
    model: Optional[str]
    serial: Optional[str]
    username: Optional[str]
    current_configuration: Optional[str] = Field(alias="currentConfiguration")
    groups: Optional[List[Optional["DevicesDevicesElasticResultsGroups"]]]
    interfaces: Optional[List[Optional["DevicesDevicesElasticResultsInterfaces"]]]
    permission: Optional[int]
    checks: Optional[Any]
    check_elements: Optional[
        List[Optional["DevicesDevicesElasticResultsCheckElements"]]
    ] = Field(alias="checkElements")


class DevicesDevicesElasticResultsPlatform(BaseModel):
    id: str
    name: Optional[str]


class DevicesDevicesElasticResultsGroups(BaseModel):
    id: str
    name: Optional[str]
    title: Optional[str]
    description: Optional[str]
    location: Optional["DevicesDevicesElasticResultsGroupsLocation"]


class DevicesDevicesElasticResultsGroupsLocation(BaseModel):
    id: str
    address: Optional[str]
    name: Optional[str]
    city: Optional[str]
    zip_code: Optional[str] = Field(alias="zipCode")
    lon: Optional[float]
    lat: Optional[float]


class DevicesDevicesElasticResultsInterfaces(BaseModel):
    id: str
    name: Optional[str]
    ifindex: Optional[int]
    description: Optional[str]
    state: Optional[InterfaceStateEnum]
    interface: Optional["DevicesDevicesElasticResultsInterfacesInterface"]


class DevicesDevicesElasticResultsInterfacesInterface(BaseModel):
    id: str


class DevicesDevicesElasticResultsCheckElements(BaseModel):
    id: str
    key: Optional[str]
    reason: Optional[str]
    result: Optional[CheckResultEnum]
    metrics: Optional[Any]
    neops_task: Optional["DevicesDevicesElasticResultsCheckElementsNeopsTask"] = Field(
        alias="neopsTask"
    )


class DevicesDevicesElasticResultsCheckElementsNeopsTask(BaseModel):
    id: str
    name: Optional[str]
