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

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel


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")
    lock: Optional["GetAndLockResourcesGetAndLockResourcesLock"]
    lock_already_existed: Optional[bool] = Field(alias="lockAlreadyExisted")


class GetAndLockResourcesGetAndLockResourcesDevices(BaseModel):
    id: str
    hostname: Optional[str]
    connection_options: Optional[Any] = Field(alias="connectionOptions")
    ip: Optional[str]
    groups: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesDevicesGroups"]]
    ]
    platform: Optional["GetAndLockResourcesGetAndLockResourcesDevicesPlatform"]
    username: Optional[str]
    facts: Optional[Any]
    checks: Optional[Any]


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


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


class GetAndLockResourcesGetAndLockResourcesDeviceGroups(BaseModel):
    id: str
    name: Optional[str]
    devices: Optional[
        List[Optional["GetAndLockResourcesGetAndLockResourcesDeviceGroupsDevices"]]
    ]


class GetAndLockResourcesGetAndLockResourcesDeviceGroupsDevices(BaseModel):
    id: str
    hostname: Optional[str]
    connection_options: Optional[Any] = Field(alias="connectionOptions")
    ip: Optional[str]
    groups: Optional[
        List[
            Optional["GetAndLockResourcesGetAndLockResourcesDeviceGroupsDevicesGroups"]
        ]
    ]
    platform: Optional[
        "GetAndLockResourcesGetAndLockResourcesDeviceGroupsDevicesPlatform"
    ]
    username: Optional[str]
    facts: Optional[Any]
    checks: Optional[Any]


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


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


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()
GetAndLockResourcesGetAndLockResourcesDeviceGroupsDevices.model_rebuild()
