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

Function claim_domain

atomic-teams/src/domain.rs:47–58  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

45/// [`TeamsError::PermissionDenied`]: crate::error::TeamsError::PermissionDenied
46/// [`TeamsError::Remote`]: crate::error::TeamsError::Remote
47pub 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///

Callers

nothing calls this directly

Calls 2

map_remote_errorFunction · 0.85
postMethod · 0.80

Tested by

no test coverage detected