# 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 .component_lib_basic import ComponentLibBasic
from .task_info import TaskInfo
from .lookup_with_avatar import LookupWithAvatar
from .lookup_with_avatar import LookupWithAvatar
from .i18n import I18n


class ComponentLibRef(object):
    _types = {
        "basic_info": ComponentLibBasic,
        "version_number": str,
        "can_upgrade": bool,
        "version_id": str,
        "comps_count": str,
        "operating_task_info": TaskInfo,
        "operating_type": str,
        "latest_version_number": str,
        "installed_at": str,
        "installed_by": LookupWithAvatar,
        "updated_at": str,
        "updated_by": LookupWithAvatar,
        "developer_names": List[I18n],
    }

    def __init__(self, d=None):
        self.basic_info: Optional[ComponentLibBasic] = None
        self.version_number: Optional[str] = None
        self.can_upgrade: Optional[bool] = None
        self.version_id: Optional[str] = None
        self.comps_count: Optional[str] = None
        self.operating_task_info: Optional[TaskInfo] = None
        self.operating_type: Optional[str] = None
        self.latest_version_number: Optional[str] = None
        self.installed_at: Optional[str] = None
        self.installed_by: Optional[LookupWithAvatar] = None
        self.updated_at: Optional[str] = None
        self.updated_by: Optional[LookupWithAvatar] = None
        self.developer_names: Optional[List[I18n]] = None
        init(self, d, self._types)

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


class ComponentLibRefBuilder(object):
    def __init__(self) -> None:
        self._component_lib_ref = ComponentLibRef()

    def basic_info(self, basic_info: ComponentLibBasic) -> "ComponentLibRefBuilder":
        self._component_lib_ref.basic_info = basic_info
        return self

    def version_number(self, version_number: str) -> "ComponentLibRefBuilder":
        self._component_lib_ref.version_number = version_number
        return self

    def can_upgrade(self, can_upgrade: bool) -> "ComponentLibRefBuilder":
        self._component_lib_ref.can_upgrade = can_upgrade
        return self

    def version_id(self, version_id: str) -> "ComponentLibRefBuilder":
        self._component_lib_ref.version_id = version_id
        return self

    def comps_count(self, comps_count: str) -> "ComponentLibRefBuilder":
        self._component_lib_ref.comps_count = comps_count
        return self

    def operating_task_info(self, operating_task_info: TaskInfo) -> "ComponentLibRefBuilder":
        self._component_lib_ref.operating_task_info = operating_task_info
        return self

    def operating_type(self, operating_type: str) -> "ComponentLibRefBuilder":
        self._component_lib_ref.operating_type = operating_type
        return self

    def latest_version_number(self, latest_version_number: str) -> "ComponentLibRefBuilder":
        self._component_lib_ref.latest_version_number = latest_version_number
        return self

    def installed_at(self, installed_at: str) -> "ComponentLibRefBuilder":
        self._component_lib_ref.installed_at = installed_at
        return self

    def installed_by(self, installed_by: LookupWithAvatar) -> "ComponentLibRefBuilder":
        self._component_lib_ref.installed_by = installed_by
        return self

    def updated_at(self, updated_at: str) -> "ComponentLibRefBuilder":
        self._component_lib_ref.updated_at = updated_at
        return self

    def updated_by(self, updated_by: LookupWithAvatar) -> "ComponentLibRefBuilder":
        self._component_lib_ref.updated_by = updated_by
        return self

    def developer_names(self, developer_names: List[I18n]) -> "ComponentLibRefBuilder":
        self._component_lib_ref.developer_names = developer_names
        return self

    def build(self) -> "ComponentLibRef":
        return self._component_lib_ref
