"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from tofupilot.v2.types import BaseModel
from tofupilot.v2.utils import FieldMetadata, PathParamMetadata, RequestMetadata
from typing import Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


PartUpdateRevisionImageIDEnum = Literal[""]

PartUpdateRevisionImageIDUnionTypedDict = TypeAliasType(
    "PartUpdateRevisionImageIDUnionTypedDict", Union[str, PartUpdateRevisionImageIDEnum]
)
r"""Upload ID for the revision image, or empty string to remove image"""


PartUpdateRevisionImageIDUnion = TypeAliasType(
    "PartUpdateRevisionImageIDUnion", Union[str, PartUpdateRevisionImageIDEnum]
)
r"""Upload ID for the revision image, or empty string to remove image"""


class PartUpdateRevisionRequestBodyTypedDict(TypedDict):
    number: NotRequired[str]
    r"""New revision number to set."""
    image_id: NotRequired[PartUpdateRevisionImageIDUnionTypedDict]
    r"""Upload ID for the revision image, or empty string to remove image"""


class PartUpdateRevisionRequestBody(BaseModel):
    number: Optional[str] = None
    r"""New revision number to set."""

    image_id: Optional[PartUpdateRevisionImageIDUnion] = None
    r"""Upload ID for the revision image, or empty string to remove image"""


class PartUpdateRevisionRequestTypedDict(TypedDict):
    part_number: str
    r"""Part number that the revision belongs to."""
    revision_number: str
    r"""Current revision number to update."""
    request_body: PartUpdateRevisionRequestBodyTypedDict


class PartUpdateRevisionRequest(BaseModel):
    part_number: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""Part number that the revision belongs to."""

    revision_number: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""Current revision number to update."""

    request_body: Annotated[
        PartUpdateRevisionRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]


class PartUpdateRevisionResponseTypedDict(TypedDict):
    r"""Revision updated successfully"""

    id: str
    r"""Unique identifier of the updated revision."""


class PartUpdateRevisionResponse(BaseModel):
    r"""Revision updated successfully"""

    id: str
    r"""Unique identifier of the updated revision."""
