// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.vod.getComments package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type VodGetComments_Output struct { LexiconTypeID string `json:"$type,omitempty"` Comments []VodDefs_CommentView `json:"comments"` Cursor *string `json:"cursor,omitempty"` } // RecordTypeID implements glex.Record. func (t *VodGetComments_Output) RecordTypeID() string { return "place.stream.vod.getComments" } func (t *VodGetComments_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.getComments" return glex.MarshalCBOR(w, &cp) } func (t *VodGetComments_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // VodGetComments calls the XRPC method "place.stream.vod.getComments". // // Get comments for a place.stream.video record. // // cursor: Optional pagination cursor. // limit: Maximum number of comments to return. // video: AT-URI of the place.stream.video record. func VodGetComments(ctx context.Context, c glex.LexClient, cursor string, limit *int64, video string) (*VodGetComments_Output, error) { var out VodGetComments_Output params := map[string]interface{}{} if cursor != "" { params["cursor"] = cursor } if limit != nil { params["limit"] = *limit } params["video"] = video if err := c.LexDo(ctx, glex.Query, "", "place.stream.vod.getComments", params, nil, &out); err != nil { return nil, err } return &out, nil }