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

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import ConnectionStateEnum


class GetAndLockResources(BaseModel):
    get_and_lock_resources: Optional["GetAndLockResourcesGetAndLockResources"] = Field(
        alias="getAndLockResources"
    )


class GetAndLockResourcesGetAndLockResources(BaseModel):
    devices: Optional[List[Optional["GetAndLockResourcesGetAndLockResourcesDevices"]]]
    device_groups: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesDeviceGroups"]]
    ] = Field(alias="deviceGroups")
    interfaces: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesInterfaces"]]
    ]
    device_group_queries: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesDeviceGroupQueries"]]
    ] = Field(alias="deviceGroupQueries")
    device_queries: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesDeviceQueries"]]
    ] = Field(alias="deviceQueries")
    interface_queries: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesInterfaceQueries"]]
    ] = Field(alias="interfaceQueries")
    lock: Optional["GetAndLockResourcesGetAndLockResourcesLock"]
    lock_already_existed: Optional[bool] = Field(alias="lockAlreadyExisted")


class GetAndLockResourcesGetAndLockResourcesDevices(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")
    facts: Optional[Any]
    software_release: Optional[str] = Field(alias="softwareRelease")
    platform: Optional["GetAndLockResourcesGetAndLockResourcesDevicesPlatform"]
    vendor: Optional[str]
    model: Optional[str]
    serial: Optional[str]
    username: Optional[str]
    current_configuration: Optional[str] = Field(alias="currentConfiguration")
    groups: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesDevicesGroups"]]
    ]
    group_count: Optional[int] = Field(alias="groupCount")
    checks: Optional[Any]
    interfaces: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesDevicesInterfaces"]]
    ]
    interface_count: Optional[int] = Field(alias="interfaceCount")


class GetAndLockResourcesGetAndLockResourcesDevicesPlatform(BaseModel):
    id: str
    name: Optional[str]
    short_name: Optional[str] = Field(alias="shortName")


class GetAndLockResourcesGetAndLockResourcesDevicesGroups(BaseModel):
    id: str


class GetAndLockResourcesGetAndLockResourcesDevicesInterfaces(BaseModel):
    id: str


class GetAndLockResourcesGetAndLockResourcesDeviceGroups(BaseModel):
    id: str
    name: Optional[str]
    devices: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesDeviceGroupsDevices"]]
    ]
    title: Optional[str]
    description: Optional[str]
    location: Optional["GetAndLockResourcesGetAndLockResourcesDeviceGroupsLocation"]
    device_count: Optional[int] = Field(alias="deviceCount")
    checks: Optional[Any]
    facts: Optional[Any]


class GetAndLockResourcesGetAndLockResourcesDeviceGroupsDevices(BaseModel):
    id: str


class GetAndLockResourcesGetAndLockResourcesDeviceGroupsLocation(BaseModel):
    id: str
    address: Optional[str]
    city: Optional[str]
    lon: Optional[float]
    lat: Optional[float]


class GetAndLockResourcesGetAndLockResourcesInterfaces(BaseModel):
    id: str
    name: Optional[str]
    description: Optional[str]
    facts: Optional[Any]
    checks: Optional[Any]
    client_count: Optional[int] = Field(alias="clientCount")
    created_at: Optional[Any] = Field(alias="createdAt")
    updated_at: Optional[Any] = Field(alias="updatedAt")


class GetAndLockResourcesGetAndLockResourcesDeviceGroupQueries(BaseModel):
    query: str
    ids: List[Optional[int]]


class GetAndLockResourcesGetAndLockResourcesDeviceQueries(BaseModel):
    query: str
    ids: List[Optional[int]]


class GetAndLockResourcesGetAndLockResourcesInterfaceQueries(BaseModel):
    query: str
    ids: List[Optional[int]]


class GetAndLockResourcesGetAndLockResourcesLock(BaseModel):
    id: str
    owner: Optional[str]
    reference: Optional[str]
    expires_at: Optional[Any] = Field(alias="expiresAt")
    created_at: Optional[Any] = Field(alias="createdAt")
    updated_at: Optional[Any] = Field(alias="updatedAt")


GetAndLockResources.model_rebuild()
GetAndLockResourcesGetAndLockResources.model_rebuild()
GetAndLockResourcesGetAndLockResourcesDevices.model_rebuild()
GetAndLockResourcesGetAndLockResourcesDeviceGroups.model_rebuild()
