# 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 Category(object):
    _types = {
        "id": str,
        "name": str,
        "description": str,
        "create_time": str,
        "post_count": int,
        "participant_count": int,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.name: Optional[str] = None
        self.description: Optional[str] = None
        self.create_time: Optional[str] = None
        self.post_count: Optional[int] = None
        self.participant_count: Optional[int] = None
        init(self, d, self._types)

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


class CategoryBuilder(object):
    def __init__(self) -> None:
        self._category = Category()

    def id(self, id: str) -> "CategoryBuilder":
        self._category.id = id
        return self

    def name(self, name: str) -> "CategoryBuilder":
        self._category.name = name
        return self

    def description(self, description: str) -> "CategoryBuilder":
        self._category.description = description
        return self

    def create_time(self, create_time: str) -> "CategoryBuilder":
        self._category.create_time = create_time
        return self

    def post_count(self, post_count: int) -> "CategoryBuilder":
        self._category.post_count = post_count
        return self

    def participant_count(self, participant_count: int) -> "CategoryBuilder":
        self._category.participant_count = participant_count
        return self

    def build(self) -> "Category":
        return self._category
