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

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


class PartUpdateRequestBodyTypedDict(TypedDict):
    new_number: NotRequired[str]
    r"""New unique identifier number for the part."""
    name: NotRequired[str]
    r"""New human-readable name for the part."""


class PartUpdateRequestBody(BaseModel):
    new_number: Optional[str] = None
    r"""New unique identifier number for the part."""

    name: Optional[str] = None
    r"""New human-readable name for the part."""


class PartUpdateRequestTypedDict(TypedDict):
    number: str
    r"""Part number identifier of the part to update."""
    request_body: PartUpdateRequestBodyTypedDict


class PartUpdateRequest(BaseModel):
    number: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""Part number identifier of the part to update."""

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


class PartUpdateResponseTypedDict(TypedDict):
    r"""Part updated successfully"""

    id: str
    r"""Unique database identifier of the updated part."""
    number: str
    r"""Unique part number identifier."""
    name: str
    r"""Human-readable name of the part."""
    updated_at: datetime
    r"""ISO 8601 timestamp when the part was updated."""


class PartUpdateResponse(BaseModel):
    r"""Part updated successfully"""

    id: str
    r"""Unique database identifier of the updated part."""

    number: str
    r"""Unique part number identifier."""

    name: str
    r"""Human-readable name of the part."""

    updated_at: datetime
    r"""ISO 8601 timestamp when the part was updated."""
