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

from __future__ import annotations
from .timerangedto import TimeRangeDto, TimeRangeDtoTypedDict
from novu_py.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class MondayTypedDict(TypedDict):
    r"""Monday schedule"""

    is_enabled: bool
    r"""Day schedule enabled"""
    hours: NotRequired[List[TimeRangeDtoTypedDict]]
    r"""Hours"""


class Monday(BaseModel):
    r"""Monday schedule"""

    is_enabled: Annotated[bool, pydantic.Field(alias="isEnabled")]
    r"""Day schedule enabled"""

    hours: Optional[List[TimeRangeDto]] = None
    r"""Hours"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["hours"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class TuesdayTypedDict(TypedDict):
    r"""Tuesday schedule"""

    is_enabled: bool
    r"""Day schedule enabled"""
    hours: NotRequired[List[TimeRangeDtoTypedDict]]
    r"""Hours"""


class Tuesday(BaseModel):
    r"""Tuesday schedule"""

    is_enabled: Annotated[bool, pydantic.Field(alias="isEnabled")]
    r"""Day schedule enabled"""

    hours: Optional[List[TimeRangeDto]] = None
    r"""Hours"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["hours"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class WednesdayTypedDict(TypedDict):
    r"""Wednesday schedule"""

    is_enabled: bool
    r"""Day schedule enabled"""
    hours: NotRequired[List[TimeRangeDtoTypedDict]]
    r"""Hours"""


class Wednesday(BaseModel):
    r"""Wednesday schedule"""

    is_enabled: Annotated[bool, pydantic.Field(alias="isEnabled")]
    r"""Day schedule enabled"""

    hours: Optional[List[TimeRangeDto]] = None
    r"""Hours"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["hours"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class ThursdayTypedDict(TypedDict):
    r"""Thursday schedule"""

    is_enabled: bool
    r"""Day schedule enabled"""
    hours: NotRequired[List[TimeRangeDtoTypedDict]]
    r"""Hours"""


class Thursday(BaseModel):
    r"""Thursday schedule"""

    is_enabled: Annotated[bool, pydantic.Field(alias="isEnabled")]
    r"""Day schedule enabled"""

    hours: Optional[List[TimeRangeDto]] = None
    r"""Hours"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["hours"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class FridayTypedDict(TypedDict):
    r"""Friday schedule"""

    is_enabled: bool
    r"""Day schedule enabled"""
    hours: NotRequired[List[TimeRangeDtoTypedDict]]
    r"""Hours"""


class Friday(BaseModel):
    r"""Friday schedule"""

    is_enabled: Annotated[bool, pydantic.Field(alias="isEnabled")]
    r"""Day schedule enabled"""

    hours: Optional[List[TimeRangeDto]] = None
    r"""Hours"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["hours"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class SaturdayTypedDict(TypedDict):
    r"""Saturday schedule"""

    is_enabled: bool
    r"""Day schedule enabled"""
    hours: NotRequired[List[TimeRangeDtoTypedDict]]
    r"""Hours"""


class Saturday(BaseModel):
    r"""Saturday schedule"""

    is_enabled: Annotated[bool, pydantic.Field(alias="isEnabled")]
    r"""Day schedule enabled"""

    hours: Optional[List[TimeRangeDto]] = None
    r"""Hours"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["hours"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class SundayTypedDict(TypedDict):
    r"""Sunday schedule"""

    is_enabled: bool
    r"""Day schedule enabled"""
    hours: NotRequired[List[TimeRangeDtoTypedDict]]
    r"""Hours"""


class Sunday(BaseModel):
    r"""Sunday schedule"""

    is_enabled: Annotated[bool, pydantic.Field(alias="isEnabled")]
    r"""Day schedule enabled"""

    hours: Optional[List[TimeRangeDto]] = None
    r"""Hours"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["hours"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class WeeklyScheduleTypedDict(TypedDict):
    r"""Weekly schedule"""

    monday: NotRequired[MondayTypedDict]
    r"""Monday schedule"""
    tuesday: NotRequired[TuesdayTypedDict]
    r"""Tuesday schedule"""
    wednesday: NotRequired[WednesdayTypedDict]
    r"""Wednesday schedule"""
    thursday: NotRequired[ThursdayTypedDict]
    r"""Thursday schedule"""
    friday: NotRequired[FridayTypedDict]
    r"""Friday schedule"""
    saturday: NotRequired[SaturdayTypedDict]
    r"""Saturday schedule"""
    sunday: NotRequired[SundayTypedDict]
    r"""Sunday schedule"""


class WeeklySchedule(BaseModel):
    r"""Weekly schedule"""

    monday: Optional[Monday] = None
    r"""Monday schedule"""

    tuesday: Optional[Tuesday] = None
    r"""Tuesday schedule"""

    wednesday: Optional[Wednesday] = None
    r"""Wednesday schedule"""

    thursday: Optional[Thursday] = None
    r"""Thursday schedule"""

    friday: Optional[Friday] = None
    r"""Friday schedule"""

    saturday: Optional[Saturday] = None
    r"""Saturday schedule"""

    sunday: Optional[Sunday] = None
    r"""Sunday schedule"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(
            [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday",
            ]
        )
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class ScheduleDtoTypedDict(TypedDict):
    is_enabled: bool
    r"""Schedule enabled"""
    weekly_schedule: NotRequired[WeeklyScheduleTypedDict]
    r"""Weekly schedule"""


class ScheduleDto(BaseModel):
    is_enabled: Annotated[bool, pydantic.Field(alias="isEnabled")]
    r"""Schedule enabled"""

    weekly_schedule: Annotated[
        Optional[WeeklySchedule], pydantic.Field(alias="weeklySchedule")
    ] = None
    r"""Weekly schedule"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["weeklySchedule"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


try:
    Monday.model_rebuild()
except NameError:
    pass
try:
    Tuesday.model_rebuild()
except NameError:
    pass
try:
    Wednesday.model_rebuild()
except NameError:
    pass
try:
    Thursday.model_rebuild()
except NameError:
    pass
try:
    Friday.model_rebuild()
except NameError:
    pass
try:
    Saturday.model_rebuild()
except NameError:
    pass
try:
    Sunday.model_rebuild()
except NameError:
    pass
try:
    ScheduleDto.model_rebuild()
except NameError:
    pass
