# 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 LogEntry(UniversalBaseModel):
    """
    Cloud Logging log entry
    """

    log_name: str = pydantic.Field()
    """
    Log name
    """

    message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Text message payload
    """

    json_data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    JSON payload
    """

    severity: typing.Optional[str] = pydantic.Field(default=None)
    """
    Log severity (DEBUG, INFO, WARNING, ERROR, CRITICAL)
    """

    timestamp: typing.Optional[str] = pydantic.Field(default=None)
    """
    Entry timestamp
    """

    resource_type: typing.Optional[str] = pydantic.Field(default=None)
    """
    Resource type (e.g., gce_instance, cloud_function)
    """

    resource_labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
    """
    Resource labels
    """

    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
