Discard a sequence draft
client.Sequence.DiscardDraft(ctx, id, body) (*SequenceDiscardDraftResponse, error)
POST/v1/sequences/{id}/draft/discard
Discards the open draft at expectedVersion. A published sequence keeps its published version. A sequence that has never been published is deleted with its draft, and sequenceDeleted is true. Returns 404 draft_not_found when no draft is open, and 409 when expectedVersion is not the open draft’s version; retrieve the draft and retry.
Required scope: sequences:update
Rate limit category: Write
Discard a sequence draft
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
sequenceDiscardDraftResponse, err := client.Sequence.DiscardDraft(
context.TODO(),
"id",
githubcomlightfldlightfieldgo.SequenceDiscardDraftParams{
ExpectedVersion: "expectedVersion",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", sequenceDiscardDraftResponse.SequenceDeleted)
}
{
"sequenceDeleted": true,
"sequenceId": "sequenceId"
}Returns Examples
{
"sequenceDeleted": true,
"sequenceId": "sequenceId"
}