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

from __future__ import annotations
from enum import Enum
from novu_py.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


FeedIdentifierTypedDict = TypeAliasType(
    "FeedIdentifierTypedDict", Union[str, List[str]]
)
r"""Optional feed identifier or array of feed identifiers"""


FeedIdentifier = TypeAliasType("FeedIdentifier", Union[str, List[str]])
r"""Optional feed identifier or array of feed identifiers"""


class MarkAs(str, Enum):
    r"""Mark all subscriber messages as read, unread, seen or unseen"""

    READ = "read"
    SEEN = "seen"
    UNREAD = "unread"
    UNSEEN = "unseen"


class MarkAllMessageAsRequestDtoTypedDict(TypedDict):
    mark_as: MarkAs
    r"""Mark all subscriber messages as read, unread, seen or unseen"""
    feed_identifier: NotRequired[FeedIdentifierTypedDict]
    r"""Optional feed identifier or array of feed identifiers"""


class MarkAllMessageAsRequestDto(BaseModel):
    mark_as: Annotated[MarkAs, pydantic.Field(alias="markAs")]
    r"""Mark all subscriber messages as read, unread, seen or unseen"""

    feed_identifier: Annotated[
        Optional[FeedIdentifier], pydantic.Field(alias="feedIdentifier")
    ] = None
    r"""Optional feed identifier or array of feed identifiers"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["feedIdentifier"])
        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:
    MarkAllMessageAsRequestDto.model_rebuild()
except NameError:
    pass
