# 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 GetApplicationMessageDetailReq(object):
    app_id: str = attr.ib(default="", metadata={"req_type": "query"})  # 目标应用的 ID
    message_id: str = attr.ib(
        default="", metadata={"req_type": "query"}
    )  # open_message_id
    time_start: int = attr.ib(
        default=0, metadata={"req_type": "query"}
    )  # 起始时间戳（秒），时间跨度最长支持180天
    time_end: int = attr.ib(
        default=0, metadata={"req_type": "query"}
    )  # 截止时间戳（秒），时间跨度最长支持180天
    page_token: str = attr.ib(
        default="", metadata={"req_type": "query"}
    )  # 分页标记，首次传空，非首次使用返回中的page_token
    page_size: int = attr.ib(
        default=0, metadata={"req_type": "query"}
    )  # 分页大小，默认为512，取值区间[1,1000]


@attr.s
class GetApplicationMessageDetailRespUsersRead(object):
    open_id: str = attr.ib(default="", metadata={"req_type": "json"})  # open_id


@attr.s
class GetApplicationMessageDetailRespTarget(object):
    open_id: str = attr.ib(default="", metadata={"req_type": "json"})  # open_id


@attr.s
class GetApplicationMessageDetailRespMessageType(object):
    pass


@attr.s
class GetApplicationMessageDetailRespChatType(object):
    pass


@attr.s
class GetApplicationMessageDetailResp(object):
    message_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # open_message_id
    chat_type: GetApplicationMessageDetailRespChatType = attr.ib(
        factory=lambda: GetApplicationMessageDetailRespChatType(),
        metadata={"req_type": "json"},
    )  # 聊天类型
    message_type: GetApplicationMessageDetailRespMessageType = attr.ib(
        factory=lambda: GetApplicationMessageDetailRespMessageType(),
        metadata={"req_type": "json"},
    )  # 消息类型
    nsent: int = attr.ib(default=0, metadata={"req_type": "json"})  # 总发送数
    target: GetApplicationMessageDetailRespTarget = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 发送目标用户列表，群聊为空
    nread: int = attr.ib(default=0, metadata={"req_type": "json"})  # 总阅读数
    users_read: GetApplicationMessageDetailRespUsersRead = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 已读用户列表
    has_more: bool = attr.ib(
        factory=lambda: bool(), metadata={"req_type": "json"}
    )  # 是否还有更多分页，当 has_more 为 true 时，会同时返回新的 page_token
    page_token: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 分页标记，当 has_more 为 true 时，会同时返回新的 page_token，否则不返回 page_token


def _gen_get_application_message_detail_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=GetApplicationMessageDetailResp,
        scope="Application",
        api="GetApplicationMessageDetail",
        method="POST",
        url="https://open.feishu.cn/open-apis/application/v1/app_message_detail",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
