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

Function update_org

atomic-teams/src/org.rs:92–107  ·  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

90/// * `name` — New display name (or `None` to keep current).
91/// * `email` — New contact email (or `None` to keep current).
92pub async fn update_org(
93 client: &StorageClient,
94 slug: &str,
95 name: Option<&str>,
96 email: Option<&str>,
97) -> TeamsResult<OrgInfo> {
98 debug!("Updating organization: slug={slug}");
99 let path = format!("/orgs/{slug}");
100 let body = UpdateOrgRequest { name, email };
101 let info: OrgInfo = client
102 .put(&path, &body)
103 .await
104 .map_err(|e| map_remote_error(e, format!("org {slug}")))?;
105 debug!("Updated organization: slug={}", info.slug);
106 Ok(info)
107}
108
109/// Delete an organization.
110///

Callers 1

executeMethod · 0.85

Calls 2

map_remote_errorFunction · 0.85
putMethod · 0.80

Tested by

no test coverage detected