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

Function create_team

atomic-teams/src/team.rs:34–51  ·  view source on GitHub ↗

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>,
)

Source from the content-addressed store, hash-verified

32/// The organization is selected by the client's org-scoped base URL/subdomain,
33/// not by repeating the org slug in the path.
34pub 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///

Callers 1

executeMethod · 0.85

Calls 2

map_remote_errorFunction · 0.85
postMethod · 0.80

Tested by

no test coverage detected