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

from typing import List, Optional

from pydantic import Field

from .base_model import BaseModel


class RolePermissions(BaseModel):
    role_permission: Optional["RolePermissionsRolePermission"] = Field(
        alias="rolePermission"
    )


class RolePermissionsRolePermission(BaseModel):
    results: Optional[List[Optional["RolePermissionsRolePermissionResults"]]]


class RolePermissionsRolePermissionResults(BaseModel):
    id: str
    name: Optional[str]
    default_permission: Optional[int] = Field(alias="defaultPermission")
    default_permission_flags: Optional[List[Optional[str]]] = Field(
        alias="defaultPermissionFlags"
    )
    permission_all_flags: Optional[List[Optional[str]]] = Field(
        alias="permissionAllFlags"
    )
    permission_element_permissions_all: Optional[
        List[
            Optional[
                "RolePermissionsRolePermissionResultsPermissionElementPermissionsAll"
            ]
        ]
    ] = Field(alias="permissionElementPermissionsAll")
    device_group_permissions_all: Optional[
        List[Optional["RolePermissionsRolePermissionResultsDeviceGroupPermissionsAll"]]
    ] = Field(alias="deviceGroupPermissionsAll")
    neops_task_permissions_all: Optional[
        List[Optional["RolePermissionsRolePermissionResultsNeopsTaskPermissionsAll"]]
    ] = Field(alias="neopsTaskPermissionsAll")
    scope_permissions_all: Optional[
        List[Optional["RolePermissionsRolePermissionResultsScopePermissionsAll"]]
    ] = Field(alias="scopePermissionsAll")
    users: Optional[List[Optional["RolePermissionsRolePermissionResultsUsers"]]]


class RolePermissionsRolePermissionResultsPermissionElementPermissionsAll(BaseModel):
    permission_flags: Optional[List[Optional[str]]] = Field(alias="permissionFlags")
    permission_all_flags: Optional[List[Optional[str]]] = Field(
        alias="permissionAllFlags"
    )
    permission_element: Optional[
        "RolePermissionsRolePermissionResultsPermissionElementPermissionsAllPermissionElement"
    ] = Field(alias="permissionElement")
    role: Optional[
        "RolePermissionsRolePermissionResultsPermissionElementPermissionsAllRole"
    ]


class RolePermissionsRolePermissionResultsPermissionElementPermissionsAllPermissionElement(
    BaseModel
):
    id: str
    name: Optional[str]
    description: Optional[str]


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


class RolePermissionsRolePermissionResultsDeviceGroupPermissionsAll(BaseModel):
    permission_flags: Optional[List[Optional[str]]] = Field(alias="permissionFlags")
    permission_all_flags: Optional[List[Optional[str]]] = Field(
        alias="permissionAllFlags"
    )
    role: Optional["RolePermissionsRolePermissionResultsDeviceGroupPermissionsAllRole"]
    device_group: Optional[
        "RolePermissionsRolePermissionResultsDeviceGroupPermissionsAllDeviceGroup"
    ] = Field(alias="deviceGroup")


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


class RolePermissionsRolePermissionResultsDeviceGroupPermissionsAllDeviceGroup(
    BaseModel
):
    id: str
    name: Optional[str]
    description: Optional[str]


class RolePermissionsRolePermissionResultsNeopsTaskPermissionsAll(BaseModel):
    permission_flags: Optional[List[Optional[str]]] = Field(alias="permissionFlags")
    permission_all_flags: Optional[List[Optional[str]]] = Field(
        alias="permissionAllFlags"
    )
    role: Optional["RolePermissionsRolePermissionResultsNeopsTaskPermissionsAllRole"]
    neops_task: Optional[
        "RolePermissionsRolePermissionResultsNeopsTaskPermissionsAllNeopsTask"
    ] = Field(alias="neopsTask")


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


class RolePermissionsRolePermissionResultsNeopsTaskPermissionsAllNeopsTask(BaseModel):
    id: str
    name: Optional[str]
    description: Optional[str]


class RolePermissionsRolePermissionResultsScopePermissionsAll(BaseModel):
    permission_flags: Optional[List[Optional[str]]] = Field(alias="permissionFlags")
    permission_all_flags: Optional[List[Optional[str]]] = Field(
        alias="permissionAllFlags"
    )
    role: Optional["RolePermissionsRolePermissionResultsScopePermissionsAllRole"]
    scope: Optional["RolePermissionsRolePermissionResultsScopePermissionsAllScope"]


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


class RolePermissionsRolePermissionResultsScopePermissionsAllScope(BaseModel):
    id: str
    name: Optional[str]
    description: Optional[str]


class RolePermissionsRolePermissionResultsUsers(BaseModel):
    id: str
    username: Optional[str]
    last_name: Optional[str] = Field(alias="lastName")
    first_name: Optional[str] = Field(alias="firstName")
    email: Optional[str]


RolePermissions.model_rebuild()
RolePermissionsRolePermission.model_rebuild()
RolePermissionsRolePermissionResults.model_rebuild()
RolePermissionsRolePermissionResultsPermissionElementPermissionsAll.model_rebuild()
RolePermissionsRolePermissionResultsDeviceGroupPermissionsAll.model_rebuild()
RolePermissionsRolePermissionResultsNeopsTaskPermissionsAll.model_rebuild()
RolePermissionsRolePermissionResultsScopePermissionsAll.model_rebuild()
