# Code generated by Lark OpenAPI.

from typing import Optional, List

from lark_oapi.core.construct import init
from .train_entity import TrainEntity


class TrainInvoice(object):
    _types = {
        "entities": List[TrainEntity],
    }

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

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


class TrainInvoiceBuilder(object):
    def __init__(self) -> None:
        self._train_invoice = TrainInvoice()

    def entities(self, entities: List[TrainEntity]) -> "TrainInvoiceBuilder":
        self._train_invoice.entities = entities
        return self

    def build(self) -> "TrainInvoice":
        return self._train_invoice
