"""Auto-generated Supabase types. Do not edit manually.

Regenerate with:
    npx supabase gen types --lang python \
        --db-url "postgresql://postgres:$SUPABASE_DB_PASSWORD@$SUPABASE_DB_HOST:5432/postgres"
"""

from __future__ import annotations

import datetime
import uuid
from typing import (
    Annotated,
    Any,
    Literal,
    NotRequired,
    Optional,
    TypeAlias,
    TypedDict,
)

from pydantic import BaseModel, Field, Json

PublicOrgRole: TypeAlias = Literal["owner", "publisher"]

PublicPackageType: TypeAlias = Literal["task", "dataset"]

PublicPackageVisibility: TypeAlias = Literal["public", "private"]


class PublicOrganization(BaseModel):
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    display_name: Optional[str] = Field(alias="display_name")
    id: uuid.UUID = Field(alias="id")
    name: str = Field(alias="name")


class PublicOrganizationInsert(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    display_name: NotRequired[Annotated[Optional[str], Field(alias="display_name")]]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    name: Annotated[str, Field(alias="name")]


class PublicOrganizationUpdate(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    display_name: NotRequired[Annotated[Optional[str], Field(alias="display_name")]]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    name: NotRequired[Annotated[str, Field(alias="name")]]


class PublicUser(BaseModel):
    avatar_url: Optional[str] = Field(alias="avatar_url")
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    display_name: Optional[str] = Field(alias="display_name")
    github_id: Optional[int] = Field(alias="github_id")
    github_username: Optional[str] = Field(alias="github_username")
    id: uuid.UUID = Field(alias="id")


class PublicUserInsert(TypedDict):
    avatar_url: NotRequired[Annotated[Optional[str], Field(alias="avatar_url")]]
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    display_name: NotRequired[Annotated[Optional[str], Field(alias="display_name")]]
    github_id: NotRequired[Annotated[Optional[int], Field(alias="github_id")]]
    github_username: NotRequired[
        Annotated[Optional[str], Field(alias="github_username")]
    ]
    id: Annotated[uuid.UUID, Field(alias="id")]


class PublicUserUpdate(TypedDict):
    avatar_url: NotRequired[Annotated[Optional[str], Field(alias="avatar_url")]]
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    display_name: NotRequired[Annotated[Optional[str], Field(alias="display_name")]]
    github_id: NotRequired[Annotated[Optional[int], Field(alias="github_id")]]
    github_username: NotRequired[
        Annotated[Optional[str], Field(alias="github_username")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]


class PublicTaskVersion(BaseModel):
    agent_config: Optional[Json[Any]] = Field(alias="agent_config")
    archive_path: str = Field(alias="archive_path")
    authors: Optional[Json[Any]] = Field(alias="authors")
    content_hash: str = Field(alias="content_hash")
    description: Optional[str] = Field(alias="description")
    environment_config: Optional[Json[Any]] = Field(alias="environment_config")
    id: uuid.UUID = Field(alias="id")
    instruction: Optional[str] = Field(alias="instruction")
    keywords: Optional[list[str]] = Field(alias="keywords")
    metadata: Optional[Json[Any]] = Field(alias="metadata")
    package_id: uuid.UUID = Field(alias="package_id")
    published_at: Optional[datetime.datetime] = Field(alias="published_at")
    published_by: Optional[uuid.UUID] = Field(alias="published_by")
    readme: Optional[str] = Field(alias="readme")
    revision: int = Field(alias="revision")
    verifier_config: Optional[Json[Any]] = Field(alias="verifier_config")
    yanked_at: Optional[datetime.datetime] = Field(alias="yanked_at")
    yanked_by: Optional[uuid.UUID] = Field(alias="yanked_by")
    yanked_reason: Optional[str] = Field(alias="yanked_reason")


class PublicTaskVersionInsert(TypedDict):
    agent_config: NotRequired[
        Annotated[Optional[Json[Any]], Field(alias="agent_config")]
    ]
    archive_path: Annotated[str, Field(alias="archive_path")]
    authors: NotRequired[Annotated[Optional[Json[Any]], Field(alias="authors")]]
    content_hash: Annotated[str, Field(alias="content_hash")]
    description: NotRequired[Annotated[Optional[str], Field(alias="description")]]
    environment_config: NotRequired[
        Annotated[Optional[Json[Any]], Field(alias="environment_config")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    instruction: NotRequired[Annotated[Optional[str], Field(alias="instruction")]]
    keywords: NotRequired[Annotated[Optional[list[str]], Field(alias="keywords")]]
    metadata: NotRequired[Annotated[Optional[Json[Any]], Field(alias="metadata")]]
    package_id: Annotated[uuid.UUID, Field(alias="package_id")]
    published_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="published_at")]
    ]
    published_by: NotRequired[
        Annotated[Optional[uuid.UUID], Field(alias="published_by")]
    ]
    readme: NotRequired[Annotated[Optional[str], Field(alias="readme")]]
    revision: Annotated[int, Field(alias="revision")]
    verifier_config: NotRequired[
        Annotated[Optional[Json[Any]], Field(alias="verifier_config")]
    ]
    yanked_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="yanked_at")]
    ]
    yanked_by: NotRequired[Annotated[Optional[uuid.UUID], Field(alias="yanked_by")]]
    yanked_reason: NotRequired[Annotated[Optional[str], Field(alias="yanked_reason")]]


