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


@attr.s
class GetApplicationMessageTrendReqChatType(object):
    pass


@attr.s
class GetApplicationMessageTrendReq(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天
    time_interval: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 步长（秒），最小步长为60秒，需满足(${time_end} - ${time_start}) / ${time_interval} <= 2*24*60
    chat_type: GetApplicationMessageTrendReqChatType = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 聊天类型，大小写不敏感，p2p：私聊；group：群聊
    message_type: GetApplicationMessageTrendReqMessageType = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 消息类型，大小写不敏感，text：文本消息；image：图片消息；card：卡片消息；post：富文本消息；share_chat：群名片


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


@attr.s
class GetApplicationMessageTrendRespGroupRead(object):
    timestamp: GetApplicationMessageTrendRespGroupReadTimestamp = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 时间戳（秒）


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


@attr.s
class GetApplicationMessageTrendRespGroupReceived(object):
    timestamp: GetApplicationMessageTrendRespGroupReceivedTimestamp = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 时间戳（秒）


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


@attr.s
class GetApplicationMessageTrendRespGroupSent(object):
    timestamp: GetApplicationMessageTrendRespGroupSentTimestamp = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 时间戳（秒）


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


@attr.s
class GetApplicationMessageTrendRespP2pRead(object):
    timestamp: GetApplicationMessageTrendRespP2pReadTimestamp = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 时间戳（秒）


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


@attr.s
class GetApplicationMessageTrendRespP2pReceived(object):
    timestamp: GetApplicationMessageTrendRespP2pReceivedTimestamp = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 时间戳（秒）


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


@attr.s
class GetApplicationMessageTrendRespP2pSent(object):
    timestamp: GetApplicationMessageTrendRespP2pSentTimestamp = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 时间戳（秒）


@attr.s
class GetApplicationMessageTrendResp(object):
    p2p_sent: GetApplicationMessageTrendRespP2pSent = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 单聊发送
    p2p_received: GetApplicationMessageTrendRespP2pReceived = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 单聊接收
    p2p_read: GetApplicationMessageTrendRespP2pRead = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 单聊已读
    group_sent: GetApplicationMessageTrendRespGroupSent = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群聊发送
    group_received: GetApplicationMessageTrendRespGroupReceived = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群聊接收
    group_read: GetApplicationMessageTrendRespGroupRead = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群聊已读


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