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

from ......core.unchecked_base_model import UncheckedBaseModel
import typing
from .device import Device
import pydantic
from ...base.types.timestamp import Timestamp
import datetime as dt
from .product import Product
from ......core.pydantic_utilities import IS_PYDANTIC_V2


class Logger(UncheckedBaseModel):
    """
    The Logger object represents the device and product where events are stored with times for receipt and transmission. This may be at the source device where the event occurred, a remote scanning device, intermediate hops, or the ultimate destination.
    """

    device: typing.Optional[Device] = pydantic.Field(default=None)
    """
    The device where the events are logged.
    """

    event_uid: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique identifier of the event assigned by the logger.
    """

    is_truncated: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether the OCSF event data has been truncated due to size limitations. When <code>true</code>, some event data may have been omitted to fit within system constraints.
    """

    log_format: typing.Optional[str] = pydantic.Field(default=None)
    """
    The format of data in the log. For example JSON, syslog or CSV.
    """

    log_level: typing.Optional[str] = pydantic.Field(default=None)
    """
    The level at which an event was logged. This can be log provider specific. For example the audit level.
    """

    log_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The log name for the logging provider log, or the file name of the system log. This may be an intermediate store-and-forward log or a vendor destination log. For example /archive/server1/var/log/messages.0 or /var/log/.
    """

    log_provider: typing.Optional[str] = pydantic.Field(default=None)
    """
    The logging provider or logging service that logged the event. This may be an intermediate application store-and-forward log or a vendor destination log.
    """

    log_version: typing.Optional[str] = pydantic.Field(default=None)
    """
    The event log schema version of the original event. For example the syslog version or the Cisco Log Schema version
    """

    logged_time: typing.Optional[Timestamp] = pydantic.Field(default=None)
    """
    <p>The time when the logging system collected and logged the event.</p>This attribute is distinct from the event time in that event time typically contain the time extracted from the original event. Most of the time, these two times will be different.
    """

    logged_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    <p>The time when the logging system collected and logged the event.</p>This attribute is distinct from the event time in that event time typically contain the time extracted from the original event. Most of the time, these two times will be different.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the logging product instance.
    """

    product: typing.Optional[Product] = pydantic.Field(default=None)
    """
    The product logging the event. This may be the event source product, a management server product, a scanning product, a SIEM, etc.
    """

    transmit_time: typing.Optional[Timestamp] = pydantic.Field(default=None)
    """
    The time when the event was transmitted from the logging device to it's next destination.
    """

    transmit_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The time when the event was transmitted from the logging device to it's next destination.
    """

    uid: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique identifier of the logging product instance.
    """

    untruncated_size: typing.Optional[int] = pydantic.Field(default=None)
    """
    The original size of the OCSF event data in kilobytes before any truncation occurred. This field is typically populated when <code>is_truncated</code> is <code>true</code> to indicate the full size of the original event.
    """

    version: typing.Optional[str] = pydantic.Field(default=None)
    """
    The version of the logging provider.
    """

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

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