# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init


class MetaFailed(object):
    _types = {
        "token": str,
        "code": int,
    }

    def __init__(self, d=None):
        self.token: Optional[str] = None
        self.code: Optional[int] = None
        init(self, d, self._types)

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


class MetaFailedBuilder(object):
    def __init__(self) -> None:
        self._meta_failed = MetaFailed()

    def token(self, token: str) -> "MetaFailedBuilder":
        self._meta_failed.token = token
        return self

    def code(self, code: int) -> "MetaFailedBuilder":
        self._meta_failed.code = code
        return self

    def build(self) -> "MetaFailed":
        return self._meta_failed
