gitea_sdk/api/user/current.rs
1use crate::error::Result;
2use crate::model::user::User;
3
4#[derive(Default, Debug)]
5pub struct GetAuthenticatedUserBuilder;
6
7impl GetAuthenticatedUserBuilder {
8 pub fn new() -> Self {
9 Self
10 }
11
12 /// Send the request to get the authenticated user.
13 pub async fn send(&self, client: &crate::Client) -> Result<User> {
14 // send the request
15 let req = client.get("user").build()?;
16 let res = client.make_request(req).await?;
17 client.parse_response(res).await
18 }
19}