open_lark/event/
context.rs

1use std::collections::HashMap;
2
3use serde::{Deserialize, Serialize};
4use serde_json::Value;
5
6#[derive(Debug, Serialize, Deserialize)]
7pub struct EventContext {
8    pub ts: Option<String>,
9    pub uuid: Option<String>,
10    pub token: Option<String>,
11    #[serde(rename = "type")]
12    pub type_: Option<String>,
13    pub schema: Option<String>,
14    pub header: Option<EventHeader>,
15    pub event: HashMap<String, Value>,
16}
17
18/// 事件头
19#[derive(Debug, Serialize, Deserialize)]
20pub struct EventHeader {
21    /// 事件 ID
22    pub event_id: Option<String>,
23    /// 事件类型
24    pub event_type: Option<String>,
25    /// 事件创建时间戳(单位:毫秒)
26    pub create_time: Option<String>,
27    /// 事件 Token
28    pub token: Option<String>,
29    /// 应用 ID
30    pub app_id: Option<String>,
31    /// 租户 Key
32    pub tenant_key: Option<String>,
33}