1use crate::low_level::apis::{configuration::Configuration, org_api, Error};
2use crate::models;
3
4use super::{ApiKeysClient, ReposClient};
5
6#[derive(Clone, Debug)]
8pub struct OrgClient<'a> {
9 pub(super) config: &'a Configuration,
10 pub(super) org: &'a str,
11}
12
13impl OrgClient<'_> {
14 #[tracing::instrument(skip(self), fields(org = self.org), err(Debug))]
20 pub async fn get(&self) -> Result<models::GetByOrg200Response, Error<org_api::GetByOrgError>> {
21 org_api::get_by_org(self.config, self.org).await
22 }
23
24 #[must_use]
26 pub fn repos(&self) -> ReposClient<'_> {
27 ReposClient { org: self }
28 }
29
30 #[must_use]
32 pub fn api_keys(&self) -> ApiKeysClient<'_> {
33 ApiKeysClient { org: self }
34 }
35}