// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.getLikes package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) type GetLikes_Output struct { LexiconTypeID string `json:"$type,omitempty"` // count: Total number of likes for this subject. Count int64 `json:"count"` Cursor *string `json:"cursor,omitempty"` Likes []GetLikes_LikeView `json:"likes,omitempty"` Subject string `json:"subject"` } // RecordTypeID implements glex.Record. func (t *GetLikes_Output) RecordTypeID() string { return "place.stream.getLikes" } func (t *GetLikes_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.getLikes" return glex.MarshalCBOR(w, &cp) } func (t *GetLikes_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // GetLikes calls the XRPC method "place.stream.getLikes". // // Get likes for a subject (video or comment). // // cursor: Optional pagination cursor. // limit: Maximum number of likes to return. // subject: AT-URI of the subject (video or comment). func GetLikes(ctx context.Context, c glex.LexClient, cursor string, limit *int64, subject string) (*GetLikes_Output, error) { var out GetLikes_Output params := map[string]interface{}{} if cursor != "" { params["cursor"] = cursor } if limit != nil { params["limit"] = *limit } params["subject"] = subject if err := c.LexDo(ctx, glex.Query, "", "place.stream.getLikes", params, nil, &out); err != nil { return nil, err } return &out, nil } // GetLikes_LikeView is a "likeView" in the place.stream.getLikes schema. type GetLikes_LikeView struct { LexiconTypeID string `json:"$type,omitempty"` Author appbsky.ActorDefs_ProfileViewBasic `json:"author"` Cid string `json:"cid"` IndexedAt string `json:"indexedAt"` Record *glex.LexiconTypeDecoder `json:"record"` Uri string `json:"uri"` } // RecordTypeID implements glex.Record. func (t *GetLikes_LikeView) RecordTypeID() string { return "place.stream.getLikes#likeView" } func (t *GetLikes_LikeView) 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.getLikes#likeView" return glex.MarshalCBOR(w, &cp) } func (t *GetLikes_LikeView) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }