gitea_sdk/api/orgs/
get.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::{error::Result, model::orgs::Organization, Client};

pub struct GetOrgBuilder {
    name: String,
}

impl GetOrgBuilder {
    pub fn new(name: impl ToString) -> Self {
        Self {
            name: name.to_string(),
        }
    }
    /// Send the request to get an [Organization].
    pub async fn send(&self, client: &Client) -> Result<Organization> {
        let req = client.get(format!("orgs/{}", self.name)).build()?;
        let res = client.make_request(req).await?;
        client.parse_response(res).await
    }
}