senviok 0.1.0

Async Rust client for the Senviok messaging API (email, SMS, WhatsApp).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{
    client::Senviok,
    error::SenviokError,
    models::{SendMessageResponse, SendSmsRequest},
};
use reqwest::Method;

pub struct Sms<'a> {
    pub(crate) client: &'a Senviok,
}

impl Sms<'_> {
    pub async fn send(&self, request: SendSmsRequest) -> Result<SendMessageResponse, SenviokError> {
        self.client
            .request(Method::POST, "/v1/sms", Some(&request), None::<&()>)
            .await
    }
}