# 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 GetApplicationMessageOverviewReqMessageType(object):
    pass


@attr.s
class GetApplicationMessageOverviewReqChatType(object):
    pass


@attr.s
class GetApplicationMessageOverviewReq(object):
    app_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 目标应用的 ID
    time_start: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 起始时间戳（秒），时间跨度最长支持180天
    time_end: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 截止时间戳（秒），时间跨度最长支持180天
    chat_type: GetApplicationMessageOverviewReqChatType = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 聊天类型，大小写不敏感，p2p：私聊；group：群聊
    message_type: GetApplicationMessageOverviewReqMessageType = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 消息类型，大小写不敏感，text：文本消息；image：图片消息；card：卡片消息；post：富文本消息；share_chat：群名片


@attr.s
class GetApplicationMessageOverviewRespGroupReadPv(object):
    uv: int = attr.ib(default=0, metadata={"req_type": "json"})  # 去重的消息已读用户数量


@attr.s
class GetApplicationMessageOverviewRespGroupRead(object):
    pv: GetApplicationMessageOverviewRespGroupReadPv = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 消息已读用户数量


@attr.s
class GetApplicationMessageOverviewRespGroupReceivedPv(object):
    uv: int = attr.ib(default=0, metadata={"req_type": "json"})  # 去重的消息接收群聊数量


@attr.s
class GetApplicationMessageOverviewRespGroupReceived(object):
    pv: GetApplicationMessageOverviewRespGroupReceivedPv = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 消息接收群聊数量


@attr.s
class GetApplicationMessageOverviewRespGroupSentPv(object):
    uv: int = attr.ib(default=0, metadata={"req_type": "json"})  # 去重的消息接收群聊数量


@attr.s
class GetApplicationMessageOverviewRespGroupSent(object):
    pv: GetApplicationMessageOverviewRespGroupSentPv = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 消息接收群聊数量


@attr.s
class GetApplicationMessageOverviewRespP2pReadPv(object):
    uv: int = attr.ib(default=0, metadata={"req_type": "json"})  # 去重的消息已读用户数量


@attr.s
class GetApplicationMessageOverviewRespP2pRead(object):
    pv: GetApplicationMessageOverviewRespP2pReadPv = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 消息已读用户数量


@attr.s
class GetApplicationMessageOverviewRespP2pReceivedPv(object):
    uv: int = attr.ib(default=0, metadata={"req_type": "json"})  # 去重的消息接收用户数量


@attr.s
class GetApplicationMessageOverviewRespP2pReceived(object):
    pv: GetApplicationMessageOverviewRespP2pReceivedPv = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 消息接收用户数量


@attr.s
class GetApplicationMessageOverviewRespP2pSentPv(object):
    uv: int = attr.ib(default=0, metadata={"req_type": "json"})  # 去重的消息接收用户数量


@attr.s
class GetApplicationMessageOverviewRespP2pSent(object):
    pv: GetApplicationMessageOverviewRespP2pSentPv = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 消息接收用户数量


@attr.s
class GetApplicationMessageOverviewResp(object):
    p2p_sent: GetApplicationMessageOverviewRespP2pSent = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 单聊发送
    p2p_received: GetApplicationMessageOverviewRespP2pReceived = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 单聊接收
    p2p_read: GetApplicationMessageOverviewRespP2pRead = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 单聊已读
    group_sent: GetApplicationMessageOverviewRespGroupSent = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群聊发送
    group_received: GetApplicationMessageOverviewRespGroupReceived = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群聊接收
    group_read: GetApplicationMessageOverviewRespGroupRead = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群聊已读


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