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