# 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 .reaction_set import ReactionSet


class Post(object):
    _types = {
        "user_id": str,
        "content": str,
        "image_key_list": List[str],
        "media_file_token": str,
        "comment_count": int,
        "reaction_set": ReactionSet,
        "id": str,
        "create_time": str,
        "media_cover_image_key": str,
        "cid": str,
        "category_ids": List[str],
        "link": str,
        "user_type": int,
        "dislike_count": int,
    }

    def __init__(self, d=None):
        self.user_id: Optional[str] = None
        self.content: Optional[str] = None
        self.image_key_list: Optional[List[str]] = None
        self.media_file_token: Optional[str] = None
        self.comment_count: Optional[int] = None
        self.reaction_set: Optional[ReactionSet] = None
        self.id: Optional[str] = None
        self.create_time: Optional[str] = None
        self.media_cover_image_key: Optional[str] = None
        self.cid: Optional[str] = None
        self.category_ids: Optional[List[str]] = None
        self.link: Optional[str] = None
        self.user_type: Optional[int] = None
        self.dislike_count: Optional[int] = None
        init(self, d, self._types)

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


class PostBuilder(object):
    def __init__(self) -> None:
        self._post = Post()

    def user_id(self, user_id: str) -> "PostBuilder":
        self._post.user_id = user_id
        return self

    def content(self, content: str) -> "PostBuilder":
        self._post.content = content
        return self

    def image_key_list(self, image_key_list: List[str]) -> "PostBuilder":
        self._post.image_key_list = image_key_list
        return self

    def media_file_token(self, media_file_token: str) -> "PostBuilder":
        self._post.media_file_token = media_file_token
        return self

    def comment_count(self, comment_count: int) -> "PostBuilder":
        self._post.comment_count = comment_count
        return self

    def reaction_set(self, reaction_set: ReactionSet) -> "PostBuilder":
        self._post.reaction_set = reaction_set
        return self

    def id(self, id: str) -> "PostBuilder":
        self._post.id = id
        return self

    def create_time(self, create_time: str) -> "PostBuilder":
        self._post.create_time = create_time
        return self

    def media_cover_image_key(self, media_cover_image_key: str) -> "PostBuilder":
        self._post.media_cover_image_key = media_cover_image_key
        return self

    def cid(self, cid: str) -> "PostBuilder":
        self._post.cid = cid
        return self

    def category_ids(self, category_ids: List[str]) -> "PostBuilder":
        self._post.category_ids = category_ids
        return self

    def link(self, link: str) -> "PostBuilder":
        self._post.link = link
        return self

    def user_type(self, user_type: int) -> "PostBuilder":
        self._post.user_type = user_type
        return self

    def dislike_count(self, dislike_count: int) -> "PostBuilder":
        self._post.dislike_count = dislike_count
        return self

    def build(self) -> "Post":
        return self._post
