Twilio (beta)
An async and ergonomic wrapper around Twilio API & TwiML.
All types can run run()
or a similar function. They return a value that implements Deserialize
.
The examples/
dir has up to date working example code.
Messages:
let twilio = new?;
// sending a message
twilio.send_msg.run?;
// sending a body-less message with media
twilio
.send_msg
.media
.run?;
// get details about a message
twilio.msg.run?;
// redact a message
twilio.msg.redact?;
// get a msg media url
twilio.msg.media?;
// delete a msg
twilio.msg.delete?;
// get all messages
twilio.msgs.run?;
// get all messages between some time
twilio.msgs.between.run?;
// get all messages on a specific date
twilio.msgs.on.run?;
Calls:
let twilio = new?;
let = twilio
.call
.run?;
Twiml:
let resp = new
.say // builder pattern also supports say(Say::new("Hello World").lang("de")...)
.play
.build;
let s = "<Response><Say voice=\"man\" language=\"en\" loop=\"1\">Hello World</Say><Play loop=\"1\">https://api.twilio.com/Cowbell.mp3</Play></Response>";
assert_eq!;
Beta software
This library is a work in progress, messages and calls should work, there is untested code for conferences/recordings also.
A significant amount of the TwiML library is done, some of which is tested.
PRs and suggestions are welcome.