# Code generated by Lark OpenAPI.

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


class ChinesePassport(object):
    _types = {
        "entities": List[ChinesePassportEntity],
    }

    def __init__(self, d=None):
        self.entities: Optional[List[ChinesePassportEntity]] = None
        init(self, d, self._types)

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


class ChinesePassportBuilder(object):
    def __init__(self) -> None:
        self._chinese_passport = ChinesePassport()

    def entities(self, entities: List[ChinesePassportEntity]) -> "ChinesePassportBuilder":
        self._chinese_passport.entities = entities
        return self

    def build(self) -> "ChinesePassport":
        return self._chinese_passport
