1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;

impl Client {
    pub async fn delete_tokens(&self, user: i32) -> Result<Option<()>, Box<dyn std::error::Error>> {
        let res = req()
            .delete(self.endpoint("/v1/users/{}/tokens", vec![user.to_string()]))
            .send()
            .await?;

        match res.status() {
            StatusCode::NOT_FOUND => Ok(None),
            StatusCode::OK => Ok(Some(())),
            _ => Err("Unknown Response Status Code".into()),
        }
    }
}