fix(domains): correct mutation response types
MA
2d ago+75+75+01234567890123456789-53-53-01234567890123456789
What
Correct the return types of Domains.update, Domains.verify, and Domains.remove, including their async variants.
Why
The SDK types these responses as a full Domain. A caller can read Domains.verify(id)["status"] without a type error, but the API response has no status and the lookup can raise KeyError.
How
- Match the documented update, verify, and delete response shapes. Update the examples to use those types.
- This follows #159's correction to the domain creation response type.
Testing
- Sync and async tests use the documented response shapes and assert the inferred types.
tox -e lint,mypy,pypassed (862 tests).
Notes for reviewers
This narrows the public type annotations. The request and response data are unchanged. Use Domains.get() to read the current status.
Summary by cubic
Corrects the return types of Domains.update, Domains.verify, and Domains.remove (sync and async) to match the documented API response shapes. Previously these were typed as a full Domain, so callers could read fields like status that aren't in the response and hit a KeyError.
- Adds
UpdateDomainResponse,VerifyDomainResponse, andRemoveDomainResponsetypes with only the fields the API actually returns. - Updates tests and examples to use the new types and assert them via
assert_type. - Use
Domains.get()to read a domain's current status; the request and response payloads are unchanged.