# Code generated by lark_sdk_gen. DO NOT EDIT.

from pylark.lark_request import RawRequestReq, _new_method_option
import attr
import typing
import io


@attr.s
class GetHelpdeskCategoryListReq(object):
    lang: str = attr.ib(
        default="", metadata={"req_type": "query"}
    )  # 知识库分类语言, 示例值："zh_cn"
    order_by: int = attr.ib(
        default=0, metadata={"req_type": "query"}
    )  # 排序键。1: 根据知识库分类更新时间排序, 示例值：1
    asc: bool = attr.ib(
        default=None, metadata={"req_type": "query"}
    )  # 顺序。true: 正序；false：反序, 示例值：true


@attr.s
class GetHelpdeskCategoryListRespCategorieChildren(object):
    pass


@attr.s
class GetHelpdeskCategoryListRespCategorie(object):
    category_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 知识库分类ID
    id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 知识库分类ID，（旧版，请使用category_id）
    name: str = attr.ib(default="", metadata={"req_type": "json"})  # 名称
    parent_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 父知识库分类ID
    helpdesk_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 服务台ID
    language: str = attr.ib(default="", metadata={"req_type": "json"})  # 语言
    children: typing.List[GetHelpdeskCategoryListRespCategorieChildren] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 子分类详情


@attr.s
class GetHelpdeskCategoryListResp(object):
    categories: typing.List[GetHelpdeskCategoryListRespCategorie] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 知识库分类列表


def _gen_get_helpdesk_category_list_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=GetHelpdeskCategoryListResp,
        scope="Helpdesk",
        api="GetHelpdeskCategoryList",
        method="GET",
        url="https://open.feishu.cn/open-apis/helpdesk/v1/categories",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_helpdesk_auth=True,
    )
