# 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, InterfaceStateEnum


class Interfaces(BaseModel):
    interfaces_elastic: Optional["InterfacesInterfacesElastic"] = Field(
        alias="interfacesElastic"
    )


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


class InterfacesInterfacesElasticResults(BaseModel):
    id: str
    created_at: Optional[Any] = Field(alias="createdAt")
    updated_at: Optional[Any] = Field(alias="updatedAt")
    name: Optional[str]
    description: Optional[str]
    state: Optional[InterfaceStateEnum]
    facts: Optional[Any]
    current_configuration: Optional[str] = Field(alias="currentConfiguration")
    interface: Optional["InterfacesInterfacesElasticResultsInterface"]
    device: Optional["InterfacesInterfacesElasticResultsDevice"]
    permission: Optional[int]
    checks: Optional[Any]
    clients: Optional[List[Optional["InterfacesInterfacesElasticResultsClients"]]]
    check_elements: Optional[
        List[Optional["InterfacesInterfacesElasticResultsCheckElements"]]
    ] = Field(alias="checkElements")


class InterfacesInterfacesElasticResultsInterface(BaseModel):
    id: str


class InterfacesInterfacesElasticResultsDevice(BaseModel):
    id: str
    hostname: Optional[str]
    model: Optional[str]
    ip: Optional[str]
    facts: Optional[Any]
    platform: Optional["InterfacesInterfacesElasticResultsDevicePlatform"]
    groups: Optional[List[Optional["InterfacesInterfacesElasticResultsDeviceGroups"]]]


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


class InterfacesInterfacesElasticResultsDeviceGroups(BaseModel):
    id: str
    location: Optional["InterfacesInterfacesElasticResultsDeviceGroupsLocation"]


class InterfacesInterfacesElasticResultsDeviceGroupsLocation(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 InterfacesInterfacesElasticResultsClients(BaseModel):
    id: str


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


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