# 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 RunError(object):
    _types = {
        "code": str,
        "message": str,
    }

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

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


class RunErrorBuilder(object):
    def __init__(self) -> None:
        self._run_error = RunError()

    def code(self, code: str) -> "RunErrorBuilder":
        self._run_error.code = code
        return self

    def message(self, message: str) -> "RunErrorBuilder":
        self._run_error.message = message
        return self

    def build(self) -> "RunError":
        return self._run_error
