fix(templates): add version fields to the template type

MA
1d ago
+87-1

What

Adds current_version_id and has_unpublished_versions to the Template type.

Why

The retrieve template response contains both fields, and the SDK already returns them. The type did not declare them, so mypy reported template["has_unpublished_versions"] as an error.

How

  • Both keys are NotRequired, like the other optional Template fields, so code that builds a Template dict still type-checks.
  • TemplateListItem is unchanged, because the list response does not contain these fields.
  • No runtime change.

Testing

  • Before the change, mypy reported 12 errors on the new tests.
  • tox -e lint, tox -e mypy and tox -e py pass (868 tests).
  • New sync and async tests read both fields from the documented response.

Notes for reviewers

#321 and #322 also change resend/version.py; I can rebase whichever merges later.


Summary by cubic

Adds current_version_id and has_unpublished_versions to the Template type so code reading the documented retrieve template response type-checks under mypy.

  • Both fields are NotRequired, matching the other optional Template fields, so Template dict literals still type-check.
  • TemplateListItem stays unchanged since the list response doesn't include these fields.
  • Bumps the version to 2.54.1 and adds sync and async tests covering both fields.