sendly/
lib.rs

1//! # Sendly Rust SDK
2//!
3//! Official Rust client for the Sendly SMS API.
4//!
5//! ## Quick Start
6//!
7//! ```rust,no_run
8//! use sendly::{Sendly, SendMessageRequest};
9//!
10//! #[tokio::main]
11//! async fn main() -> Result<(), sendly::Error> {
12//!     let client = Sendly::new("sk_live_v1_your_api_key");
13//!
14//!     let message = client.messages().send(SendMessageRequest {
15//!         to: "+15551234567".to_string(),
16//!         text: "Hello from Sendly!".to_string(),
17//!         message_type: None,
18//!     }).await?;
19//!
20//!     println!("Message sent: {}", message.id);
21//!     Ok(())
22//! }
23//! ```
24//!
25//! ## Webhooks Management
26//!
27//! ```rust,no_run
28//! use sendly::Sendly;
29//!
30//! #[tokio::main]
31//! async fn main() -> Result<(), sendly::Error> {
32//!     let client = Sendly::new("sk_live_v1_your_api_key");
33//!
34//!     // Create a webhook
35//!     let response = client.webhooks().create(
36//!         "https://example.com/webhook",
37//!         vec!["message.delivered", "message.failed"],
38//!     ).await?;
39//!
40//!     println!("Webhook secret: {}", response.secret);
41//!     Ok(())
42//! }
43//! ```
44//!
45//! ## Account & Credits
46//!
47//! ```rust,no_run
48//! use sendly::Sendly;
49//!
50//! #[tokio::main]
51//! async fn main() -> Result<(), sendly::Error> {
52//!     let client = Sendly::new("sk_live_v1_your_api_key");
53//!
54//!     let credits = client.account().credits().await?;
55//!     println!("Available credits: {}", credits.available_balance);
56//!     Ok(())
57//! }
58//! ```
59
60mod account_resource;
61mod client;
62mod error;
63mod messages;
64mod models;
65mod templates;
66mod verify;
67mod webhook_resource;
68
69pub mod webhooks;
70
71pub use account_resource::AccountResource;
72pub use client::{Sendly, SendlyConfig};
73pub use error::{Error, Result};
74pub use messages::Messages;
75pub use models::*;
76pub use templates::*;
77pub use verify::*;
78pub use webhook_resource::WebhooksResource;