# 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 LoggingModeHeaderControlled(UniversalBaseModel):
    """
    Enable this mode to allow per-request control of request body logging via HTTP headers. Individual requests can opt in or opt out of body logging using specific headers.
    """

    type: typing.Literal["header_controlled"] = pydantic.Field(default="header_controlled")
    """
    +value=header_controlled
    """

    log_body_by_default: bool = pydantic.Field()
    """
    Sets the default body logging behaviour when no header is present. Enabling it will log requests by default and clients can opt out. Disabling it will NOT log by default and clients can opt in to log requests.
    """

    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
