openlark_mail/lib.rs
1#![allow(dead_code)]
2#![allow(clippy::module_inception)]
3//! # OpenLark 邮件模块
4//!
5//! OpenLark SDK 的邮件模块,提供飞书邮件组 API 的完整访问。
6//!
7//! ## 功能特性
8//!
9//! - **邮件组管理**: 创建、更新、删除、查询邮件组
10//! - **成员管理**: 添加、删除邮件组成员
11//! - **别名管理**: 邮件别名配置
12//!
13//! ## 使用示例
14//!
15//! ```rust,no_run
16//! use openlark_mail::MailService;
17//! use openlark_core::config::Config;
18//!
19//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
20//! let config = Config::builder()
21//! .app_id("your_app_id")
22//! .app_secret("your_app_secret")
23//! .build();
24//!
25//! let mail_service = MailService::new(config);
26//!
27//! // 创建邮件组
28//! let result = mail_service
29//! .mailgroup()
30//! .create()
31//! .mail_group_id("team@example.com")
32//! .description("项目团队邮件组")
33//! .execute()
34//! .await?;
35//! # Ok(())
36//! # }
37//! ```
38
39mod service;
40
41// 通用模块
42/// 邮件模块通用工具与端点定义。
43pub mod common;
44
45// mail 模块
46#[cfg(feature = "v1")]
47/// 邮件 API 模块。
48pub mod mail;
49
50// Prelude 模块
51/// 邮件模块常用预导出。
52pub mod prelude;
53
54// 重新导出核心服务
55/// 邮件服务统一入口。
56pub use service::MailService;
57
58/// 邮件服务客户端类型别名(统一命名为 `XxxClient`)。
59pub type MailClient = MailService;
60
61/// 邮件模块版本信息
62/// 当前 crate 版本号。
63pub const VERSION: &str = env!("CARGO_PKG_VERSION");
64
65#[cfg(test)]
66#[allow(unused_imports)]
67mod tests {
68 use super::*;
69
70 #[test]
71 fn test_version() {
72 assert_ne!(VERSION, "");
73 }
74}