// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.live.getSegments package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type LiveGetSegments_Output struct { LexiconTypeID string `json:"$type,omitempty"` Segments []Segment_SegmentView `json:"segments,omitempty"` } // RecordTypeID implements glex.Record. func (t *LiveGetSegments_Output) RecordTypeID() string { return "place.stream.live.getSegments" } func (t *LiveGetSegments_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.live.getSegments" return glex.MarshalCBOR(w, &cp) } func (t *LiveGetSegments_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // LiveGetSegments calls the XRPC method "place.stream.live.getSegments". // // # Get a list of livestream segments for a user // // userDID: The DID of the potentially-following user func LiveGetSegments(ctx context.Context, c glex.LexClient, before string, limit *int64, userDID string) (*LiveGetSegments_Output, error) { var out LiveGetSegments_Output params := map[string]interface{}{} if before != "" { params["before"] = before } if limit != nil { params["limit"] = *limit } params["userDID"] = userDID if err := c.LexDo(ctx, glex.Query, "", "place.stream.live.getSegments", params, nil, &out); err != nil { return nil, err } return &out, nil }