# flake8: noqa
# generated by datamodel-codegen:
#   filename:  openapi.json
#   source_sha256: 104f5c4a9dc36af86123e4fd81951d9eb7a9a490b5d30147180b175a98f21eaf

from __future__ import annotations

from datetime import datetime, timedelta
from enum import Enum
from typing import Any
from uuid import UUID

from pydantic import AnyUrl, BaseModel, EmailStr, Field


class ActionExecution(BaseModel):
    id: UUID = Field(..., title="Id")
    started: datetime = Field(..., title="Started")
    runtime: timedelta | None = Field(default=None, title="Runtime")


class ActionStats(BaseModel):
    executions: int = Field(..., title="Executions")
    last_run: datetime | None = Field(default=None, title="Last Run")


class TaskAgentPopulating(BaseModel):
    id: UUID = Field(..., title="Id")
    agent_id: UUID = Field(..., title="Agent Id")


class TaskAnnotator(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    org_id: UUID = Field(..., title="Org Id")
    org_name: str = Field(..., title="Org Name")
    person_id: UUID = Field(..., title="Person Id")
    email: str = Field(..., title="Email")
    avatar_url: str = Field(..., title="Avatar Url")
    locale: str = Field(..., title="Locale")
    is_org_admin: bool = Field(..., title="Is Org Admin")
    is_org_developer: bool = Field(..., title="Is Org Developer")
    groups: list[str] = Field(..., title="Groups")
    tags: list[str] = Field(..., title="Tags")
    annotations: int = Field(..., title="Annotations")
    live_sessions: int = Field(..., title="Live Sessions")
    sessions: int = Field(..., title="Sessions")
    hours: str = Field(..., title="Hours")
    is_added: bool = Field(..., title="Is Added")


class UserAuthenticated(BaseModel):
    access_token: str = Field(..., title="Access Token")
    expires_in: int = Field(..., title="Expires In")
    token_type: str | None = Field(default="bearer", title="Token Type")


class ResourceType(Enum):
    Project = "Project"
    Task = "Task"
    Action = "Action"
    Agent = "Agent"
    Broker = "Broker"


class BrokerToken(BaseModel):
    broker_id: UUID = Field(..., title="Broker Id")
    user_id: UUID = Field(..., title="User Id")
    access_token: str = Field(..., title="Access Token")


class CackQuerying(BaseModel):
    source: str = Field(..., title="Source")
    required: bool = Field(..., title="Required")
    fields: list[str] | None = Field(default=None, title="Fields")
    filters: dict[str, Any] | None = Field(default={}, title="Filters")
    predicates: list[dict[str, Any]] | None = Field(default=[], title="Predicates")
    relations: list[CackQuerying] | None = Field(
        default_factory=list, title="Relations"
    )
    key: str | None = Field(default="", title="Key")
    return_list: bool | None = Field(default=None, title="Return List")
    slice_start: int | None = Field(default=None, title="Slice Start")
    slice_stop: int | None = Field(default=None, title="Slice Stop")
    slice_step: int | None = Field(default=None, title="Slice Step")


class ClusterEventIndex(BaseModel):
    index: int = Field(..., title="Index")


class ClusterJobsIds(BaseModel):
    jobs_ids: list[UUID] = Field(..., title="Jobs Ids")


class BrokerCredentials(BaseModel):
    broker_id: UUID = Field(..., title="Broker Id")
    prodigy_license_key: str = Field(..., title="Prodigy License Key")
    container_sa_key: str = Field(..., title="Container Sa Key")
    public_key: str = Field(..., title="Public Key")


class DeviceCodeRequest(BaseModel):
    scope: str | None = Field(default="openid email profile", title="Scope")


class DeviceTokenRequest(BaseModel):
    device_code: str = Field(..., title="Device Code")
    grant_type: str | None = Field(
        default="urn:ietf:params:oauth:grant-type:device_code", title="Grant Type"
    )


class EmailReturning(BaseModel):
    email: str = Field(..., title="Email")
    status: str = Field(..., title="Status")
    reject_reason: str | None = Field(default=None, title="Reject Reason")
    queued_reason: str | None = Field(default=None, title="Queued Reason")


class EmptyResponse(BaseModel):
    pass


class ClusterEventGetIndex(BaseModel):
    latest_index: int = Field(..., title="Latest Index")


class InvitationSending(BaseModel):
    id: UUID = Field(..., title="Id")


class InviteTaskUser(BaseModel):
    task_id: str = Field(..., title="Task Id")
    user_id: str = Field(..., title="User Id")
    notes: str | None = Field(default=None, title="Notes")


class JobType(Enum):
    task = "task"
    action = "action"
    agent = "agent"


class MetricsCreating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str = Field(..., title="Name")
    job_id: UUID = Field(..., title="Job Id")
    execution_id: UUID = Field(..., title="Execution Id")
    metrics_schema: dict[str, Any] = Field(..., title="Metrics Schema")


class MetricsLogging(BaseModel):
    timestamp: datetime = Field(..., title="Timestamp")
    id: UUID = Field(..., title="Id")
    value: int | float | str | bool = Field(..., title="Value")
    final: bool = Field(..., title="Final")


class ObjectValidation(BaseModel):
    errors: dict[str, list[str]] = Field(..., title="Errors")
    existing: dict[str, list[str]] = Field(..., title="Existing")
    to_create: dict[str, list[str]] = Field(..., title="To Create")


class OrgSetup(BaseModel):
    name: str = Field(..., title="Name")
    admin_name: str | None = Field(default=None, title="Admin Name")
    admin_email: str | None = Field(default=None, title="Admin Email")
    project_name: str = Field(..., title="Project Name")
    project_description: str | None = Field(default=None, title="Project Description")


class PageTaskAnnotator(BaseModel):
    items: list[TaskAnnotator] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class ReportClusterJobResponse(BaseModel):
    missing: list[UUID] = Field(..., title="Missing")


class RoleName(Enum):
    admin = "admin"
    developer = "developer"
    annotator = "annotator"


class TokenExchangeRequest(BaseModel):
    audience: str | None = Field(default=None, title="Audience")


class SessionTokenReturning(BaseModel):
    session_id: UUID = Field(..., title="Session Id")
    user_id: UUID = Field(..., title="User Id")
    task_id: UUID = Field(..., title="Task Id")


class TypeSchemaInput(BaseModel):
    name: str = Field(..., title="Name")
    args: list[str | TypeSchemaInput] | None = Field(default=None, title="Args")
    object_type: str | None = Field(default=None, title="Object Type")


class TypeSchemaOutput(BaseModel):
    name: str = Field(..., title="Name")
    args: list[str | TypeSchemaOutput] | None = Field(default=None, title="Args")
    object_type: str | None = Field(default=None, title="Object Type")


class ValidationError(BaseModel):
    loc: list[str | int] = Field(..., title="Location")
    msg: str = Field(..., title="Message")
    type: str = Field(..., title="Error Type")
    input: Any | None = Field(default=None, title="Input")
    ctx: dict[str, Any] | None = Field(default=None, title="Context")


class ValidationLevel(Enum):
    error = "error"
    warning = "warning"
    info = "info"
    success = "success"


class ValidationOp(Enum):
    ge = "ge"
    gt = "gt"
    le = "le"
    lt = "lt"
    eq = "eq"
    ne = "ne"
    re = "re"


class ValidationSchema(BaseModel):
    op: ValidationOp
    value: int | float | str | bool = Field(..., title="Value")
    message: str = Field(..., title="Message")
    level: ValidationLevel


class VersionInfo(BaseModel):
    service: str = Field(..., title="Service")
    package_version: str = Field(..., title="Package Version")
    repo_sha: str = Field(..., title="Repo Sha")
    service_sha: str = Field(..., title="Service Sha")
    container_sha: str = Field(..., title="Container Sha")
    build_date: str = Field(..., title="Build Date")


class ActionDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class ActionReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")
    project_id: UUID | None = Field(default=None, title="Project Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")


class ActionUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")


class AgentDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class AgentReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")
    project_id: UUID | None = Field(default=None, title="Project Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")


class AgentUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")


class AssetCreating(BaseModel):
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    version: str = Field(..., title="Version")
    path: str = Field(..., title="Path")
    kind: str = Field(..., title="Kind")
    meta: dict[str, Any] = Field(..., title="Meta")


class AssetDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class AssetListingLatest(BaseModel):
    org_id: UUID | None = Field(default=None, title="Org Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")


class AssetReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")
    name: str | None = Field(default=None, title="Name")
    version: str | None = Field(default=None, title="Version")
    kind: str | None = Field(default=None, title="Kind")
    path: str | None = Field(default=None, title="Path")


class AssetReadingLatest(BaseModel):
    name: str = Field(..., title="Name")
    broker_id: UUID = Field(..., title="Broker Id")


class AssetSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    version: str = Field(..., title="Version")
    kind: str = Field(..., title="Kind")
    path: str = Field(..., title="Path")
    meta: dict[str, Any] = Field(..., title="Meta")
    num_used_by: int = Field(..., title="Num Used By")


class AssetUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")
    version: str | None = Field(default=None, title="Version")
    kind: str | None = Field(default=None, title="Kind")
    path: str | None = Field(default=None, title="Path")
    meta: dict[str, Any] | None = Field(default=None, title="Meta")


class BrokerCreating(BaseModel):
    org_id: UUID = Field(..., title="Org Id")
    name: str = Field(..., title="Name")
    cloud_provider: str = Field(..., title="Cloud Provider")
    address: AnyUrl = Field(..., title="Address")
    state: str | None = Field(default="creating", title="State")
    public_key: str | None = Field(default=None, title="Public Key")
    cloud: dict[str, Any] | None = Field(default=None, title="Cloud")


class BrokerDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class BrokerDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    org_id: UUID = Field(..., title="Org Id")
    name: str = Field(..., title="Name")
    address: str = Field(..., title="Address")
    state: str = Field(..., title="State")
    cloud: dict[str, Any] | None = Field(..., title="Cloud")


class BrokerReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    org_id: UUID | None = Field(default=None, title="Org Id")
    address: str | None = Field(default=None, title="Address")


class BrokerSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    org_id: UUID = Field(..., title="Org Id")
    name: str = Field(..., title="Name")
    address: str = Field(..., title="Address")
    state: str = Field(..., title="State")


class BrokerUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")
    public_key: str | None = Field(default=None, title="Public Key")
    address: str | None = Field(default=None, title="Address")
    cloud_provider: str | None = Field(default=None, title="Cloud Provider")
    state: str | None = Field(default=None, title="State")
    cloud: dict[str, Any] | None = Field(default=None, title="Cloud")


class BrokerPathCreating(BaseModel):
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    path: str = Field(..., title="Path")


class BrokerPathDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class BrokerPathDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    path: str = Field(..., title="Path")


class BrokerPathReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")
    name: str | None = Field(default=None, title="Name")
    path: str | None = Field(default=None, title="Path")


class BrokerPathSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    path: str = Field(..., title="Path")


class BrokerPathUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str = Field(..., title="Name")
    path: str = Field(..., title="Path")


class ClusterAttemptUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    pam_error: dict[str, Any] | None = Field(default=None, title="Pam Error")
    validation_error: dict[str, Any] | None = Field(
        default=None, title="Validation Error"
    )
    cluster_error: dict[str, Any] | None = Field(default=None, title="Cluster Error")
    cluster_change: dict[str, Any] | None = Field(default=None, title="Cluster Change")


class ClusterEventCreating(BaseModel):
    broker_id: UUID = Field(..., title="Broker Id")
    index: int = Field(..., title="Index")
    topic: str = Field(..., title="Topic")
    type: str = Field(..., title="Type")
    key: str = Field(..., title="Key")
    payload: dict[str, Any] = Field(..., title="Payload")
    filter_keys: list[str] | None = Field(default=[], title="Filter Keys")
    namespace: str | None = Field(default="", title="Namespace")


class ClusterEventDetail(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID | None = Field(default=None, title="Broker Id")
    action_id: UUID | None = Field(default=None, title="Action Id")
    task_id: UUID | None = Field(default=None, title="Task Id")
    index: int | None = Field(default=None, title="Index")
    topic: str | None = Field(default=None, title="Topic")
    type: str | None = Field(default=None, title="Type")
    key: str | None = Field(default=None, title="Key")
    namespace: str | None = Field(default=None, title="Namespace")
    payload: dict[str, Any] = Field(..., title="Payload")


class ClusterEventReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")
    action_id: UUID | None = Field(default=None, title="Action Id")
    task_id: UUID | None = Field(default=None, title="Task Id")
    index: int | None = Field(default=None, title="Index")
    topic: str | None = Field(default=None, title="Topic")
    type: str | None = Field(default=None, title="Type")
    key: str | None = Field(default=None, title="Key")
    namespace: str | None = Field(default=None, title="Namespace")


class DatasetCreating(BaseModel):
    name: str = Field(..., title="Name")
    broker_id: UUID = Field(..., title="Broker Id")
    kind: str = Field(..., title="Kind")


class DatasetDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class DatasetReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")
    kind: str | None = Field(default=None, title="Kind")
    broker_id: UUID | None = Field(default=None, title="Broker Id")


class DatasetSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    broker_id: UUID = Field(..., title="Broker Id")
    kind: str = Field(..., title="Kind")
    num_used_by: int = Field(..., title="Num Used By")


class DatasetUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")
    kind: str | None = Field(default=None, title="Kind")


class GroupCreating(BaseModel):
    name: str = Field(..., title="Name")
    org_id: UUID = Field(..., title="Org Id")


class GroupDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class GroupPopulating(BaseModel):
    id: UUID = Field(..., title="Id")
    user_id: UUID = Field(..., title="User Id")


class GroupReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")
    org_id: UUID | None = Field(default=None, title="Org Id")


class GroupSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    org_id: UUID = Field(..., title="Org Id")


class GroupUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")


class InvitationCreating(BaseModel):
    org_id: UUID | None = Field(default=None, title="Org Id")
    email: str = Field(..., title="Email")
    vars: dict[str, Any] | None = Field(default={}, title="Vars")


class InvitationDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class InvitationDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    org_id: UUID = Field(..., title="Org Id")
    email: str = Field(..., title="Email")
    claimed: bool = Field(..., title="Claimed")
    vars: dict[str, Any] = Field(..., title="Vars")


class InvitationReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    email: str | None = Field(default=None, title="Email")
    claimed: bool | None = Field(default=None, title="Claimed")


class InvitationSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    org_id: UUID = Field(..., title="Org Id")
    email: str = Field(..., title="Email")
    claimed: bool = Field(..., title="Claimed")
    vars: dict[str, Any] = Field(..., title="Vars")


class InvitationUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    claimed: bool | None = Field(default=None, title="Claimed")
    vars: dict[str, Any] | None = Field(default=None, title="Vars")


class NotificationCreating(BaseModel):
    user_id: UUID = Field(..., title="User Id")
    type: str = Field(..., title="Type")
    message: str = Field(..., title="Message")
    is_read: bool = Field(..., title="Is Read")
    details: dict[str, str | int | float | None] = Field(..., title="Details")


class NotificationDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class NotificationDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    user_id: UUID = Field(..., title="User Id")
    type: str = Field(..., title="Type")
    message: str = Field(..., title="Message")
    is_read: bool = Field(..., title="Is Read")
    details: dict[str, str | int | float | None] = Field(..., title="Details")


class NotificationReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    user_id: UUID | None = Field(default=None, title="User Id")
    is_read: bool | None = Field(default=None, title="Is Read")


class NotificationSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    user_id: UUID = Field(..., title="User Id")
    type: str = Field(..., title="Type")
    message: str = Field(..., title="Message")
    is_read: bool = Field(..., title="Is Read")
    details: dict[str, str | int | float | None] = Field(..., title="Details")


class NotificationUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    is_read: bool | None = Field(default=None, title="Is Read")
    message: str | None = Field(default=None, title="Message")
    details: dict[str, str | int | float | None] | None = Field(
        default=None, title="Details"
    )


class OrgCreating(BaseModel):
    name: str = Field(..., title="Name")


class OrgDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class OrgDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")


class OrgReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")


class OrgSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")


class OrgUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")


class PackageCreating(BaseModel):
    name: str = Field(..., title="Name")
    filename: str = Field(..., title="Filename")
    broker_id: UUID = Field(..., title="Broker Id")
    version: str = Field(..., title="Version")
    environment: str = Field(..., title="Environment")
    meta: dict[str, Any] | None = Field(default={}, title="Meta")


class PackageDeleting(BaseModel):
    id: UUID = Field(..., title="Id")
    force: bool | None = Field(default=False, title="Force")


class PackageListingLatest(BaseModel):
    org_id: UUID | None = Field(default=None, title="Org Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")


class PackageReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")
    filename: str | None = Field(default=None, title="Filename")
    org_id: UUID | None = Field(default=None, title="Org Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")
    version: str | None = Field(default=None, title="Version")


class PackageReadingLatest(BaseModel):
    name: str = Field(..., title="Name")
    broker_id: UUID = Field(..., title="Broker Id")


class PackageSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    version: str = Field(..., title="Version")
    environment: str = Field(..., title="Environment")
    num_used_by: int = Field(..., title="Num Used By")
    recipe_count: int = Field(..., title="Recipe Count")


class PackageUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    meta: dict[str, Any] | None = Field(default=None, title="Meta")


class PersonCreating(BaseModel):
    name: str = Field(..., title="Name")
    source: str = Field(..., title="Source")
    email: EmailStr = Field(..., title="Email")
    picture: str = Field(..., title="Picture")
    locale: str = Field(..., title="Locale")
    avatar_url: str = Field(..., title="Avatar Url")
    preferences: dict[str, Any] = Field(..., title="Preferences")


class PersonDeleting(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    email: str | None = Field(default=None, title="Email")


class PersonReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")
    source: str | None = Field(default=None, title="Source")
    email: str | None = Field(default=None, title="Email")
    verified: bool | None = Field(default=None, title="Verified")


class PersonSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    source: str = Field(..., title="Source")
    email: str = Field(..., title="Email")
    picture: str = Field(..., title="Picture")
    avatar_url: str = Field(..., title="Avatar Url")
    locale: str = Field(..., title="Locale")
    verified: bool = Field(..., title="Verified")
    preferences: dict[str, Any] = Field(..., title="Preferences")


class PersonUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")
    source: str | None = Field(default=None, title="Source")
    email: str | None = Field(default=None, title="Email")
    picture: str | None = Field(default=None, title="Picture")
    avatar_url: str | None = Field(default=None, title="Avatar Url")
    locale: str | None = Field(default=None, title="Locale")
    preferences: dict[str, Any] | None = Field(default=None, title="Preferences")
    verified: bool | None = Field(default=None, title="Verified")
    last_push_time: datetime | None = Field(default=None, title="Last Push Time")


class ProjectCreating(BaseModel):
    name: str = Field(..., min_length=3, title="Name")
    description: str = Field(..., title="Description")


class ProjectDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class ProjectDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    org_id: UUID = Field(..., title="Org Id")
    name: str = Field(..., title="Name")
    description: str = Field(..., title="Description")


class ProjectReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")
    org_id: UUID | None = Field(default=None, title="Org Id")


class ProjectStats(BaseModel):
    annotations: int = Field(..., title="Annotations")
    administrators: int = Field(..., title="Administrators")
    annotators: int = Field(..., title="Annotators")
    developers: int = Field(..., title="Developers")
    live_sessions: int = Field(..., title="Live Sessions")
    tasks_count: int = Field(..., title="Tasks Count")
    tasks_workers: dict[str, int] = Field(..., title="Tasks Workers")
    tasks_states: dict[str, int] = Field(..., title="Tasks States")
    actions_count: int = Field(..., title="Actions Count")
    actions_executions: int = Field(..., title="Actions Executions")
    actions_workers: dict[str, int] = Field(..., title="Actions Workers")
    actions_states: dict[str, int] = Field(..., title="Actions States")


class ProjectSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    org_id: UUID = Field(..., title="Org Id")
    name: str = Field(..., title="Name")
    description: str = Field(..., title="Description")


class ProjectUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")
    description: str | None = Field(default=None, title="Description")


class RecipeDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class RecipeListingLatest(BaseModel):
    org_id: UUID | None = Field(default=None, title="Org Id")
    broker_id: UUID | None = Field(default=None, title="Broker Id")


class RecipeReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    org_id: UUID | None = Field(default=None, title="Org Id")
    name: str | None = Field(default=None, title="Name")
    package_id: UUID | None = Field(default=None, title="Package Id")


class RecipeReadingLatest(BaseModel):
    name: str = Field(..., title="Name")
    broker_id: UUID = Field(..., title="Broker Id")


class RecipeSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    org_id: UUID = Field(..., title="Org Id")
    package_id: UUID = Field(..., title="Package Id")
    name: str = Field(..., title="Name")
    title: str | None = Field(..., title="Title")
    description: str | None = Field(..., title="Description")
    job_type: str = Field(..., title="Job Type")
    is_action: bool = Field(..., title="Is Action")
    is_latest: bool = Field(..., title="Is Latest")
    entry_point: str | None = Field(..., title="Entry Point")
    num_used_by: int = Field(..., title="Num Used By")


class RecipeUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    title: str = Field(..., title="Title")


class RecipePlanCreating(BaseModel):
    recipe_id: UUID = Field(..., title="Recipe Id")
    project_id: UUID = Field(..., title="Project Id")
    args: dict[str, Any] = Field(..., title="Args")
    worker_class: str | None = Field(default=None, title="Worker Class")


class RecipePlanDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class RecipePlanDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    project_id: UUID = Field(..., title="Project Id")
    project_name: str = Field(..., title="Project Name")
    recipe_id: UUID = Field(..., title="Recipe Id")
    recipe_name: str = Field(..., title="Recipe Name")
    recipe_title: str | None = Field(..., title="Recipe Title")
    recipe_description: str | None = Field(..., title="Recipe Description")
    package_id: UUID = Field(..., title="Package Id")
    package_name: str = Field(..., title="Package Name")
    package_version: str = Field(..., title="Package Version")
    environment: str = Field(..., title="Environment")
    worker_class: str | None = Field(default=None, title="Worker Class")
    args: dict[str, Any] = Field(..., title="Args")
    command: list[str] = Field(..., title="Command")
    positional_fields: list[str] = Field(..., title="Positional Fields")
    cli_names: dict[str, str] = Field(..., title="Cli Names")
    objects: dict[str, dict[str, dict[str, Any]]] = Field(..., title="Objects")


class RecipePlanReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    recipe_id: UUID | None = Field(default=None, title="Recipe Id")
    project_id: UUID | None = Field(default=None, title="Project Id")


class RecipePlanSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    project_id: UUID = Field(..., title="Project Id")
    project_name: str = Field(..., title="Project Name")
    recipe_id: UUID = Field(..., title="Recipe Id")
    recipe_name: str = Field(..., title="Recipe Name")
    recipe_title: str | None = Field(..., title="Recipe Title")
    recipe_description: str | None = Field(..., title="Recipe Description")
    package_id: UUID = Field(..., title="Package Id")
    package_name: str = Field(..., title="Package Name")
    package_version: str = Field(..., title="Package Version")
    environment: str = Field(..., title="Environment")
    worker_class: str | None = Field(default=None, title="Worker Class")


class RecipePlanUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    worker_class: str | None = Field(default=None, title="Worker Class")


class SecretCreating(BaseModel):
    name: str = Field(..., title="Name")
    path: str = Field(..., title="Path")
    broker_id: UUID = Field(..., title="Broker Id")


class SecretDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class SecretDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    path: str = Field(..., title="Path")
    broker_id: UUID = Field(..., title="Broker Id")


class SecretReading(BaseModel):
    name: str | None = Field(default=None, title="Name")
    path: str | None = Field(default=None, title="Path")
    broker_id: UUID | None = Field(default=None, title="Broker Id")


class SecretSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    path: str = Field(..., title="Path")
    broker_id: UUID = Field(..., title="Broker Id")


class SessionCreating(BaseModel):
    user_id: UUID = Field(..., title="User Id")
    task_id: UUID = Field(..., title="Task Id")


class SessionDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class SessionDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    user_id: UUID = Field(..., title="User Id")
    user_name: str = Field(..., title="User Name")
    user_avatar_url: str = Field(..., title="User Avatar Url")
    task_id: UUID = Field(..., title="Task Id")


class SessionReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    user_id: UUID | None = Field(default=None, title="User Id")
    task_id: UUID | None = Field(default=None, title="Task Id")


class SessionSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    user_id: UUID = Field(..., title="User Id")
    user_name: str = Field(..., title="User Name")
    user_avatar_url: str = Field(..., title="User Avatar Url")
    task_id: UUID = Field(..., title="Task Id")


class SessionUpdating(BaseModel):
    id: UUID = Field(..., title="Id")


class TaskCreating(BaseModel):
    name: str | None = Field(default=None, title="Name")
    project_id: UUID = Field(..., title="Project Id")
    plan: RecipePlanCreating


class TaskDeleting(BaseModel):
    id: UUID = Field(..., title="Id")


class TaskPopulating(BaseModel):
    id: UUID = Field(..., title="Id")
    user_id: UUID = Field(..., title="User Id")


class TaskReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    name: str | None = Field(default=None, title="Name")
    project_id: UUID | None = Field(default=None, title="Project Id")


class TaskStats(BaseModel):
    annotations: int = Field(..., title="Annotations")
    annotators: int = Field(..., title="Annotators")
    live_sessions: int = Field(..., title="Live Sessions")
    sessions: int = Field(..., title="Sessions")
    hours: str = Field(..., title="Hours")


class TaskSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    project_id: UUID = Field(..., title="Project Id")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    recipe_name: str = Field(..., title="Recipe Name")
    recipe_title: str = Field(..., title="Recipe Title")
    project_name: str = Field(..., title="Project Name")
    error: str | None = Field(default=None, title="Error")
    plan: RecipePlanSummary
    job_type: JobType
    cli_command: str = Field(..., title="Cli Command")


class TaskUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")


class UserCreating(BaseModel):
    org_id: UUID = Field(..., title="Org Id")
    person_id: UUID = Field(..., title="Person Id")
    is_org_admin: bool = Field(..., title="Is Org Admin")
    is_org_developer: bool = Field(..., title="Is Org Developer")
    tags: list[str] | None = Field(default=[], title="Tags")


class UserDeleting(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    org_id: UUID | None = Field(default=None, title="Org Id")
    person_id: UUID | None = Field(default=None, title="Person Id")


class UserDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    org_id: UUID = Field(..., title="Org Id")
    org_name: str = Field(..., title="Org Name")
    person_id: UUID = Field(..., title="Person Id")
    email: str = Field(..., title="Email")
    avatar_url: str = Field(..., title="Avatar Url")
    locale: str = Field(..., title="Locale")
    is_org_admin: bool = Field(..., title="Is Org Admin")
    is_org_developer: bool = Field(..., title="Is Org Developer")
    groups: list[str] = Field(..., title="Groups")
    tags: list[str] = Field(..., title="Tags")


class UserReading(BaseModel):
    id: UUID | None = Field(default=None, title="Id")
    org_id: UUID | None = Field(default=None, title="Org Id")
    person_id: UUID | None = Field(default=None, title="Person Id")
    is_org_admin: bool | None = Field(default=None, title="Is Org Admin")
    is_org_developer: bool | None = Field(default=None, title="Is Org Developer")


class UserSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    org_id: UUID = Field(..., title="Org Id")
    org_name: str = Field(..., title="Org Name")
    person_id: UUID = Field(..., title="Person Id")
    email: str = Field(..., title="Email")
    avatar_url: str = Field(..., title="Avatar Url")
    locale: str = Field(..., title="Locale")
    is_org_admin: bool = Field(..., title="Is Org Admin")
    is_org_developer: bool = Field(..., title="Is Org Developer")


class UserUpdating(BaseModel):
    id: UUID = Field(..., title="Id")
    name: str | None = Field(default=None, title="Name")
    email: str | None = Field(default=None, title="Email")
    avatar_url: str | None = Field(default=None, title="Avatar Url")
    locale: str | None = Field(default=None, title="Locale")
    tags: list[str] | None = Field(default=[], title="Tags")
    is_org_admin: bool | None = Field(default=None, title="Is Org Admin")
    is_org_developer: bool | None = Field(default=None, title="Is Org Developer")


class GroupAuthorizing(BaseModel):
    id: UUID = Field(..., title="Id")
    role: RoleName
    resource_type: ResourceType = Field(..., title="Resource Type")
    resource_id: UUID = Field(..., title="Resource Id")


class ClusterEventBatchCreating(BaseModel):
    index: int = Field(..., title="Index")
    broker_id: UUID = Field(..., title="Broker Id")
    events: list[ClusterEventCreating] = Field(..., title="Events")


class HTTPValidationError(BaseModel):
    detail: list[ValidationError] | None = Field(default=None, title="Detail")


class PropsInput(BaseModel):
    name: str | None = Field(default=None, title="Name")
    title: str | None = Field(default=None, title="Title")
    description: str | None = Field(default=None, title="Description")
    placeholder: str | None = Field(default=None, title="Placeholder")
    value: Any = Field(default=None, title="Value")
    required: bool | None = Field(default=None, title="Required")
    positional: bool | None = Field(default=None, title="Positional")
    exists: bool | None = Field(default=None, title="Exists")
    validations: list[ValidationSchema] | None = Field(
        default=None, title="Validations"
    )
    pattern: str | None = Field(default=None, title="Pattern")
    widget: str | None = Field(default=None, title="Widget")
    choice: dict[str, PropsInput] | None = Field(default=None, title="Choice")
    min: float | None = Field(default=None, title="Min")
    max: float | None = Field(default=None, title="Max")
    step: float | None = Field(default=None, title="Step")
    optional_title: str | None = Field(default=None, title="Optional Title")


class PropsOutput(BaseModel):
    name: str | None = Field(default=None, title="Name")
    title: str | None = Field(default=None, title="Title")
    description: str | None = Field(default=None, title="Description")
    placeholder: str | None = Field(default=None, title="Placeholder")
    value: Any = Field(default=None, title="Value")
    required: bool | None = Field(default=None, title="Required")
    positional: bool | None = Field(default=None, title="Positional")
    exists: bool | None = Field(default=None, title="Exists")
    validations: list[ValidationSchema] | None = Field(
        default=None, title="Validations"
    )
    pattern: str | None = Field(default=None, title="Pattern")
    widget: str | None = Field(default=None, title="Widget")
    choice: dict[str, PropsOutput] | None = Field(default=None, title="Choice")
    min: float | None = Field(default=None, title="Min")
    max: float | None = Field(default=None, title="Max")
    step: float | None = Field(default=None, title="Step")
    optional_title: str | None = Field(default=None, title="Optional Title")


class PageAssetSummary(BaseModel):
    items: list[AssetSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageBrokerPathSummary(BaseModel):
    items: list[BrokerPathSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageBrokerSummary(BaseModel):
    items: list[BrokerSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageDatasetSummary(BaseModel):
    items: list[DatasetSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageGroupSummary(BaseModel):
    items: list[GroupSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageInvitationSummary(BaseModel):
    items: list[InvitationSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageNotificationSummary(BaseModel):
    items: list[NotificationSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageOrgSummary(BaseModel):
    items: list[OrgSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PagePackageSummary(BaseModel):
    items: list[PackageSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PagePersonSummary(BaseModel):
    items: list[PersonSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageProjectSummary(BaseModel):
    items: list[ProjectSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageRecipePlanSummary(BaseModel):
    items: list[RecipePlanSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageRecipeSummary(BaseModel):
    items: list[RecipeSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageSecretSummary(BaseModel):
    items: list[SecretSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageSessionSummary(BaseModel):
    items: list[SessionSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageTaskSummary(BaseModel):
    items: list[TaskSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageUserSummary(BaseModel):
    items: list[UserSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class ActionCreating(BaseModel):
    project_id: UUID = Field(..., title="Project Id")
    name: str | None = Field(default=None, title="Name")
    evaluation: str = Field(..., title="Evaluation")
    plan: RecipePlanCreating


class ActionDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    project_id: UUID = Field(..., title="Project Id")
    job_type: JobType
    plan: RecipePlanDetail
    cli_command: str = Field(..., title="Cli Command")
    stats: ActionStats
    recipe_name: str = Field(..., title="Recipe Name")
    recipe_title: str = Field(..., title="Recipe Title")
    evaluation: str = Field(..., title="Evaluation")
    project_name: str = Field(..., title="Project Name")
    error: str | None = Field(default=None, title="Error")
    executions: list[ActionExecution] = Field(..., title="Executions")
    last_execution_id: UUID | None = Field(default=None, title="Last Execution Id")
    url_logs: str = Field(..., title="Url Logs")
    url: str = Field(..., title="Url")
    related_tasks: list[UUID] = Field(..., title="Related Tasks")
    created_by_user: UserSummary | None = None


class ActionSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    project_id: UUID = Field(..., title="Project Id")
    job_type: JobType
    plan: RecipePlanSummary
    cli_command: str = Field(..., title="Cli Command")
    stats: ActionStats


class AgentCreating(BaseModel):
    project_id: UUID = Field(..., title="Project Id")
    name: str | None = Field(default=None, title="Name")
    plan: RecipePlanCreating


class AgentDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    project_id: UUID = Field(..., title="Project Id")
    job_type: JobType
    plan: RecipePlanDetail
    cli_command: str = Field(..., title="Cli Command")
    recipe_name: str = Field(..., title="Recipe Name")
    recipe_title: str = Field(..., title="Recipe Title")
    project_name: str = Field(..., title="Project Name")
    error: str | None = Field(..., title="Error")
    last_execution_id: UUID | None = Field(default=None, title="Last Execution Id")
    related_tasks: list[UUID] = Field(..., title="Related Tasks")
    created_by_user: UserSummary | None


class AgentSummary(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    project_id: UUID = Field(..., title="Project Id")
    job_type: JobType
    plan: RecipePlanSummary
    cli_command: str = Field(..., title="Cli Command")


class AssetDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    version: str = Field(..., title="Version")
    kind: str = Field(..., title="Kind")
    path: str = Field(..., title="Path")
    meta: dict[str, Any] = Field(..., title="Meta")
    num_used_by: int = Field(..., title="Num Used By")
    tasks: list[TaskSummary] = Field(..., title="Tasks")
    actions: list[ActionSummary] = Field(..., title="Actions")


class DatasetDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    broker_id: UUID = Field(..., title="Broker Id")
    kind: str = Field(..., title="Kind")
    num_used_by: int = Field(..., title="Num Used By")
    tasks: list[TaskSummary] = Field(..., title="Tasks")
    actions: list[ActionSummary] = Field(..., title="Actions")


class GroupDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    org_id: UUID = Field(..., title="Org Id")
    users: list[UserDetail] = Field(..., title="Users")


class PackageDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    version: str = Field(..., title="Version")
    environment: str = Field(..., title="Environment")
    num_used_by: int = Field(..., title="Num Used By")
    recipe_count: int = Field(..., title="Recipe Count")
    org_id: UUID = Field(..., title="Org Id")
    broker_id: UUID = Field(..., title="Broker Id")
    filename: str = Field(..., title="Filename")
    meta: dict[str, Any] = Field(..., title="Meta")
    tasks: list[TaskSummary] = Field(..., title="Tasks")
    actions: list[ActionSummary] = Field(..., title="Actions")
    author: str | None = Field(..., title="Author")


class PersonDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    name: str = Field(..., title="Name")
    source: str = Field(..., title="Source")
    email: str = Field(..., title="Email")
    picture: str = Field(..., title="Picture")
    avatar_url: str = Field(..., title="Avatar Url")
    locale: str = Field(..., title="Locale")
    verified: bool = Field(..., title="Verified")
    preferences: dict[str, Any] = Field(..., title="Preferences")
    users: list[UserSummary] = Field(..., title="Users")


class TaskDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    project_id: UUID = Field(..., title="Project Id")
    broker_id: UUID = Field(..., title="Broker Id")
    name: str = Field(..., title="Name")
    recipe_name: str = Field(..., title="Recipe Name")
    recipe_title: str = Field(..., title="Recipe Title")
    project_name: str = Field(..., title="Project Name")
    error: str | None = Field(default=None, title="Error")
    plan: RecipePlanDetail
    job_type: JobType
    cli_command: str = Field(..., title="Cli Command")
    last_execution_id: UUID | None = Field(default=None, title="Last Execution Id")
    related_actions: list[UUID] = Field(..., title="Related Actions")
    url_logs: str = Field(..., title="Url Logs")
    url: str = Field(..., title="Url")
    created_by_user: UserSummary | None = None


class FieldSchemaInput(BaseModel):
    name: str = Field(..., title="Name")
    type: TypeSchemaInput
    props: PropsInput
    fields: list[FieldSchemaInput] | None = Field(default_factory=list, title="Fields")
    choice: list[FieldSchemaInput] | None = Field(default_factory=list, title="Choice")


class FieldSchemaOutput(BaseModel):
    name: str = Field(..., title="Name")
    type: TypeSchemaOutput
    props: PropsOutput
    fields: list[FieldSchemaOutput] | None = Field(default_factory=list, title="Fields")
    choice: list[FieldSchemaOutput] | None = Field(default_factory=list, title="Choice")


class RecipeSchemaInput(BaseModel):
    name: str = Field(..., title="Name")
    fields: list[FieldSchemaInput] = Field(..., title="Fields")
    title: str | None = Field(default=None, title="Title")
    description: str | None = Field(default=None, title="Description")
    view_id: str | None = Field(default=None, title="View Id")
    cli_names: dict[str, str] | None = Field(default=None, title="Cli Names")


class RecipeSchemaOutput(BaseModel):
    name: str = Field(..., title="Name")
    fields: list[FieldSchemaOutput] = Field(..., title="Fields")
    title: str | None = Field(default=None, title="Title")
    description: str | None = Field(default=None, title="Description")
    view_id: str | None = Field(default=None, title="View Id")
    cli_names: dict[str, str] | None = Field(default=None, title="Cli Names")


class PageActionSummary(BaseModel):
    items: list[ActionSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class PageAgentSummary(BaseModel):
    items: list[AgentSummary] = Field(..., title="Items")
    total: int = Field(..., ge=0, title="Total")
    page: int = Field(..., ge=1, title="Page")
    size: int = Field(..., ge=1, title="Size")
    pages: int = Field(..., ge=0, title="Pages")


class RecipeCreating(BaseModel):
    name: str = Field(..., title="Name")
    title: str = Field(..., title="Title")
    description: str = Field(..., title="Description")
    job_type: str | None = Field(default="task", title="Job Type")
    entry_point: str = Field(..., title="Entry Point")
    form_schema: RecipeSchemaInput
    cli_schema: dict[str, Any] = Field(..., title="Cli Schema")
    meta: dict[str, Any] = Field(..., title="Meta")
    package_id: UUID = Field(..., title="Package Id")


class RecipeDetail(BaseModel):
    id: UUID = Field(..., title="Id")
    created: datetime = Field(..., title="Created")
    updated: datetime = Field(..., title="Updated")
    org_id: UUID = Field(..., title="Org Id")
    package_id: UUID = Field(..., title="Package Id")
    name: str = Field(..., title="Name")
    title: str | None = Field(..., title="Title")
    description: str | None = Field(..., title="Description")
    job_type: str = Field(..., title="Job Type")
    is_action: bool = Field(..., title="Is Action")
    is_latest: bool = Field(..., title="Is Latest")
    entry_point: str | None = Field(..., title="Entry Point")
    num_used_by: int = Field(..., title="Num Used By")
    form_schema: RecipeSchemaOutput
    cli_schema: dict[str, Any] = Field(..., title="Cli Schema")
    meta: dict[str, Any] = Field(..., title="Meta")
    tasks: list[TaskSummary] = Field(..., title="Tasks")
    actions: list[ActionSummary] = Field(..., title="Actions")
    package: PackageSummary


CackQuerying.model_rebuild()
TypeSchemaInput.model_rebuild()
TypeSchemaOutput.model_rebuild()
PropsInput.model_rebuild()
PropsOutput.model_rebuild()
FieldSchemaInput.model_rebuild()
FieldSchemaOutput.model_rebuild()
