MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_org

Function get_org

atomic-teams/src/org.rs:53–61  ·  view source on GitHub ↗

Fetch an organization by slug. # Errors Returns [`TeamsError::OrgNotFound`](crate::error::TeamsError::OrgNotFound) if the slug does not match any organization visible to the caller.

(client: &StorageClient, slug: &str)

Source from the content-addressed store, hash-verified

51/// Returns [`TeamsError::OrgNotFound`](crate::error::TeamsError::OrgNotFound)
52/// if the slug does not match any organization visible to the caller.
53pub async fn get_org(client: &StorageClient, slug: &str) -> TeamsResult<OrgInfo> {
54 debug!("Fetching organization: slug={slug}");
55 let path = format!("/orgs/{slug}");
56 let info: OrgInfo = client
57 .get(&path)
58 .await
59 .map_err(|e| map_remote_error(e, format!("org {slug}")))?;
60 Ok(info)
61}
62
63/// List every organization the caller belongs to, with the caller's role.
64///

Callers 3

executeMethod · 0.85
executeMethod · 0.85
verify_org_existsFunction · 0.85

Calls 2

map_remote_errorFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected