# ----------------------------------------------------------------------------
#
#  Welcome to Baml! To use this generated code, please run the following:
#
#  $ pip install baml
#
# ----------------------------------------------------------------------------

# This file was generated by BAML: please do not edit it. Instead, edit the
# BAML files and re-generate this code using: baml-cli generate
# baml-cli is available with the baml package.

import typing

from baml_py import baml_py, type_builder

# These are exports, not used here, hence the linter is disabled
from baml_py.baml_py import (  # noqa: F401 # pylint: disable=unused-import
    ClassBuilder,
    EnumBuilder,
    EnumValueBuilder,
    FieldType,
)

from .globals import DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME


class TypeBuilder(type_builder.TypeBuilder):
    def __init__(self):
        super().__init__(
            classes=set(
                [
                    "ChunkInput",
                    "ChunkSummary",
                    "FileSummaryResult",
                ]
            ),
            enums=set([]),
            runtime=DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME,
        )

    # #########################################################################
    # Generated enums 0
    # #########################################################################

    # #########################################################################
    # Generated classes 3
    # #########################################################################

    @property
    def ChunkInput(self) -> "ChunkInputViewer":
        return ChunkInputViewer(self)

    @property
    def ChunkSummary(self) -> "ChunkSummaryViewer":
        return ChunkSummaryViewer(self)

    @property
    def FileSummaryResult(self) -> "FileSummaryResultViewer":
        return FileSummaryResultViewer(self)


# #########################################################################
# Generated enums 0
# #########################################################################


# #########################################################################
# Generated classes 3
# #########################################################################


class ChunkInputAst:
    def __init__(self, tb: type_builder.TypeBuilder):
        _tb = tb._tb  # type: ignore (we know how to use this private attribute)
        self._bldr = _tb.class_("ChunkInput")
        self._properties: typing.Set[str] = set(
            [
                "chunk_id",
                "symbol",
                "node_type",
                "line_start",
                "line_end",
                "content",
            ]
        )
        self._props = ChunkInputProperties(self._bldr, self._properties)

    def type(self) -> baml_py.FieldType:
        return self._bldr.field()

    @property
    def props(self) -> "ChunkInputProperties":
        return self._props


class ChunkInputViewer(ChunkInputAst):
    def __init__(self, tb: type_builder.TypeBuilder):
        super().__init__(tb)

    def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
        return [
            (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
            for name in self._properties
        ]


class ChunkInputProperties:
    def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
        self.__bldr = bldr
        self.__properties = properties  # type: ignore (we know how to use this private attribute) # noqa: F821

    @property
    def chunk_id(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("chunk_id"))

    @property
    def symbol(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("symbol"))

    @property
    def node_type(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("node_type"))

    @property
    def line_start(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("line_start"))

    @property
    def line_end(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("line_end"))

    @property
    def content(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("content"))


class ChunkSummaryAst:
    def __init__(self, tb: type_builder.TypeBuilder):
        _tb = tb._tb  # type: ignore (we know how to use this private attribute)
        self._bldr = _tb.class_("ChunkSummary")
        self._properties: typing.Set[str] = set(
            [
                "chunk_id",
                "summary",
            ]
        )
        self._props = ChunkSummaryProperties(self._bldr, self._properties)

    def type(self) -> baml_py.FieldType:
        return self._bldr.field()

    @property
    def props(self) -> "ChunkSummaryProperties":
        return self._props


class ChunkSummaryViewer(ChunkSummaryAst):
    def __init__(self, tb: type_builder.TypeBuilder):
        super().__init__(tb)

    def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
        return [
            (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
            for name in self._properties
        ]


class ChunkSummaryProperties:
    def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
        self.__bldr = bldr
        self.__properties = properties  # type: ignore (we know how to use this private attribute) # noqa: F821

    @property
    def chunk_id(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("chunk_id"))

    @property
    def summary(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("summary"))


class FileSummaryResultAst:
    def __init__(self, tb: type_builder.TypeBuilder):
        _tb = tb._tb  # type: ignore (we know how to use this private attribute)
        self._bldr = _tb.class_("FileSummaryResult")
        self._properties: typing.Set[str] = set(
            [
                "summaries",
            ]
        )
        self._props = FileSummaryResultProperties(self._bldr, self._properties)

    def type(self) -> baml_py.FieldType:
        return self._bldr.field()

    @property
    def props(self) -> "FileSummaryResultProperties":
        return self._props


class FileSummaryResultViewer(FileSummaryResultAst):
    def __init__(self, tb: type_builder.TypeBuilder):
        super().__init__(tb)

    def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
        return [
            (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
            for name in self._properties
        ]


class FileSummaryResultProperties:
    def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
        self.__bldr = bldr
        self.__properties = properties  # type: ignore (we know how to use this private attribute) # noqa: F821

    @property
    def summaries(self) -> type_builder.ClassPropertyViewer:
        return type_builder.ClassPropertyViewer(self.__bldr.property("summaries"))
