# 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 import I18n


class Avatar(object):
    _types = {
        "source": str,
        "color": str,
        "contents": List[I18n],
        "color_id": str,
    }

    def __init__(self, d=None):
        self.source: Optional[str] = None
        self.color: Optional[str] = None
        self.contents: Optional[List[I18n]] = None
        self.color_id: Optional[str] = None
        init(self, d, self._types)

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


class AvatarBuilder(object):
    def __init__(self) -> None:
        self._avatar = Avatar()

    def source(self, source: str) -> "AvatarBuilder":
        self._avatar.source = source
        return self

    def color(self, color: str) -> "AvatarBuilder":
        self._avatar.color = color
        return self

    def contents(self, contents: List[I18n]) -> "AvatarBuilder":
        self._avatar.contents = contents
        return self

    def color_id(self, color_id: str) -> "AvatarBuilder":
        self._avatar.color_id = color_id
        return self

    def build(self) -> "Avatar":
        return self._avatar
