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