Create a new team in an organization. The team slug is derived server-side from the `name`. If `visibility` is `None` the server default (typically [`TeamVisibility::Visible`]) is used. The organization is selected by the client's org-scoped base URL/subdomain, not by repeating the org slug in the path.
(
client: &StorageClient,
org_slug: &str,
name: &str,
description: Option<&str>,
visibility: Option<TeamVisibility>,
)
| 32 | /// The organization is selected by the client's org-scoped base URL/subdomain, |
| 33 | /// not by repeating the org slug in the path. |
| 34 | pub async fn create_team( |
| 35 | client: &StorageClient, |
| 36 | org_slug: &str, |
| 37 | name: &str, |
| 38 | description: Option<&str>, |
| 39 | visibility: Option<TeamVisibility>, |
| 40 | ) -> TeamsResult<TeamInfo> { |
| 41 | debug_assert_eq!(client.org_slug(), org_slug); |
| 42 | let body = CreateTeamRequest { |
| 43 | name, |
| 44 | description, |
| 45 | visibility, |
| 46 | }; |
| 47 | client |
| 48 | .post("/teams", &body) |
| 49 | .await |
| 50 | .map_err(|e| map_remote_error(e, format!("org {org_slug}"))) |
| 51 | } |
| 52 | |
| 53 | /// Get a single team by its slug. |
| 54 | /// |
no test coverage detected