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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class SpanFieldFilterSpanFieldName(enum.StrEnum):
    SPAN_NAME = "spanName"
    SPAN_ID = "spanId"
    TRACE_ID = "traceId"
    PARENT_SPAN_ID = "parentSpanId"
    APPLICATION_NAME = "applicationName"
    CREATED_BY_SUBJECT_SLUG = "createdBySubjectSlug"
    CREATED_BY_SUBJECT_TYPE = "createdBySubjectType"
    DURATION_IN_NS = "durationInNs"
    DURATION_IN_MS = "durationInMs"
    SPAN_STATUS_CODE = "spanStatusCode"
    TAG = "tag"
    SCOPE_NAME = "scopeName"
    ENVIRONMENT = "environment"

    def visit(
        self,
        span_name: typing.Callable[[], T_Result],
        span_id: typing.Callable[[], T_Result],
        trace_id: typing.Callable[[], T_Result],
        parent_span_id: typing.Callable[[], T_Result],
        application_name: typing.Callable[[], T_Result],
        created_by_subject_slug: typing.Callable[[], T_Result],
        created_by_subject_type: typing.Callable[[], T_Result],
        duration_in_ns: typing.Callable[[], T_Result],
        duration_in_ms: typing.Callable[[], T_Result],
        span_status_code: typing.Callable[[], T_Result],
        tag: typing.Callable[[], T_Result],
        scope_name: typing.Callable[[], T_Result],
        environment: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is SpanFieldFilterSpanFieldName.SPAN_NAME:
            return span_name()
        if self is SpanFieldFilterSpanFieldName.SPAN_ID:
            return span_id()
        if self is SpanFieldFilterSpanFieldName.TRACE_ID:
            return trace_id()
        if self is SpanFieldFilterSpanFieldName.PARENT_SPAN_ID:
            return parent_span_id()
        if self is SpanFieldFilterSpanFieldName.APPLICATION_NAME:
            return application_name()
        if self is SpanFieldFilterSpanFieldName.CREATED_BY_SUBJECT_SLUG:
            return created_by_subject_slug()
        if self is SpanFieldFilterSpanFieldName.CREATED_BY_SUBJECT_TYPE:
            return created_by_subject_type()
        if self is SpanFieldFilterSpanFieldName.DURATION_IN_NS:
            return duration_in_ns()
        if self is SpanFieldFilterSpanFieldName.DURATION_IN_MS:
            return duration_in_ms()
        if self is SpanFieldFilterSpanFieldName.SPAN_STATUS_CODE:
            return span_status_code()
        if self is SpanFieldFilterSpanFieldName.TAG:
            return tag()
        if self is SpanFieldFilterSpanFieldName.SCOPE_NAME:
            return scope_name()
        if self is SpanFieldFilterSpanFieldName.ENVIRONMENT:
            return environment()
