termii_rust/async_impl/rest/insights/mod.rs
1//! Retrieve balance, search phone number, retrieve phone number status and view message history.
2
3//! # Examples
4//!
5//! ## Get your account balance.
6//!
7//! ```rust
8//! use termii_rust::{
9//! async_impl::rest::termii,
10//! common::insights::balance::BalanceItem,
11//! }
12//!
13//! let client = termii::Termii::new("Your API key");
14//!
15//! let balance = client.insights.balance.get().await.unwrap();
16//!
17//! println!("{:?}", balance);
18//! ```
19//!
20//!
21//! ## Get your messaging history.
22//!
23//! ```rust
24//! use termii_rust::{
25//! async_impl::rest::termii,
26//! common::insights::history::HistoryItem,
27//! }
28//!
29//! let client = termii::Termii::new("Your API key");
30//!
31//! let history:HistoryItem = client.insights.history.get().await.unwrap();
32//!
33//! println!("{:?}", history);
34//! ```
35//!
36//! ### The above code is limited by termii's pagination. You can get all your messaging history with the **all** function like such
37//! ```rust
38//! let history = client.insights.history.all().await.unwrap();
39//! ```
40//!
41//!
42//! ## Verify a phone number.
43//!
44//! ```rust
45//! use termii_rust::{
46//! async_impl::rest::termii,
47//! common::insights::search::SearchItem,
48//! }
49//!
50//! let client = termii::Termii::new("Your API key");
51//!
52//! let search:SearchItem = client.insights.search.get("234XXXXXXXXXX").await.unwrap();
53//!
54//! println!("{:?}", search);
55//! ```
56//!
57//!
58//! ## Detects fake or ported numbers.
59//
60//!
61//! ```rust
62//! use termii_rust::{
63//! async_impl::rest::termii,
64//! common::insights::status::StatusItem,
65//! }
66//!
67//! let client = termii::Termii::new("Your API key");
68//!
69//! let status:StatusItem = client.insights.status.get("234XXXXXXXXXX", "NG").await.unwrap();
70//!
71//! println!("{:?}", status);
72//! ```
73
74pub mod insights;
75pub use insights::*;
76
77pub mod balance;
78pub use balance::*;
79
80pub mod history;
81pub use history::*;
82
83pub mod search;
84pub use search::*;
85
86pub mod status;
87pub use status::*;