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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class ChunkMode(str, enum.Enum):
    PAGE = "PAGE"
    DOCUMENT = "DOCUMENT"
    SECTION = "SECTION"

    def visit(
        self,
        page: typing.Callable[[], T_Result],
        document: typing.Callable[[], T_Result],
        section: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is ChunkMode.PAGE:
            return page()
        if self is ChunkMode.DOCUMENT:
            return document()
        if self is ChunkMode.SECTION:
            return section()
