Add a member to an organization. # Arguments `client` — Authenticated storage client. `org_slug` — URL-safe slug of the organization. `identity_id` — Identity to add. `role` — Role to assign to the new member.
(
client: &StorageClient,
org_slug: &str,
identity_id: Uuid,
role: OrgRole,
)
| 36 | /// * `identity_id` — Identity to add. |
| 37 | /// * `role` — Role to assign to the new member. |
| 38 | pub async fn add_member( |
| 39 | client: &StorageClient, |
| 40 | org_slug: &str, |
| 41 | identity_id: Uuid, |
| 42 | role: OrgRole, |
| 43 | ) -> TeamsResult<OrgMemberInfo> { |
| 44 | let path = format!("/orgs/{org_slug}/members"); |
| 45 | let body = AddMemberRequest { identity_id, role }; |
| 46 | client |
| 47 | .post(&path, &body) |
| 48 | .await |
| 49 | .map_err(|e| map_remote_error(e, format!("org {org_slug}"))) |
| 50 | } |
| 51 | |
| 52 | /// Get details for a single organization member. |
| 53 | /// |
no test coverage detected