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,
)
| 98 | /// [`TeamsError::PermissionDenied`](crate::error::TeamsError::PermissionDenied) |
| 99 | /// if the caller lacks access. |
| 100 | pub 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)] |
| 117 | mod tests { |
no test coverage detected