pub struct CheckinAPI { /* private fields */ }
Implementations§
Source§impl CheckinAPI
An implementation of the HackGT Check-In API
impl CheckinAPI
An implementation of the HackGT Check-In API
Sourcepub fn login(username: &str, password: &str, url: &str) -> Result<Self, Error>
pub fn login(username: &str, password: &str, url: &str) -> Result<Self, Error>
Log into the API using a username / password combination provided to you
Note: this will block for a few seconds because the server has a high PBKDF2 iteration count by default
Sourcepub fn from_token(auth_token: String, url: &str) -> Self
pub fn from_token(auth_token: String, url: &str) -> Self
Create an API instance directly from an auth token
Can be used to instantly resume an API instance after having obtained a token previously
pub fn auth_token(&self) -> &str
Sourcepub fn add_user(&self, username: &str, password: &str) -> Result<(), Error>
pub fn add_user(&self, username: &str, password: &str) -> Result<(), Error>
Creates a new user with the provided username / password combination
Can be used to provision sub-devices like with checkin-embedded
pub fn delete_user(&self, username: &str) -> Result<(), Error>
Sourcepub fn check_in(&self, uuid: &str, tag: &str) -> Result<CheckInReturn, Error>
pub fn check_in(&self, uuid: &str, tag: &str) -> Result<CheckInReturn, Error>
Check a user into a tag
Returns a three item tuple containing:
- Check in success (true / false)
- User information
- Tag information (for the tag specified)
Sourcepub fn check_out(&self, uuid: &str, tag: &str) -> Result<CheckInReturn, Error>
pub fn check_out(&self, uuid: &str, tag: &str) -> Result<CheckInReturn, Error>
Check a user out of tag
See documentation for check_in
for more details
Get a list of tag names from the check-in instance
Can optionally be filtered to only include tags that are currently active (computed from start
/ end
attributes in check-in database)