# 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 ArchiveField(object):
    _types = {
        "code": str,
        "title": str,
        "upper_titles": List[str],
    }

    def __init__(self, d=None):
        self.code: Optional[str] = None
        self.title: Optional[str] = None
        self.upper_titles: Optional[List[str]] = None
        init(self, d, self._types)

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


class ArchiveFieldBuilder(object):
    def __init__(self) -> None:
        self._archive_field = ArchiveField()

    def code(self, code: str) -> "ArchiveFieldBuilder":
        self._archive_field.code = code
        return self

    def title(self, title: str) -> "ArchiveFieldBuilder":
        self._archive_field.title = title
        return self

    def upper_titles(self, upper_titles: List[str]) -> "ArchiveFieldBuilder":
        self._archive_field.upper_titles = upper_titles
        return self

    def build(self) -> "ArchiveField":
        return self._archive_field
