# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from .event_type import EventType
from .feedback_type import FeedbackType
from .scoped_entity import ScopedEntity
from .system_event_name import SystemEventName
from .user_event_name import UserEventName


class EventFilter(UniversalBaseModel):
    search: typing.Optional[str] = None
    created_after: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAfter")] = None
    created_before: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdBefore")] = (
        None
    )
    references: typing.Optional[typing.List[ScopedEntity]] = None
    event_types: typing_extensions.Annotated[
        typing.Optional[typing.List[EventType]], FieldMetadata(alias="eventTypes")
    ] = None
    user_event_names: typing_extensions.Annotated[
        typing.Optional[typing.List[UserEventName]], FieldMetadata(alias="userEventNames")
    ] = None
    system_event_names: typing_extensions.Annotated[
        typing.Optional[typing.List[SystemEventName]], FieldMetadata(alias="systemEventNames")
    ] = None
    agent_user_ids: typing_extensions.Annotated[
        typing.Optional[typing.List[str]], FieldMetadata(alias="agentUserIds")
    ] = None
    legacy_feedback_types: typing_extensions.Annotated[
        typing.Optional[typing.List[FeedbackType]], FieldMetadata(alias="legacyFeedbackTypes")
    ] = None
    has_event_text: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hasEventText")] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
