# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .object import Object
from .object_field import ObjectField


class ObjectMeta(object):
    _types = {
        "object": Object,
        "fields": List[ObjectField],
    }

    def __init__(self, d=None):
        self.object: Optional[Object] = None
        self.fields: Optional[List[ObjectField]] = None
        init(self, d, self._types)

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


class ObjectMetaBuilder(object):
    def __init__(self) -> None:
        self._object_meta = ObjectMeta()

    def object(self, object: Object) -> "ObjectMetaBuilder":
        self._object_meta.object = object
        return self

    def fields(self, fields: List[ObjectField]) -> "ObjectMetaBuilder":
        self._object_meta.fields = fields
        return self

    def build(self) -> "ObjectMeta":
        return self._object_meta
