fix(domains): add capabilities and create tls to domain types

MA
2d ago
+331-4

What

Adds the documented capabilities field to the domain create params, update params, Domain and the create response. Adds tls to the create params.

Why

The API accepts and returns these fields (create, update, get, list), and the SDK already forwards them. The types rejected them, so mypy reported documented usage as an error.

How

  • DomainCapabilities and DomainCapabilityStatus describe the response object.
  • Domains.CapabilitiesParams is total=False, because create and update accept one or both keys.
  • capabilities is NotRequired on the response types, like the other optional domain settings.
  • No runtime change.

Testing

  • Before the change, mypy reported 22 errors on the new tests.
  • tox -e lint, tox -e mypy and tox -e py pass (876 tests).
  • New sync and async tests cover request bodies and typed response access.

Notes for reviewers

New public names: resend.DomainCapabilities, resend.DomainCapabilityStatus and resend.Domains.CapabilitiesParams. #320 edits the same file; I can rebase after it merges.


Summary by cubic

Adds the documented capabilities and tls fields to the domain types so mypy no longer rejects usage that the API already supports.

  • capabilities is now accepted on create and update params and returned on create, get, and list responses.
  • tls is now accepted on create params.
  • Adds new public types resend.DomainCapabilities, resend.DomainCapabilityStatus, and resend.Domains.CapabilitiesParams.