class PublicTaskVersionUpdate(TypedDict):
    agent_config: NotRequired[
        Annotated[Optional[Json[Any]], Field(alias="agent_config")]
    ]
    archive_path: NotRequired[Annotated[str, Field(alias="archive_path")]]
    authors: NotRequired[Annotated[Optional[Json[Any]], Field(alias="authors")]]
    content_hash: NotRequired[Annotated[str, Field(alias="content_hash")]]
    description: NotRequired[Annotated[Optional[str], Field(alias="description")]]
    environment_config: NotRequired[
        Annotated[Optional[Json[Any]], Field(alias="environment_config")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    instruction: NotRequired[Annotated[Optional[str], Field(alias="instruction")]]
    keywords: NotRequired[Annotated[Optional[list[str]], Field(alias="keywords")]]
    metadata: NotRequired[Annotated[Optional[Json[Any]], Field(alias="metadata")]]
    package_id: NotRequired[Annotated[uuid.UUID, Field(alias="package_id")]]
    published_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="published_at")]
    ]
    published_by: NotRequired[
        Annotated[Optional[uuid.UUID], Field(alias="published_by")]
    ]
    readme: NotRequired[Annotated[Optional[str], Field(alias="readme")]]
    revision: NotRequired[Annotated[int, Field(alias="revision")]]
    verifier_config: NotRequired[
        Annotated[Optional[Json[Any]], Field(alias="verifier_config")]
    ]
    yanked_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="yanked_at")]
    ]
    yanked_by: NotRequired[Annotated[Optional[uuid.UUID], Field(alias="yanked_by")]]
    yanked_reason: NotRequired[Annotated[Optional[str], Field(alias="yanked_reason")]]


class PublicDatasetVersion(BaseModel):
    authors: Optional[Json[Any]] = Field(alias="authors")
    content_hash: Optional[str] = Field(alias="content_hash")
    description: Optional[str] = Field(alias="description")
    id: uuid.UUID = Field(alias="id")
    package_id: uuid.UUID = Field(alias="package_id")
    published_at: Optional[datetime.datetime] = Field(alias="published_at")
    published_by: Optional[uuid.UUID] = Field(alias="published_by")
    revision: int = Field(alias="revision")


class PublicDatasetVersionInsert(TypedDict):
    authors: NotRequired[Annotated[Optional[Json[Any]], Field(alias="authors")]]
    content_hash: NotRequired[Annotated[Optional[str], Field(alias="content_hash")]]
    description: NotRequired[Annotated[Optional[str], Field(alias="description")]]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    package_id: Annotated[uuid.UUID, Field(alias="package_id")]
    published_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="published_at")]
    ]
    published_by: NotRequired[
        Annotated[Optional[uuid.UUID], Field(alias="published_by")]
    ]
    revision: Annotated[int, Field(alias="revision")]


class PublicDatasetVersionUpdate(TypedDict):
    authors: NotRequired[Annotated[Optional[Json[Any]], Field(alias="authors")]]
    content_hash: NotRequired[Annotated[Optional[str], Field(alias="content_hash")]]
    description: NotRequired[Annotated[Optional[str], Field(alias="description")]]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    package_id: NotRequired[Annotated[uuid.UUID, Field(alias="package_id")]]
    published_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="published_at")]
    ]
    published_by: NotRequired[
        Annotated[Optional[uuid.UUID], Field(alias="published_by")]
    ]
    revision: NotRequired[Annotated[int, Field(alias="revision")]]


