clickatell_api/one_api/send_messages/
message.rs

1use crate::one_api::{Channel, Result};
2use serde::Serialize;
3
4/// Message sent to the gateway
5#[derive(Serialize, Debug)]
6pub struct Message {
7  channel: Channel,
8  to: String,
9  content: String,
10}
11
12impl Message {
13  pub fn new(channel: Channel, to: impl ToString, content: impl ToString) -> Result<Self> {
14    Ok(Self {
15      channel,
16      to: to.to_string(),
17      content: content.to_string(),
18    })
19  }
20}