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>,
)
| 90 | /// * `name` — New display name (or `None` to keep current). |
| 91 | /// * `email` — New contact email (or `None` to keep current). |
| 92 | pub 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 | /// |
no test coverage detected