# 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 FailInfo(object):
    _types = {
        "idx": int,
        "error_code": int,
    }

    def __init__(self, d=None):
        self.idx: Optional[int] = None
        self.error_code: Optional[int] = None
        init(self, d, self._types)

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


class FailInfoBuilder(object):
    def __init__(self) -> None:
        self._fail_info = FailInfo()

    def idx(self, idx: int) -> "FailInfoBuilder":
        self._fail_info.idx = idx
        return self

    def error_code(self, error_code: int) -> "FailInfoBuilder":
        self._fail_info.error_code = error_code
        return self

    def build(self) -> "FailInfo":
        return self._fail_info
