# 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 .label import Label
from .object_settings_for_query import ObjectSettingsForQuery
from .object_fields_for_query import ObjectFieldsForQuery


class ObjectForQuery(object):
    _types = {
        "api_name": str,
        "label": Label,
        "type": str,
        "settings": ObjectSettingsForQuery,
        "fields": List[ObjectFieldsForQuery],
        "created_at": int,
        "updated_at": int,
    }

    def __init__(self, d=None):
        self.api_name: Optional[str] = None
        self.label: Optional[Label] = None
        self.type: Optional[str] = None
        self.settings: Optional[ObjectSettingsForQuery] = None
        self.fields: Optional[List[ObjectFieldsForQuery]] = None
        self.created_at: Optional[int] = None
        self.updated_at: Optional[int] = None
        init(self, d, self._types)

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


class ObjectForQueryBuilder(object):
    def __init__(self) -> None:
        self._object_for_query = ObjectForQuery()

    def api_name(self, api_name: str) -> "ObjectForQueryBuilder":
        self._object_for_query.api_name = api_name
        return self

    def label(self, label: Label) -> "ObjectForQueryBuilder":
        self._object_for_query.label = label
        return self

    def type(self, type: str) -> "ObjectForQueryBuilder":
        self._object_for_query.type = type
        return self

    def settings(self, settings: ObjectSettingsForQuery) -> "ObjectForQueryBuilder":
        self._object_for_query.settings = settings
        return self

    def fields(self, fields: List[ObjectFieldsForQuery]) -> "ObjectForQueryBuilder":
        self._object_for_query.fields = fields
        return self

    def created_at(self, created_at: int) -> "ObjectForQueryBuilder":
        self._object_for_query.created_at = created_at
        return self

    def updated_at(self, updated_at: int) -> "ObjectForQueryBuilder":
        self._object_for_query.updated_at = updated_at
        return self

    def build(self) -> "ObjectForQuery":
        return self._object_for_query
