pub struct Client { /* private fields */ }Expand description
Zipwhip API Client Requires a Zipwhip session key to be used
Implementations§
Source§impl Client
impl Client
Sourcepub fn with_key<K: Into<String>>(session_key: K) -> Self
pub fn with_key<K: Into<String>>(session_key: K) -> Self
Create a new Zipwhip client with a session key.
Sourcepub async fn add_webhook<U: Into<String>>(
&self,
event: WebhookEvent,
url: U,
) -> Result<usize, ZipwhipError>
pub async fn add_webhook<U: Into<String>>( &self, event: WebhookEvent, url: U, ) -> Result<usize, ZipwhipError>
Register a new webhook for event events.
Returns the id of the new webhook
Sourcepub async fn list_webhooks(&self) -> Result<Vec<Webhook>, ZipwhipError>
pub async fn list_webhooks(&self) -> Result<Vec<Webhook>, ZipwhipError>
Returns a list of webhooks configured for this session_key.
Sourcepub async fn remove_webhook(&self, id: usize) -> Result<(), ZipwhipError>
pub async fn remove_webhook(&self, id: usize) -> Result<(), ZipwhipError>
Delete a webhook (id) for this session_key
Sourcepub async fn logout(self) -> Result<(), ZipwhipError>
pub async fn logout(self) -> Result<(), ZipwhipError>
Invalidate the session_key
Sourcepub async fn login<U: Into<String>, P: Into<String>>(
username: U,
password: P,
) -> Result<Self, ZipwhipError>
pub async fn login<U: Into<String>, P: Into<String>>( username: U, password: P, ) -> Result<Self, ZipwhipError>
Generate a session key on auth
Sourcepub async fn send_sms<T: Into<String>, B: Into<String>>(
&self,
to: T,
body: B,
) -> Result<usize, ZipwhipError>
pub async fn send_sms<T: Into<String>, B: Into<String>>( &self, to: T, body: B, ) -> Result<usize, ZipwhipError>
Send an SMS message to a single recipient.
to: A phone number to send your SMS toobody: Message body Returns the message_id of the newly send message
Sourcepub async fn group_sms<T: Into<String>, B: Into<String>>(
&self,
to: Vec<T>,
body: B,
) -> Result<usize, ZipwhipError>
pub async fn group_sms<T: Into<String>, B: Into<String>>( &self, to: Vec<T>, body: B, ) -> Result<usize, ZipwhipError>
Send a group SMS message
to: A vector of phone numbers to send a group message toobody: Message body
Sourcepub async fn bulk_sms<T: Into<String>, B: Into<String> + Clone>(
&self,
to: Vec<T>,
body: B,
) -> Vec<Result<usize, ZipwhipError>>
pub async fn bulk_sms<T: Into<String>, B: Into<String> + Clone>( &self, to: Vec<T>, body: B, ) -> Vec<Result<usize, ZipwhipError>>
Send a group SMS message
to: A vector of phone numbers to send an individual message to each recipient.body: Message body
Sourcepub async fn group_mms<T: Into<String>, B: Into<String>>(
&self,
to: Vec<T>,
body: B,
) -> Result<usize, ZipwhipError>
pub async fn group_mms<T: Into<String>, B: Into<String>>( &self, to: Vec<T>, body: B, ) -> Result<usize, ZipwhipError>
Send a group MMS message
to: A vector of phone numbers to send a group message toobody: Message body
Sourcepub async fn bulk_mms<T: Into<String>, B: Into<String> + Clone>(
&self,
to: Vec<T>,
body: B,
) -> Vec<Result<usize, ZipwhipError>>
pub async fn bulk_mms<T: Into<String>, B: Into<String> + Clone>( &self, to: Vec<T>, body: B, ) -> Vec<Result<usize, ZipwhipError>>
Send a group MMS message
to: A vector of phone numbers to send an individual message to each recipient.body: Message body
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more