# 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_search_layout import ObjectSearchLayout


class ObjectSettings(object):
    _types = {
        "display_name": str,
        "allow_search_fields": List[str],
        "search_layout": ObjectSearchLayout,
    }

    def __init__(self, d=None):
        self.display_name: Optional[str] = None
        self.allow_search_fields: Optional[List[str]] = None
        self.search_layout: Optional[ObjectSearchLayout] = None
        init(self, d, self._types)

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


class ObjectSettingsBuilder(object):
    def __init__(self) -> None:
        self._object_settings = ObjectSettings()

    def display_name(self, display_name: str) -> "ObjectSettingsBuilder":
        self._object_settings.display_name = display_name
        return self

    def allow_search_fields(self, allow_search_fields: List[str]) -> "ObjectSettingsBuilder":
        self._object_settings.allow_search_fields = allow_search_fields
        return self

    def search_layout(self, search_layout: ObjectSearchLayout) -> "ObjectSettingsBuilder":
        self._object_settings.search_layout = search_layout
        return self

    def build(self) -> "ObjectSettings":
        return self._object_settings
