# 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 .event_stream_cloud_event_context_client import EventStreamCloudEventContextClient
from .event_stream_cloud_event_context_connection import EventStreamCloudEventContextConnection
from .event_stream_cloud_event_context_request import EventStreamCloudEventContextRequest
from .event_stream_cloud_event_context_tenant import EventStreamCloudEventContextTenant


class EventStreamCloudEventContext(UniversalBaseModel):
    """
    Information about the context in which the event was produced. This may include things like
    HTTP request details, client information, connection information, etc.

    Note: This field may not be present on all events, depending on the event type and the
    context in which it was generated.
    """

    client: typing.Optional[EventStreamCloudEventContextClient] = None
    connection: typing.Optional[EventStreamCloudEventContextConnection] = None
    request: typing.Optional[EventStreamCloudEventContextRequest] = None
    tenant: EventStreamCloudEventContextTenant

    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
