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

from __future__ import annotations
from datetime import datetime
import pydantic
from pydantic import model_serializer
from squadcast.types import BaseModel, Nullable, UNSET_SENTINEL
from typing_extensions import Annotated, TypedDict


class V4StatusPagesIssuesListStatusPageIssueStatesResponseTypedDict(TypedDict):
    id: int
    idx: int
    page_id: int
    name: str
    color: str
    default_message: str
    created_at: datetime
    updated_at: datetime
    deleted_at: Nullable[datetime]


class V4StatusPagesIssuesListStatusPageIssueStatesResponse(BaseModel):
    id: Annotated[int, pydantic.Field(alias="ID")]

    idx: Annotated[int, pydantic.Field(alias="Idx")]

    page_id: Annotated[int, pydantic.Field(alias="PageID")]

    name: Annotated[str, pydantic.Field(alias="Name")]

    color: Annotated[str, pydantic.Field(alias="Color")]

    default_message: Annotated[str, pydantic.Field(alias="DefaultMessage")]

    created_at: Annotated[datetime, pydantic.Field(alias="createdAt")]

    updated_at: Annotated[datetime, pydantic.Field(alias="updatedAt")]

    deleted_at: Annotated[Nullable[datetime], pydantic.Field(alias="deletedAt")]

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


try:
    V4StatusPagesIssuesListStatusPageIssueStatesResponse.model_rebuild()
except NameError:
    pass
