# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class DocChunkTableCell(object):
    _types = {
        "type": str,
        "text": str,
        "x0": str,
        "y0": str,
        "x1": str,
        "y1": str,
        "row_index": int,
        "col_index": int,
        "row_span": int,
        "col_span": int,
        "is_merge_cell": bool,
        "images": List[str],
        "files": List[str],
        "is_header": bool,
    }

    def __init__(self, d=None):
        self.type: Optional[str] = None
        self.text: Optional[str] = None
        self.x0: Optional[str] = None
        self.y0: Optional[str] = None
        self.x1: Optional[str] = None
        self.y1: Optional[str] = None
        self.row_index: Optional[int] = None
        self.col_index: Optional[int] = None
        self.row_span: Optional[int] = None
        self.col_span: Optional[int] = None
        self.is_merge_cell: Optional[bool] = None
        self.images: Optional[List[str]] = None
        self.files: Optional[List[str]] = None
        self.is_header: Optional[bool] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "DocChunkTableCellBuilder":
        return DocChunkTableCellBuilder()


class DocChunkTableCellBuilder(object):
    def __init__(self) -> None:
        self._doc_chunk_table_cell = DocChunkTableCell()

    def type(self, type: str) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.type = type
        return self

    def text(self, text: str) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.text = text
        return self

    def x0(self, x0: str) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.x0 = x0
        return self

    def y0(self, y0: str) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.y0 = y0
        return self

    def x1(self, x1: str) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.x1 = x1
        return self

    def y1(self, y1: str) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.y1 = y1
        return self

    def row_index(self, row_index: int) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.row_index = row_index
        return self

    def col_index(self, col_index: int) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.col_index = col_index
        return self

    def row_span(self, row_span: int) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.row_span = row_span
        return self

    def col_span(self, col_span: int) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.col_span = col_span
        return self

    def is_merge_cell(self, is_merge_cell: bool) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.is_merge_cell = is_merge_cell
        return self

    def images(self, images: List[str]) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.images = images
        return self

    def files(self, files: List[str]) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.files = files
        return self

    def is_header(self, is_header: bool) -> "DocChunkTableCellBuilder":
        self._doc_chunk_table_cell.is_header = is_header
        return self

    def build(self) -> "DocChunkTableCell":
        return self._doc_chunk_table_cell
