ippanel_sms/
lib.rs

1//! # ippanel-sms
2//!
3//! A Rust library for interacting with the IPPanel SMS web service.
4//!
5//! ## Features
6//! - Send single or bulk SMS messages
7//! - Send pattern-based (templated) messages
8//! - Fetch message statuses and details
9//! - Create message patterns
10//! - Retrieve account credit
11//! - Fetch inbox messages
12//! - Fully asynchronous
13//! - Strongly typed models for all API responses
14//!
15//! ## Examples
16//!
17//! ### Get Account Credit
18//! ```no_run
19//! use ippanel_sms::IppanelClient;
20//! # tokio_test::block_on(async {
21//! let client = IppanelClient::new(Some("YOUR_API_KEY".to_string()), None);
22//! let credit = client.get_credit().await.unwrap();
23//! println!("Credit: {}", credit);
24//! # });
25//! ```
26//!
27//! ### Send SMS
28//! ```no_run
29//! use ippanel_sms::IppanelClient;
30//! # tokio_test::block_on(async {
31//! let client = IppanelClient::new(Some("YOUR_API_KEY".to_string()), None);
32//! let message_id = client.send("5000", &["09120000000"], "Hello from Rust!", "Test").await.unwrap();
33//! println!("Message ID: {}", message_id);
34//! # });
35//! ```
36//!
37//! ### Get Message Info
38//! ```no_run
39//! use ippanel_sms::IppanelClient;
40//! # tokio_test::block_on(async {
41//! let client = IppanelClient::new(Some("YOUR_API_KEY".to_string()), None);
42//! let msg = client.get_message(123456).await.unwrap();
43//! println!("Message: {:?}", msg);
44//! # });
45//! ```
46//!
47//! ### Fetch Statuses
48//! ```no_run
49//! use ippanel_sms::IppanelClient;
50//! # tokio_test::block_on(async {
51//! let client = IppanelClient::new(Some("YOUR_API_KEY".to_string()), None);
52//! let (statuses, page) = client.fetch_statuses(123456, 0, 10).await.unwrap();
53//! println!("Statuses: {:?}, Page: {:?}", statuses, page);
54//! # });
55//! ```
56//!
57//! ### Fetch Inbox
58//! ```no_run
59//! use ippanel_sms::IppanelClient;
60//! # tokio_test::block_on(async {
61//! let client = IppanelClient::new(Some("YOUR_API_KEY".to_string()), None);
62//! let (inbox, page) = client.fetch_inbox(1, 10).await.unwrap();
63//! println!("Inbox: {:?}, Page: {:?}", inbox, page);
64//! # });
65//! ```
66//!
67//! ### Create Pattern
68//! ```no_run
69//! use ippanel_sms::IppanelClient;
70//! # tokio_test::block_on(async {
71//! let client = IppanelClient::new(Some("YOUR_API_KEY".to_string()), None);
72//! let code = client.create_pattern("Your code is %code%", "Verification", &[("code".to_string(), "string".to_string())], "%", false).await.unwrap();
73//! println!("Pattern code: {}", code);
74//! # });
75//! ```
76//!
77//! ### Send Pattern
78//! ```no_run
79//! use ippanel_sms::IppanelClient;
80//! # tokio_test::block_on(async {
81//! let client = IppanelClient::new(Some("YOUR_API_KEY".to_string()), None);
82//! let message_id = client.send_pattern("PATTERN_CODE", "5000", "09120000000", &[("code".to_string(), "1234".to_string())]).await.unwrap();
83//! println!("Pattern message ID: {}", message_id);
84//! # });
85//! ```
86//!
87//! More documentation: [GitHub](https://github.com/rustsi/ippanel-sms)
88
89pub mod error;
90pub mod client;
91pub mod models;
92
93pub use error::*;
94pub use client::*;
95pub use models::*;