class PublicTaskVersionFile(BaseModel):
    content_hash: str = Field(alias="content_hash")
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    id: uuid.UUID = Field(alias="id")
    path: str = Field(alias="path")
    size_bytes: Optional[int] = Field(alias="size_bytes")
    storage_path: Optional[str] = Field(alias="storage_path")
    task_version_id: Optional[uuid.UUID] = Field(alias="task_version_id")


class PublicTaskVersionFileInsert(TypedDict):
    content_hash: Annotated[str, Field(alias="content_hash")]
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    path: Annotated[str, Field(alias="path")]
    size_bytes: NotRequired[Annotated[Optional[int], Field(alias="size_bytes")]]
    storage_path: NotRequired[Annotated[Optional[str], Field(alias="storage_path")]]
    task_version_id: NotRequired[
        Annotated[Optional[uuid.UUID], Field(alias="task_version_id")]
    ]


class PublicTaskVersionFileUpdate(TypedDict):
    content_hash: NotRequired[Annotated[str, Field(alias="content_hash")]]
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    path: NotRequired[Annotated[str, Field(alias="path")]]
    size_bytes: NotRequired[Annotated[Optional[int], Field(alias="size_bytes")]]
    storage_path: NotRequired[Annotated[Optional[str], Field(alias="storage_path")]]
    task_version_id: NotRequired[
        Annotated[Optional[uuid.UUID], Field(alias="task_version_id")]
    ]


class PublicOrgMembership(BaseModel):
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    id: uuid.UUID = Field(alias="id")
    org_id: Optional[uuid.UUID] = Field(alias="org_id")
    role: PublicOrgRole = Field(alias="role")
    user_id: Optional[uuid.UUID] = Field(alias="user_id")


class PublicOrgMembershipInsert(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    org_id: NotRequired[Annotated[Optional[uuid.UUID], Field(alias="org_id")]]
    role: Annotated[PublicOrgRole, Field(alias="role")]
    user_id: NotRequired[Annotated[Optional[uuid.UUID], Field(alias="user_id")]]


class PublicOrgMembershipUpdate(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    org_id: NotRequired[Annotated[Optional[uuid.UUID], Field(alias="org_id")]]
    role: NotRequired[Annotated[PublicOrgRole, Field(alias="role")]]
    user_id: NotRequired[Annotated[Optional[uuid.UUID], Field(alias="user_id")]]


class PublicDatasetVersionTask(BaseModel):
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    dataset_version_id: uuid.UUID = Field(alias="dataset_version_id")
    task_version_id: uuid.UUID = Field(alias="task_version_id")


class PublicDatasetVersionTaskInsert(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    dataset_version_id: Annotated[uuid.UUID, Field(alias="dataset_version_id")]
    task_version_id: Annotated[uuid.UUID, Field(alias="task_version_id")]


class PublicDatasetVersionTaskUpdate(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    dataset_version_id: NotRequired[
        Annotated[uuid.UUID, Field(alias="dataset_version_id")]
    ]
    task_version_id: NotRequired[Annotated[uuid.UUID, Field(alias="task_version_id")]]


class PublicTaskVersionDownload(BaseModel):
    downloaded_at: Optional[datetime.datetime] = Field(alias="downloaded_at")
    id: int = Field(alias="id")
    task_version_id: Optional[uuid.UUID] = Field(alias="task_version_id")


class PublicTaskVersionDownloadInsert(TypedDict):
    downloaded_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="downloaded_at")]
    ]
    id: NotRequired[Annotated[int, Field(alias="id")]]
    task_version_id: NotRequired[
        Annotated[Optional[uuid.UUID], Field(alias="task_version_id")]
    ]


class PublicTaskVersionDownloadUpdate(TypedDict):
    downloaded_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="downloaded_at")]
    ]
    id: NotRequired[Annotated[int, Field(alias="id")]]
    task_version_id: NotRequired[
        Annotated[Optional[uuid.UUID], Field(alias="task_version_id")]
    ]


class PublicPackage(BaseModel):
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    id: uuid.UUID = Field(alias="id")
    name: str = Field(alias="name")
    org_id: uuid.UUID = Field(alias="org_id")
    type: PublicPackageType = Field(alias="type")
    visibility: PublicPackageVisibility = Field(alias="visibility")


