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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .log_level import LogLevel
from .log_source import LogSource


class LogQueryEntry(UniversalBaseModel):
    """
    A log entry returned from queries.
    """

    agent_id: str
    environment: typing.Optional[str] = None
    level: LogLevel
    log_id: str
    logger: typing.Optional[str] = None
    message: str
    method: typing.Optional[str] = None
    source: LogSource
    span_id: typing.Optional[str] = None
    task_id: typing.Optional[str] = None
    timestamp: str
    trace_id: typing.Optional[str] = None
    version: typing.Optional[str] = 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
