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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .url_model import UrlModel


class HttpRequestModel(UncheckedBaseModel):
    """
    HTTP request details.

    Spec: https://schema.ocsf.io/1.6.0/objects/http_request
    """

    http_method: str = pydantic.Field()
    """
    HTTP method (GET, POST, etc.)
    """

    url: UrlModel = pydantic.Field()
    """
    Request URL object
    """

    user_agent: typing.Optional[str] = pydantic.Field(default=None)
    """
    User agent string
    """

    x_forwarded_for: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    X-Forwarded-For header as a list
    """

    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
