[][src]Struct zipwhip_rs::Client

pub struct Client { /* fields omitted */ }

Zipwhip API Client Requires a Zipwhip session key to be used

Implementations

impl Client[src]

pub fn with_key<K: Into<String>>(session_key: K) -> Self[src]

Create a new Zipwhip client with a session key.

pub async fn add_webhook<'_, U: Into<String>>(
    &'_ self,
    event: WebhookEvent,
    url: U
) -> Result<usize, ZipwhipError>
[src]

Register a new webhook for event events.

Returns the id of the new webhook

pub async fn list_webhooks<'_>(&'_ self) -> Result<Vec<Webhook>, ZipwhipError>[src]

Returns a list of webhooks configured for this session_key.

pub async fn remove_webhook<'_>(&'_ self, id: usize) -> Result<(), ZipwhipError>[src]

Delete a webhook (id) for this session_key

pub async fn logout(self) -> Result<(), ZipwhipError>[src]

Invalidate the session_key

pub async fn login<U: Into<String>, P: Into<String>>(
    username: U,
    password: P
) -> Result<Self, ZipwhipError>
[src]

Generate a session key on auth

pub fn set_key<K: Into<String>>(&mut self, session_key: K)[src]

Override the current session_key

pub async fn send_sms<'_, T: Into<String>, B: Into<String>>(
    &'_ self,
    to: T,
    body: B
) -> Result<usize, ZipwhipError>
[src]

Send an SMS message to a single recipient.

  • to: A phone number to send your SMS too
  • body: Message body Returns the message_id of the newly send message

pub async fn group_sms<'_, T: Into<String>, B: Into<String>>(
    &'_ self,
    to: Vec<T>,
    body: B
) -> Result<usize, ZipwhipError>
[src]

Send a group SMS message

  • to: A vector of phone numbers to send a group message too
  • body: Message body

pub async fn bulk_sms<'_, T: Into<String>, B: Into<String> + Clone>(
    &'_ self,
    to: Vec<T>,
    body: B
) -> Vec<Result<usize, ZipwhipError>>
[src]

Send a group SMS message

  • to: A vector of phone numbers to send an individual message to each recipient.
  • body: Message body

pub async fn group_mms<'_, T: Into<String>, B: Into<String>>(
    &'_ self,
    to: Vec<T>,
    body: B
) -> Result<usize, ZipwhipError>
[src]

Send a group MMS message

  • to: A vector of phone numbers to send a group message too
  • body: Message body

pub async fn bulk_mms<'_, T: Into<String>, B: Into<String> + Clone>(
    &'_ self,
    to: Vec<T>,
    body: B
) -> Vec<Result<usize, ZipwhipError>>
[src]

Send a group MMS message

  • to: A vector of phone numbers to send an individual message to each recipient.
  • body: Message body

pub async fn send_mms<'_, T: Into<String>, B: Into<String>>(
    &'_ self,
    to: T,
    body: B
) -> Result<usize, ZipwhipError>
[src]

Send an MMS message

  • to: A vector of phone numbers to send a group message too
  • body: Message body

pub async fn send_file<'_, T: Into<String>>(
    &'_ self,
    to: T,
    file: Vec<u8>
) -> Result<usize, ZipwhipError>
[src]

Send an MMS message with an attachment

Trait Implementations

impl Clone for Client[src]

impl Default for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.