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

Function update_member_role

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

Update the role of an existing organization member. # Arguments `client` — Authenticated storage client. `org_slug` — URL-safe slug of the organization. `identity_id` — Identity of the member to update. `role` — New role to assign.

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

Source from the content-addressed store, hash-verified

79/// * `identity_id` — Identity of the member to update.
80/// * `role` — New role to assign.
81pub async fn update_member_role(
82 client: &StorageClient,
83 org_slug: &str,
84 identity_id: Uuid,
85 role: OrgRole,
86) -> TeamsResult<OrgMemberInfo> {
87 let path = format!("/orgs/{org_slug}/members/{identity_id}");
88 let body = UpdateMemberRoleRequest { role };
89 client.put(&path, &body).await.map_err(|e| {
90 map_remote_error(
91 e,
92 format!("member identity {identity_id} in org {org_slug}"),
93 )
94 })
95}
96
97/// Remove a member from an organization.
98///

Callers 1

executeMethod · 0.85

Calls 2

map_remote_errorFunction · 0.85
putMethod · 0.80

Tested by

no test coverage detected