gitea_sdk/api/orgs/get.rs
1use crate::{error::Result, model::orgs::Organization, Client};
2
3pub struct GetOrgBuilder {
4 name: String,
5}
6
7impl GetOrgBuilder {
8 pub fn new(name: impl ToString) -> Self {
9 Self {
10 name: name.to_string(),
11 }
12 }
13 /// Send the request to get an [Organization].
14 pub async fn send(&self, client: &Client) -> Result<Organization> {
15 let req = client.get(format!("orgs/{}", self.name)).build()?;
16 let res = client.make_request(req).await?;
17 client.parse_response(res).await
18 }
19}