class PublicPackageInsert(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    name: Annotated[str, Field(alias="name")]
    org_id: Annotated[uuid.UUID, Field(alias="org_id")]
    type: Annotated[PublicPackageType, Field(alias="type")]
    visibility: NotRequired[
        Annotated[PublicPackageVisibility, Field(alias="visibility")]
    ]


class PublicPackageUpdate(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    name: NotRequired[Annotated[str, Field(alias="name")]]
    org_id: NotRequired[Annotated[uuid.UUID, Field(alias="org_id")]]
    type: NotRequired[Annotated[PublicPackageType, Field(alias="type")]]
    visibility: NotRequired[
        Annotated[PublicPackageVisibility, Field(alias="visibility")]
    ]


class PublicDatasetVersionFile(BaseModel):
    content_hash: str = Field(alias="content_hash")
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    dataset_version_id: uuid.UUID = Field(alias="dataset_version_id")
    id: uuid.UUID = Field(alias="id")
    path: str = Field(alias="path")
    size_bytes: Optional[int] = Field(alias="size_bytes")
    storage_path: str = Field(alias="storage_path")


class PublicDatasetVersionFileInsert(TypedDict):
    content_hash: Annotated[str, Field(alias="content_hash")]
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    dataset_version_id: Annotated[uuid.UUID, Field(alias="dataset_version_id")]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    path: Annotated[str, Field(alias="path")]
    size_bytes: NotRequired[Annotated[Optional[int], Field(alias="size_bytes")]]
    storage_path: Annotated[str, Field(alias="storage_path")]


class PublicDatasetVersionFileUpdate(TypedDict):
    content_hash: NotRequired[Annotated[str, Field(alias="content_hash")]]
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    dataset_version_id: NotRequired[
        Annotated[uuid.UUID, Field(alias="dataset_version_id")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    path: NotRequired[Annotated[str, Field(alias="path")]]
    size_bytes: NotRequired[Annotated[Optional[int], Field(alias="size_bytes")]]
    storage_path: NotRequired[Annotated[str, Field(alias="storage_path")]]


class PublicTaskVersionTag(BaseModel):
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    id: uuid.UUID = Field(alias="id")
    package_id: uuid.UUID = Field(alias="package_id")
    tag: str = Field(alias="tag")
    task_version_id: uuid.UUID = Field(alias="task_version_id")
    updated_at: Optional[datetime.datetime] = Field(alias="updated_at")


class PublicTaskVersionTagInsert(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    package_id: Annotated[uuid.UUID, Field(alias="package_id")]
    tag: Annotated[str, Field(alias="tag")]
    task_version_id: Annotated[uuid.UUID, Field(alias="task_version_id")]
    updated_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="updated_at")]
    ]


class PublicTaskVersionTagUpdate(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    package_id: NotRequired[Annotated[uuid.UUID, Field(alias="package_id")]]
    tag: NotRequired[Annotated[str, Field(alias="tag")]]
    task_version_id: NotRequired[Annotated[uuid.UUID, Field(alias="task_version_id")]]
    updated_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="updated_at")]
    ]


class PublicDatasetVersionTag(BaseModel):
    created_at: Optional[datetime.datetime] = Field(alias="created_at")
    dataset_version_id: uuid.UUID = Field(alias="dataset_version_id")
    id: uuid.UUID = Field(alias="id")
    package_id: uuid.UUID = Field(alias="package_id")
    tag: str = Field(alias="tag")
    updated_at: Optional[datetime.datetime] = Field(alias="updated_at")


class PublicDatasetVersionTagInsert(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    dataset_version_id: Annotated[uuid.UUID, Field(alias="dataset_version_id")]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    package_id: Annotated[uuid.UUID, Field(alias="package_id")]
    tag: Annotated[str, Field(alias="tag")]
    updated_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="updated_at")]
    ]


class PublicDatasetVersionTagUpdate(TypedDict):
    created_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="created_at")]
    ]
    dataset_version_id: NotRequired[
        Annotated[uuid.UUID, Field(alias="dataset_version_id")]
    ]
    id: NotRequired[Annotated[uuid.UUID, Field(alias="id")]]
    package_id: NotRequired[Annotated[uuid.UUID, Field(alias="package_id")]]
    tag: NotRequired[Annotated[str, Field(alias="tag")]]
    updated_at: NotRequired[
        Annotated[Optional[datetime.datetime], Field(alias="updated_at")]
    ]
