pub struct Message {Show 14 fields
pub id: Option<String>,
pub device_id: Option<String>,
pub message: Option<String>,
pub text_message: Option<TextMessage>,
pub data_message: Option<DataMessage>,
pub mms_message: Option<MmsMessage>,
pub phone_numbers: Vec<String>,
pub is_encrypted: bool,
pub sim_number: Option<u8>,
pub with_delivery_report: Option<bool>,
pub priority: MessagePriority,
pub ttl: Option<u64>,
pub valid_until: Option<DateTime<Utc>>,
pub schedule_at: Option<DateTime<Utc>>,
}Expand description
A message to be sent.
At least one of text_message, data_message, or mms_message
must be set.
Fields§
§id: Option<String>Optional message ID (generated if not provided).
device_id: Option<String>Optional device ID for explicit device selection.
message: Option<String>Deprecated: use text_message instead.
text_message: Option<TextMessage>Text message payload.
data_message: Option<DataMessage>Data message payload.
mms_message: Option<MmsMessage>MMS message payload.
phone_numbers: Vec<String>List of recipient phone numbers.
is_encrypted: boolWhether the message content is encrypted.
sim_number: Option<u8>SIM card number to use (1-3). Uses default SIM if not set.
with_delivery_report: Option<bool>Whether to request a delivery report.
priority: MessagePriorityMessage priority. Values > 99 bypass limits and delays.
ttl: Option<u64>Time-to-live in seconds (conflicts with valid_until).
valid_until: Option<DateTime<Utc>>Time until the message is valid (conflicts with ttl).
schedule_at: Option<DateTime<Utc>>Schedule message delivery at this time (must be in the future).
Implementations§
Source§impl Message
impl Message
Sourcepub fn get_text_message(&self) -> Option<TextMessage>
pub fn get_text_message(&self) -> Option<TextMessage>
Returns the text message content, either from text_message or
the deprecated message field.
Sourcepub fn get_data_message(&self) -> Option<&DataMessage>
pub fn get_data_message(&self) -> Option<&DataMessage>
Returns the data message payload, if set.
Sourcepub fn get_mms_message(&self) -> Option<&MmsMessage>
pub fn get_mms_message(&self) -> Option<&MmsMessage>
Returns the MMS message payload, if set.