feat(usage): add support for GET /usage - #248
Conversation
Adds Resend::Usage.get, exposing account-level usage and quota data (emails, contacts, segments, broadcasts, ai_credits, automation_runs, domains, rate_limit).
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
process_response only symbolizes top-level keys; nested hashes keep the string keys from the raw JSON response. The mock and assertions used symbol keys throughout, so the test passed without exercising real field access. Also fixes a used/sent+received mismatch in the monthly fixture (5422 -> 5442).
klotty
left a comment
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds a read-only Resend::Usage.get wrapper and specs for the existing /usage endpoint; it is an additive, bounded SDK surface change with no modifications to existing behavior, auth, or data handling.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Dismissed because Cubic found issues in a newer review.
Summary
Resend::Usage.get, exposing account-level usage/quotas (emails, contacts, segments, broadcasts, ai_credits, automation_runs, domains, rate_limit).Part of the
/usageGA rollout (DEV-2183). Reference implementation: resend-node#1111.Summary by cubic
Adds
Resend::Usage.getto fetch account-level usage and quota data (emails, contacts, segments, broadcasts, AI credits, automation runs, domains, and rate limit) from the/usageendpoint, and bumps the version to 1.17.0. Also fixes the spec to assert on the string-keyed nested fields the API actually returns.Written for commit b87b816. Summary will update on new commits.