# 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 .traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item import (
    TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItem,
)
from .traces_create_request_resource_spans_item_scope_spans_item_spans_item_end_time_unix_nano import (
    TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemEndTimeUnixNano,
)
from .traces_create_request_resource_spans_item_scope_spans_item_spans_item_start_time_unix_nano import (
    TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemStartTimeUnixNano,
)
from .traces_create_request_resource_spans_item_scope_spans_item_spans_item_status import (
    TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemStatus,
)


class TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem(UniversalBaseModel):
    trace_id: typing_extensions.Annotated[str, FieldMetadata(alias="traceId")]
    span_id: typing_extensions.Annotated[str, FieldMetadata(alias="spanId")]
    parent_span_id: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="parentSpanId")
    ] = None
    name: str
    kind: typing.Optional[float] = None
    start_time_unix_nano: typing_extensions.Annotated[
        TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemStartTimeUnixNano,
        FieldMetadata(alias="startTimeUnixNano"),
    ]
    end_time_unix_nano: typing_extensions.Annotated[
        TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemEndTimeUnixNano,
        FieldMetadata(alias="endTimeUnixNano"),
    ]
    attributes: typing.Optional[
        typing.List[
            TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItem
        ]
    ] = None
    dropped_attributes_count: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="droppedAttributesCount")
    ] = None
    events: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    dropped_events_count: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="droppedEventsCount")
    ] = None
    status: typing.Optional[
        TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemStatus
    ] = None
    links: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    dropped_links_count: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="droppedLinksCount")
    ] = 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
