# Code generated by Lark OpenAPI.

from typing import Optional, List

from lark_oapi.core.construct import init
from .tw_mainland_travel_permit_entity import TwMainlandTravelPermitEntity


class TwMainlandTravelPermit(object):
    _types = {
        "entities": List[TwMainlandTravelPermitEntity],
    }

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

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


class TwMainlandTravelPermitBuilder(object):
    def __init__(self) -> None:
        self._tw_mainland_travel_permit = TwMainlandTravelPermit()

    def entities(self, entities: List[TwMainlandTravelPermitEntity]) -> "TwMainlandTravelPermitBuilder":
        self._tw_mainland_travel_permit.entities = entities
        return self

    def build(self) -> "TwMainlandTravelPermit":
        return self._tw_mainland_travel_permit
