1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::error::Result;
use crate::model::user::User;

pub struct GetUserBuilder {
    username: String,
}

impl GetUserBuilder {
    pub fn new(username: impl ToString) -> Self {
        Self {
            username: username.to_string(),
        }
    }
    pub async fn send(&self, client: &crate::Client) -> Result<User> {
        let req = client.get(format!("users/{}", self.username)).build()?;
        let res = client.make_request(req).await?;
        client.parse_response(res).await
    }
}