Skip to content

fix: return api key delete response#231

Merged
drish merged 1 commit into
resend:mainfrom
mayankbohradev:fix/api-key-delete-response
Jul 8, 2026
Merged

fix: return api key delete response#231
drish merged 1 commit into
resend:mainfrom
mayankbohradev:fix/api-key-delete-response

Conversation

@mayankbohradev

@mayankbohradev mayankbohradev commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What

  • Adds a typed delete response for API key deletion.
  • Returns the documented delete response from sync and async remove methods.

Why

  • The Delete API key endpoint returns an object with object, id, and deleted fields, but the SDK previously discarded the response body and returned None.

Testing

  • pytest --cov=resend --cov-report=xml --doctest-modules tests/api_keys_test.py tests/api_keys_async_test.py -q
  • black --check resend/api_keys/_api_keys.py tests/api_keys_test.py tests/api_keys_async_test.py
  • isort --check-only resend/api_keys/_api_keys.py tests/api_keys_test.py tests/api_keys_async_test.py
  • mypy --install-types --non-interactive --ignore-missing-imports resend/ examples/ tests/
  • pytest --cov=resend --cov-report=xml --doctest-modules tests -q

Summary by cubic

Return the documented API key delete response instead of None, so callers can confirm deletion. Adds ApiKeys.DeleteApiKeyResponse and updates ApiKeys.remove/remove_async in resend.

  • Bug Fixes
    • ApiKeys.remove and ApiKeys.remove_async now return ApiKeys.DeleteApiKeyResponse with object, id, and deleted.
    • Switch to perform_with_content to parse the delete response; tests updated to assert returned fields.

Written for commit 5cdc608. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Jul 8, 2026
@mayankbohradev

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mayankbohradev I can’t start this review because this PR was opened by an external contributor in a public repository. Ask an installation member or outside collaborator to comment @cubic review this.

@drish drish self-requested a review July 8, 2026 14:02
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Caution

This repository is currently using the Sentry GitHub App to receive Codecov PR comments. This integration will be deprecated on July 8, 2026. Please install the Codecov GitHub App to continue receiving coverage reports on your pull requests.
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.64%. Comparing base (7f1acd0) to head (5cdc608).
⚠️ Report is 181 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #231       +/-   ##
===========================================
+ Coverage   82.66%   95.64%   +12.97%     
===========================================
  Files           4       58       +54     
  Lines          75     3100     +3025     
===========================================
+ Hits           62     2965     +2903     
- Misses         13      135      +122     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@drish drish merged commit 0dad9d6 into resend:main Jul 8, 2026
10 checks passed
@drish

drish commented Jul 8, 2026

Copy link
Copy Markdown
Member

thanks for the contribution @mayankbohradev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants