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

Function update_org

atomic-teams/src/org.rs:71–86  ·  view source on GitHub ↗

Update an existing organization. Only fields that are `Some` will be sent to the server; `None` fields are omitted from the request body so the server leaves them unchanged. # Arguments `slug` — Current slug of the organization. `name` — New display name (or `None` to keep current). `email` — New contact email (or `None` to keep current).

(
    client: &StorageClient,
    slug: &str,
    name: Option<&str>,
    email: Option<&str>,
)

Source from the content-addressed store, hash-verified

69/// * `name` — New display name (or `None` to keep current).
70/// * `email` — New contact email (or `None` to keep current).
71pub async fn update_org(
72 client: &StorageClient,
73 slug: &str,
74 name: Option<&str>,
75 email: Option<&str>,
76) -> TeamsResult<OrgInfo> {
77 debug!("Updating organization: slug={slug}");
78 let path = format!("/orgs/{slug}");
79 let body = UpdateOrgRequest { name, email };
80 let info: OrgInfo = client
81 .put(&path, &body)
82 .await
83 .map_err(|e| map_remote_error(e, format!("org {slug}")))?;
84 debug!("Updated organization: slug={}", info.slug);
85 Ok(info)
86}
87
88/// Delete an organization.
89///

Callers 1

executeMethod · 0.85

Calls 2

map_remote_errorFunction · 0.85
putMethod · 0.80

Tested by

no test coverage detected