feat(webhooks): add event replay endpoint
Adds WebhookSvc::replay_event for POST /webhooks/{webhook_id}/events/{event_id}/replay, next to get_event, plus the ReplayWebhookEventResponse type (re-exported from resend_rs::types). Replaying queues one more delivery of the event to the webhook, same as the dashboard's Replay button; manual replays do not schedule automatic retries.
Offered for the maintainer's review. Part of the webhook event replay rollout (DEV-2005).
pub async fn replay_event(&self, webhook_id: &str, event_id: &str) -> Result<ReplayWebhookEventResponse>
let replayed = resend
.webhooks
.replay_event(
"4dd369bc-aa82-4ff3-97de-514ae3000ee0",
"msg_1srOrx2ZWZBpBUvZwXKQmoEYga2",
)
.await?;
println!("{}", replayed.id);
References:
- Spec PR: https://github.com/resend/resend-openapi/pull/112
- Public API PR: https://github.com/resend/resend-monorepo/pull/9535
- Docs: https://resend.com/docs/api-reference/webhooks/replay-event
Checks run locally:
cargo build: okcargo fmt --check: okcargo clippy --all-targets -- -Dwarnings: ok (async,--no-default-features --features rustls-tls, and--features blocking)cargo test webhooks::(async and--features blocking): offline tests pass.webhooks::test::allneedsRESEND_API_KEYand was not run.
Not done: no live call against the endpoint (write endpoint, no key configured), so the response shape is taken from the spec PR. No new test: the response type is a two-field derive with nothing to regress, and the live all test cannot manufacture a deliverable event. No version bump, matching #101.