feat(recording): add pause and resume subcommands#12
Open
kshahbw wants to merge 1 commit into
Open
Conversation
Expose the Update Recording Voice API endpoint
(PUT /accounts/{accountId}/calls/{callId}/recording) via:
band recording pause <callId> -> {"state":"paused"}
band recording resume <callId> -> {"state":"recording"}
Closes a CLI/API parity gap. No REST stop exists for this endpoint
(StopRecording is BXML-verb-only), so only pause and resume are added.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two subcommands that expose Bandwidth's Update Recording Voice API endpoint, which the CLI did not previously surface:
Endpoint:
PUT /accounts/{accountId}/calls/{callId}/recording.Why
Closes a CLI <-> API parity gap. The Update Recording endpoint was completely unexposed by the CLI. Operators could list/get/download/delete recordings but had no way to pause or resume an in-progress recording on a live call.
Scope: pause + resume only (no stop)
There is intentionally no
stopsubcommand here. Stopping a recording is a BXML-verb-only operation (<StopRecording>); this REST endpoint only toggles betweenpausedandrecording. Adding a RESTstopwould be inventing an endpoint that doesn't exist.How
Mirrors existing patterns exactly:
cmd/recording/*commands (single<callId>arg,cmdutil.ValidateID,cmdutil.VoiceClient,cmdutil.AccountIDFlag).client.Put(path, body, result)method ininternal/api/client.go(already present, no new HTTP method needed).cmd/call/hangup.go/cmd/call/update.go, which similarly PUT/POST astateto a call.recording deletereports success.Tests
Follows the established
testutil.FakeClient+ golden-output pattern already used incmd/recording:Verification
go build ./...passesgo vet ./...passesgolangci-lint run ./cmd/recording/...-> 0 issuesgo test ./...-> all greenband recording pause --help/band recording resume --helprender correctly