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

from __future__ import annotations
from datetime import datetime
import pydantic
from squadcast_sdk.types import BaseModel
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class V4StatusPagesIssuesUpdateIssueRequestComponentTypedDict(TypedDict):
    id: NotRequired[int]
    status_id: NotRequired[int]


class V4StatusPagesIssuesUpdateIssueRequestComponent(BaseModel):
    id: Optional[int] = None

    status_id: Annotated[Optional[int], pydantic.Field(alias="statusID")] = None


class V4StatusPagesIssuesUpdateIssueRequestStateMessageTypedDict(TypedDict):
    text: NotRequired[str]
    timestamp: NotRequired[datetime]


class V4StatusPagesIssuesUpdateIssueRequestStateMessage(BaseModel):
    text: Optional[str] = None

    timestamp: Optional[datetime] = None


class V4StatusPagesIssuesUpdateIssueRequestIssueTypedDict(TypedDict):
    state_id: NotRequired[int]
    state_messages: NotRequired[
        List[V4StatusPagesIssuesUpdateIssueRequestStateMessageTypedDict]
    ]


class V4StatusPagesIssuesUpdateIssueRequestIssue(BaseModel):
    state_id: Annotated[Optional[int], pydantic.Field(alias="stateID")] = None

    state_messages: Annotated[
        Optional[List[V4StatusPagesIssuesUpdateIssueRequestStateMessage]],
        pydantic.Field(alias="stateMessages"),
    ] = None


class V4StatusPagesIssuesUpdateIssueRequestTypedDict(TypedDict):
    title: str
    components: List[V4StatusPagesIssuesUpdateIssueRequestComponentTypedDict]
    issues: List[V4StatusPagesIssuesUpdateIssueRequestIssueTypedDict]
    status_id: NotRequired[int]


class V4StatusPagesIssuesUpdateIssueRequest(BaseModel):
    title: str

    components: List[V4StatusPagesIssuesUpdateIssueRequestComponent]

    issues: List[V4StatusPagesIssuesUpdateIssueRequestIssue]

    status_id: Annotated[Optional[int], pydantic.Field(alias="statusID")] = None
