Struct helpscout::Client
[−]
[src]
pub struct Client { pub retry_count: u8, pub retry_wait: u16, // some fields omitted }
The HelpScout API Rust client.
This will allow the rest of this library to interact with the HelpScout API!
Fields
retry_count: u8
Configure the client to retry the request retry_count
number of times
when the service is unavailable.
retry_wait: u16
Duration of time to wait between retry attempts.
Methods
impl Client
[src]
fn new(api_key: &str) -> Client
[src]
Create a new client to the HelpScout service.
Example:
use helpscout::Client; fn main() { let api_key = env::var("HELPSCOUT_API_KEY").expect("to have HELPSCOUT_API_KEY set"); let client = Client::new(&api_key); let mailboxes = mailboxes::list(&client); assert!(mailboxes.items.len() > 0); }
fn get<T>(&self, path: &str, url_params: T) -> Result<Value, HelpScoutError> where
T: Serialize,
[src]
T: Serialize,
Send a get
request to the HelpScout service. This is intended to be used
by the library and not the user.
fn post<T>(
&self,
path: &str,
url_params: T,
body: Option<String>
) -> Result<Value, HelpScoutError> where
T: Serialize,
[src]
&self,
path: &str,
url_params: T,
body: Option<String>
) -> Result<Value, HelpScoutError> where
T: Serialize,
Send a post
request to the HelpScout service. This is intended to be used
by the library and not the user.
fn put<T>(
&self,
path: &str,
url_params: T,
body: Option<String>
) -> Result<Value, HelpScoutError> where
T: Serialize,
[src]
&self,
path: &str,
url_params: T,
body: Option<String>
) -> Result<Value, HelpScoutError> where
T: Serialize,
Send a put
request to the HelpScout service. This is intended to be used
by the library and not the user.