Claim a new domain alias for an organization. The domain is created in `"pending"` status. Call [`verify_domain`] after configuring the required DNS records to complete verification. # Errors Returns [`TeamsError::AlreadyExists`] if the domain is already claimed, [`TeamsError::PermissionDenied`] if the caller is not an org admin or owner, or [`TeamsError::Remote`] on transport failure. [`Teams
(
client: &StorageClient,
org_slug: &str,
domain: &str,
)
| 45 | /// [`TeamsError::PermissionDenied`]: crate::error::TeamsError::PermissionDenied |
| 46 | /// [`TeamsError::Remote`]: crate::error::TeamsError::Remote |
| 47 | pub async fn claim_domain( |
| 48 | client: &StorageClient, |
| 49 | org_slug: &str, |
| 50 | domain: &str, |
| 51 | ) -> TeamsResult<DomainAliasInfo> { |
| 52 | let path = format!("/orgs/{org_slug}/domains"); |
| 53 | let body = ClaimDomainRequest { domain }; |
| 54 | client |
| 55 | .post(&path, &body) |
| 56 | .await |
| 57 | .map_err(|e| map_remote_error(e, format!("org {org_slug}"))) |
| 58 | } |
| 59 | |
| 60 | /// Verify a previously claimed domain alias. |
| 61 | /// |
nothing calls this directly
no test coverage detected