# 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 FieldSetting(object):
    _types = {
        "required": bool,
        "unique": bool,
        "case_sensitive": bool,
        "text_max_length": int,
        "multiple": bool,
        "lookup_object_api_name": str,
        "options": List[str],
        "detail": str,
    }

    def __init__(self, d=None):
        self.required: Optional[bool] = None
        self.unique: Optional[bool] = None
        self.case_sensitive: Optional[bool] = None
        self.text_max_length: Optional[int] = None
        self.multiple: Optional[bool] = None
        self.lookup_object_api_name: Optional[str] = None
        self.options: Optional[List[str]] = None
        self.detail: Optional[str] = None
        init(self, d, self._types)

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


class FieldSettingBuilder(object):
    def __init__(self) -> None:
        self._field_setting = FieldSetting()

    def required(self, required: bool) -> "FieldSettingBuilder":
        self._field_setting.required = required
        return self

    def unique(self, unique: bool) -> "FieldSettingBuilder":
        self._field_setting.unique = unique
        return self

    def case_sensitive(self, case_sensitive: bool) -> "FieldSettingBuilder":
        self._field_setting.case_sensitive = case_sensitive
        return self

    def text_max_length(self, text_max_length: int) -> "FieldSettingBuilder":
        self._field_setting.text_max_length = text_max_length
        return self

    def multiple(self, multiple: bool) -> "FieldSettingBuilder":
        self._field_setting.multiple = multiple
        return self

    def lookup_object_api_name(self, lookup_object_api_name: str) -> "FieldSettingBuilder":
        self._field_setting.lookup_object_api_name = lookup_object_api_name
        return self

    def options(self, options: List[str]) -> "FieldSettingBuilder":
        self._field_setting.options = options
        return self

    def detail(self, detail: str) -> "FieldSettingBuilder":
        self._field_setting.detail = detail
        return self

    def build(self) -> "FieldSetting":
        return self._field_setting
