Skip to content

feat: add broadcasts->cancel() method - #135

Merged
jayanratna merged 3 commits into
mainfrom
broadcasts-cancel
Aug 11, 2026
Merged

feat: add broadcasts->cancel() method#135
jayanratna merged 3 commits into
mainfrom
broadcasts-cancel

Conversation

@dielduarte

@dielduarte dielduarte commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Broadcast::cancel($id), calling POST /broadcasts/:id/cancel via the shared Payload::cancel() helper (already used by Email::cancel()).

Part of the broadcast cancel rollout: resend/resend-monorepo#8126, resend/resend-openapi#85, resend/resend-node#1059, resend/resend-docs#1722, resend/resend-go#144, resend/resend-java#122.

Test plan

  • vendor/bin/pest — 183/183 passing, including the new can cancel a broadcast resource case
  • php -l on touched files — clean

🤖 Generated with Claude Code


Summary by cubic

Add support to cancel a queued or scheduled broadcast via Broadcast::cancel($id) (POST /broadcasts/:id/cancel), mirroring Email::cancel(). Bumps SDK version to 1.8.0.

  • New Features

    • Added Broadcast::cancel($id) using the shared Payload::cancel() helper; returns a Broadcast resource.
    • Added test and PHPDoc for Broadcast::cancel().
  • Dependencies

    • Bumped SDK version to 1.8.0.

Written for commit 7a93e65. Summary will update on new commits.

Review in cubic

Cancels a queued or scheduled broadcast via POST /broadcasts/:id/cancel,
mirroring emails->cancel()'s use of the shared Payload::cancel() helper.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Confidence score: 4/5

  • In tests/Service/Broadcast.php, the new Broadcast::cancel() path (POST /broadcasts/{id}/cancel) introduces a fresh SDK operation that may require API-key permissions not yet validated in this test coverage, which could cause runtime 403/authorization failures for users — add an explicit permission/negative-path check (or documentation guard) for the required key scope.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/Service/Broadcast.php">

<violation number="1" location="tests/Service/Broadcast.php:65">
P2: Custom agent: **API Key Permission Check SDK Methods**

This PR introduces a new provider SDK operation, `Broadcast::cancel()` (calling `POST /broadcasts/{id}/cancel`), which is not previously used by this SDK. Since this adds a new broadcast-management permission scope, please confirm that the broadcast API keys used in production have the required permission for the `cancel` operation, so the call doesn't fail with a permission error after deployment.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

->id->toBe('559ac32e-9ef5-46fb-82a1-b76b840c0f7b');
});

it('can cancel a broadcast resource', function () {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Custom agent: API Key Permission Check SDK Methods

This PR introduces a new provider SDK operation, Broadcast::cancel() (calling POST /broadcasts/{id}/cancel), which is not previously used by this SDK. Since this adds a new broadcast-management permission scope, please confirm that the broadcast API keys used in production have the required permission for the cancel operation, so the call doesn't fail with a permission error after deployment.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/Service/Broadcast.php, line 65:

<comment>This PR introduces a new provider SDK operation, `Broadcast::cancel()` (calling `POST /broadcasts/{id}/cancel`), which is not previously used by this SDK. Since this adds a new broadcast-management permission scope, please confirm that the broadcast API keys used in production have the required permission for the `cancel` operation, so the call doesn't fail with a permission error after deployment.</comment>

<file context>
@@ -62,6 +62,15 @@
         ->id->toBe('559ac32e-9ef5-46fb-82a1-b76b840c0f7b');
 });
 
+it('can cancel a broadcast resource', function () {
+    $client = mockClient('POST', 'broadcasts/559ac32e-9ef5-46fb-82a1-b76b840c0f7b/cancel', [], [], broadcast());
+
</file context>

@jayanratna

Copy link
Copy Markdown
Collaborator

Looks good @dielduarte. Can you please add a PHPdoc for the new method? This makes it easier for developers to understand the method and refer to the docs quickly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

@jayanratna
jayanratna merged commit 6c48361 into main Aug 11, 2026
10 checks passed
@jayanratna
jayanratna deleted the broadcasts-cancel branch August 11, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants