Update the role of a team member. # 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,
role: TeamRole,
)
| 72 | /// [`TeamsError::PermissionDenied`](crate::error::TeamsError::PermissionDenied) |
| 73 | /// if the caller lacks access. |
| 74 | pub async fn update_team_member_role( |
| 75 | client: &StorageClient, |
| 76 | org_slug: &str, |
| 77 | team_slug: &str, |
| 78 | identity_id: Uuid, |
| 79 | role: TeamRole, |
| 80 | ) -> TeamsResult<TeamMemberInfo> { |
| 81 | debug_assert_eq!(client.org_slug(), org_slug); |
| 82 | let path = format!("/teams/{team_slug}/members/{identity_id}"); |
| 83 | let body = UpdateTeamMemberRoleRequest { role }; |
| 84 | client.put(&path, &body).await.map_err(|e| { |
| 85 | map_remote_error( |
| 86 | e, |
| 87 | format!("team member {identity_id} in {org_slug}/{team_slug}"), |
| 88 | ) |
| 89 | }) |
| 90 | } |
| 91 | |
| 92 | /// Remove an identity from a team. |
| 93 | /// |
no test coverage detected