Monorepo for Tangled
tangled.org
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.feed.listComments
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 FeedListCommentsNSID = "sh.tangled.feed.listComments"
15)
16
17// FeedListComments_ListItem is a "listItem" in the sh.tangled.feed.listComments schema.
18type FeedListComments_ListItem struct {
19 Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
20 Uri string `json:"uri" cborgen:"uri"`
21 // value: Embedded sh.tangled.feed.comment record
22 Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
23}
24
25// FeedListComments_Output is the output of a sh.tangled.feed.listComments call.
26type FeedListComments_Output struct {
27 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
28 Items []*FeedListComments_ListItem `json:"items" cborgen:"items"`
29}
30
31// FeedListComments calls the XRPC method "sh.tangled.feed.listComments".
32//
33// cursor: Pagination cursor
34// order: Sort direction by createdAt.
35// subject: Record AT-URI the comments attach to.
36func FeedListComments(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListComments_Output, error) {
37 var out FeedListComments_Output
38
39 params := map[string]interface{}{}
40 if cursor != "" {
41 params["cursor"] = cursor
42 }
43 if limit != 0 {
44 params["limit"] = limit
45 }
46 if order != "" {
47 params["order"] = order
48 }
49 params["subject"] = subject
50 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.feed.listComments", params, nil, &out); err != nil {
51 return nil, err
52 }
53
54 return &out, nil
55}