# 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 .i18n_text import I18nText
from .credential import Credential
from .i18n_text import I18nText


class ProfileCard(object):
    _types = {
        "name": I18nText,
        "contacts": List[Credential],
        "avatar_key": str,
        "is_custom_avatar": bool,
        "description": I18nText,
        "background_image_key": str,
    }

    def __init__(self, d=None):
        self.name: Optional[I18nText] = None
        self.contacts: Optional[List[Credential]] = None
        self.avatar_key: Optional[str] = None
        self.is_custom_avatar: Optional[bool] = None
        self.description: Optional[I18nText] = None
        self.background_image_key: Optional[str] = None
        init(self, d, self._types)

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


class ProfileCardBuilder(object):
    def __init__(self) -> None:
        self._profile_card = ProfileCard()

    def name(self, name: I18nText) -> "ProfileCardBuilder":
        self._profile_card.name = name
        return self

    def contacts(self, contacts: List[Credential]) -> "ProfileCardBuilder":
        self._profile_card.contacts = contacts
        return self

    def avatar_key(self, avatar_key: str) -> "ProfileCardBuilder":
        self._profile_card.avatar_key = avatar_key
        return self

    def is_custom_avatar(self, is_custom_avatar: bool) -> "ProfileCardBuilder":
        self._profile_card.is_custom_avatar = is_custom_avatar
        return self

    def description(self, description: I18nText) -> "ProfileCardBuilder":
        self._profile_card.description = description
        return self

    def background_image_key(self, background_image_key: str) -> "ProfileCardBuilder":
        self._profile_card.background_image_key = background_image_key
        return self

    def build(self) -> "ProfileCard":
        return self._profile_card
