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

Function remove_team_member

atomic-teams/src/team_member.rs:100–114  ·  view source on GitHub ↗

Remove an identity from a team. # Errors Returns [`TeamsError::MemberNotFound`](crate::error::TeamsError::MemberNotFound) if the identity is not a member of the team and [`TeamsError::PermissionDenied`](crate::error::TeamsError::PermissionDenied) if the caller lacks access.

(
    client: &StorageClient,
    org_slug: &str,
    team_slug: &str,
    identity_id: Uuid,
)

Source from the content-addressed store, hash-verified

98/// [`TeamsError::PermissionDenied`](crate::error::TeamsError::PermissionDenied)
99/// if the caller lacks access.
100pub async fn remove_team_member(
101 client: &StorageClient,
102 org_slug: &str,
103 team_slug: &str,
104 identity_id: Uuid,
105) -> TeamsResult<()> {
106 debug_assert_eq!(client.org_slug(), org_slug);
107 let path = format!("/teams/{team_slug}/members/{identity_id}");
108 client.delete(&path).await.map_err(|e| {
109 map_remote_error(
110 e,
111 format!("team member {identity_id} in {org_slug}/{team_slug}"),
112 )
113 })
114}
115
116#[cfg(test)]
117mod tests {

Callers 1

executeMethod · 0.85

Calls 2

map_remote_errorFunction · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected