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

from __future__ import annotations
from .v4_rotationresponse import V4RotationResponse, V4RotationResponseTypedDict
import pydantic
from pydantic import model_serializer
from squadcast.types import BaseModel, Nullable, UNSET_SENTINEL
from squadcast.utils import FieldMetadata, PathParamMetadata
from typing import List
from typing_extensions import Annotated, TypedDict


class RotationsGetScheduleRotationsRequestTypedDict(TypedDict):
    schedule_id: str


class RotationsGetScheduleRotationsRequest(BaseModel):
    schedule_id: Annotated[
        str,
        pydantic.Field(alias="scheduleID"),
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]


class RotationsGetScheduleRotationsResponseTypedDict(TypedDict):
    r"""The request has succeeded."""

    data: Nullable[List[V4RotationResponseTypedDict]]


class RotationsGetScheduleRotationsResponse(BaseModel):
    r"""The request has succeeded."""

    data: Nullable[List[V4RotationResponse]]

    @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
