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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .log_stream_filter import LogStreamFilter
from .log_stream_pii_config import LogStreamPiiConfig
from .log_stream_splunk_enum import LogStreamSplunkEnum
from .log_stream_splunk_sink import LogStreamSplunkSink


class CreateLogStreamSplunkRequestBody(UniversalBaseModel):
    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    log stream name
    """

    type: LogStreamSplunkEnum
    is_priority: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="isPriority"),
        pydantic.Field(alias="isPriority", description="True for priority log streams, false for non-priority"),
    ] = None
    filters: typing.Optional[typing.List[LogStreamFilter]] = pydantic.Field(default=None)
    """
    Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.
    """

    pii_config: typing.Optional[LogStreamPiiConfig] = None
    sink: LogStreamSplunkSink
    start_from: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="startFrom"),
        pydantic.Field(alias="startFrom", description="The optional datetime (ISO 8601) to start streaming logs from"),
    ] = None

    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
