# 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_request_geo import EventStreamCloudEventContextRequestGeo


class EventStreamCloudEventContextRequest(UniversalBaseModel):
    """
    An HTTP request.
    """

    geo: EventStreamCloudEventContextRequestGeo
    hostname: str = pydantic.Field()
    """
    The hostname the request is for.
    """

    custom_domain: typing.Optional[str] = pydantic.Field(default=None)
    """
    The custom domain used in the request (if any).
    """

    ip: str = pydantic.Field()
    """
    The originating IP address of the request.
    """

    method: str = pydantic.Field()
    """
    The HTTP method used for the request.
    """

    user_agent: str = pydantic.Field()
    """
    The value of the `User-Agent` header.
    """

    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
