# 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
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel


class ClassificationNextEntry(UncheckedBaseModel):
    """
    A next entry for `CLASSIFY` and `SPLIT` steps. Routes based on the classification result.

    See the [Configuring Workflows via API guide](https://docs.extend.ai/2026-02-09/product/workflows/configuring-workflows-via-api) for end-to-end examples.
    """

    step: str = pydantic.Field()
    """
    The name of the target step.
    """

    classification_id: typing_extensions.Annotated[str, FieldMetadata(alias="classificationId")] = pydantic.Field(
        alias="classificationId"
    )
    """
    Must match a classification `id` from the referenced classifier's or splitter's configuration (e.g. `"cls_invoice"`). Classification IDs are stable across renames — if a classification type is renamed, the ID stays the same and routing continues to work.
    """

    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
