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

Function remove_member

atomic-teams/src/member.rs:108–120  ·  view source on GitHub ↗

Remove a member from an organization. Returns an error if the member is the last owner ([`TeamsError::LastOwner`](crate::error::TeamsError::LastOwner) mapped from a 409 response). # Arguments `client` — Authenticated storage client. `org_slug` — URL-safe slug of the organization. `identity_id` — Identity of the member to remove.

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

Source from the content-addressed store, hash-verified

106/// * `org_slug` — URL-safe slug of the organization.
107/// * `identity_id` — Identity of the member to remove.
108pub async fn remove_member(
109 client: &StorageClient,
110 org_slug: &str,
111 identity_id: Uuid,
112) -> TeamsResult<()> {
113 let path = format!("/orgs/{org_slug}/members/{identity_id}");
114 client.delete(&path).await.map_err(|e| {
115 map_remote_error(
116 e,
117 format!("member identity {identity_id} in org {org_slug}"),
118 )
119 })
120}
121
122#[cfg(test)]
123mod tests {

Callers 1

executeMethod · 0.85

Calls 2

map_remote_errorFunction · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected