// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.vod.listDrafts package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type VodListDrafts_Output struct { LexiconTypeID string `json:"$type,omitempty"` // cursor: Pagination cursor for the next page, if more results exist. Cursor *string `json:"cursor,omitempty"` Drafts []VodDraftDefs_DraftView `json:"drafts"` } // RecordTypeID implements glex.Record. func (t *VodListDrafts_Output) RecordTypeID() string { return "place.stream.vod.listDrafts" } func (t *VodListDrafts_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.listDrafts" return glex.MarshalCBOR(w, &cp) } func (t *VodListDrafts_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // VodListDrafts calls the XRPC method "place.stream.vod.listDrafts". // // List the authenticated user's draft VODs, newest first. // // cursor: Pagination cursor from a previous response. // limit: Number of drafts to return. func VodListDrafts(ctx context.Context, c glex.LexClient, cursor string, limit *int64) (*VodListDrafts_Output, error) { var out VodListDrafts_Output params := map[string]interface{}{} if cursor != "" { params["cursor"] = cursor } if limit != nil { params["limit"] = *limit } if err := c.LexDo(ctx, glex.Query, "", "place.stream.vod.listDrafts", params, nil, &out); err != nil { return nil, err } return &out, nil }