// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.vod.publishDraft package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type VodPublishDraft_Input struct { LexiconTypeID string `json:"$type,omitempty"` // uri: The ats:// URI of the draft to publish. Must have status 'ready'. Uri string `json:"uri"` } // RecordTypeID implements glex.Record. func (t *VodPublishDraft_Input) RecordTypeID() string { return "place.stream.vod.publishDraft" } func (t *VodPublishDraft_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.vod.publishDraft" return glex.MarshalCBOR(w, &cp) } func (t *VodPublishDraft_Input) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } type VodPublishDraft_Output struct { LexiconTypeID string `json:"$type,omitempty"` // videoCid: CID of the created place.stream.video record. VideoCid string `json:"videoCid"` // videoUri: AT-URI of the created place.stream.video record. VideoUri string `json:"videoUri"` } // RecordTypeID implements glex.Record. func (t *VodPublishDraft_Output) RecordTypeID() string { return "place.stream.vod.publishDraft" } func (t *VodPublishDraft_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.vod.publishDraft" return glex.MarshalCBOR(w, &cp) } func (t *VodPublishDraft_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // VodPublishDraft calls the XRPC method "place.stream.vod.publishDraft". // // Promote a ready draft VOD to a public place.stream.video record. The server carries over source and durationMs from the draft, backfills a generated thumbnail if the draft has none, writes the video record via putRecord, then deletes the draft. func VodPublishDraft(ctx context.Context, c glex.LexClient, input *VodPublishDraft_Input) (*VodPublishDraft_Output, error) { var out VodPublishDraft_Output if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.vod.publishDraft", nil, input, &out); err != nil { return nil, err } return &out, nil }