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

from __future__ import annotations
from honeyhive.models.components import (
    event as components_event,
    eventfilter as components_eventfilter,
)
from honeyhive.types import BaseModel
import httpx
import pydantic
from typing import List, Optional, TypedDict
from typing_extensions import Annotated, NotRequired


class DateRangeTypedDict(TypedDict):
    dollar_gte: NotRequired[str]
    r"""ISO String for start of date time filter like `2024-04-01T22:38:19.000Z`"""
    dollar_lte: NotRequired[str]
    r"""ISO String for end of date time filter like `2024-04-01T22:38:19.000Z`"""


class DateRange(BaseModel):
    dollar_gte: Annotated[Optional[str], pydantic.Field(alias="$gte")] = None
    r"""ISO String for start of date time filter like `2024-04-01T22:38:19.000Z`"""

    dollar_lte: Annotated[Optional[str], pydantic.Field(alias="$lte")] = None
    r"""ISO String for end of date time filter like `2024-04-01T22:38:19.000Z`"""


class GetEventsRequestBodyTypedDict(TypedDict):
    project: str
    r"""Name of the project associated with the event like `New Project`"""
    filters: List[components_eventfilter.EventFilterTypedDict]
    date_range: NotRequired[DateRangeTypedDict]
    projections: NotRequired[List[str]]
    r"""Fields to include in the response"""
    limit: NotRequired[float]
    r"""Limit number of results to speed up query (default is 1000, max is 7500)"""
    page: NotRequired[float]
    r"""Page number of results (default is 1)"""


class GetEventsRequestBody(BaseModel):
    project: str
    r"""Name of the project associated with the event like `New Project`"""

    filters: List[components_eventfilter.EventFilter]

    date_range: Annotated[Optional[DateRange], pydantic.Field(alias="dateRange")] = None

    projections: Optional[List[str]] = None
    r"""Fields to include in the response"""

    limit: Optional[float] = None
    r"""Limit number of results to speed up query (default is 1000, max is 7500)"""

    page: Optional[float] = None
    r"""Page number of results (default is 1)"""


class GetEventsResponseBodyTypedDict(TypedDict):
    r"""Success"""

    events: NotRequired[List[components_event.EventTypedDict]]
    total_events: NotRequired[float]
    r"""Total number of events in the specified filter"""


class GetEventsResponseBody(BaseModel):
    r"""Success"""

    events: Optional[List[components_event.Event]] = None

    total_events: Annotated[Optional[float], pydantic.Field(alias="totalEvents")] = None
    r"""Total number of events in the specified filter"""


class GetEventsResponseTypedDict(TypedDict):
    content_type: str
    r"""HTTP response content type for this operation"""
    status_code: int
    r"""HTTP response status code for this operation"""
    raw_response: httpx.Response
    r"""Raw HTTP response; suitable for custom response parsing"""
    object: NotRequired[GetEventsResponseBodyTypedDict]
    r"""Success"""


class GetEventsResponse(BaseModel):
    content_type: str
    r"""HTTP response content type for this operation"""

    status_code: int
    r"""HTTP response status code for this operation"""

    raw_response: httpx.Response
    r"""Raw HTTP response; suitable for custom response parsing"""

    object: Optional[GetEventsResponseBody] = None
    r"""Success"""
