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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class VersionPodLogEntry(UniversalBaseModel):
    """
    A single pod log entry returned for a deployment version.
    """

    agent_id: str = pydantic.Field()
    """
    Agent ID associated with this log
    """

    branch_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Branch ID associated with this log
    """

    cluster: typing.Optional[str] = pydantic.Field(default=None)
    """
    Cluster name
    """

    container_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Container name
    """

    k8s_namespace: typing.Optional[str] = pydantic.Field(default=None)
    """
    Kubernetes namespace containing the pod
    """

    log_id: str = pydantic.Field()
    """
    Stable pod log identifier for pagination
    """

    message: str = pydantic.Field()
    """
    Pod log message
    """

    pod_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Kubernetes pod name
    """

    stream: typing.Optional[str] = pydantic.Field(default=None)
    """
    Container log stream (stdout/stderr)
    """

    timestamp: str = pydantic.Field()
    """
    ISO 8601 log timestamp
    """

    version_id: str = pydantic.Field()
    """
    Version ID associated with this log
    """

    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
