1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package atproto
4
5// schema: com.atproto.repo.listRecords
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13// RepoListRecords_Output is the output of a com.atproto.repo.listRecords call.
14type RepoListRecords_Output struct {
15 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16 Records []*RepoListRecords_Record `json:"records" cborgen:"records"`
17}
18
19// RepoListRecords_Record is a "record" in the com.atproto.repo.listRecords schema.
20type RepoListRecords_Record struct {
21 Cid string `json:"cid" cborgen:"cid"`
22 Uri string `json:"uri" cborgen:"uri"`
23 Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
24}
25
26// RepoListRecords calls the XRPC method "com.atproto.repo.listRecords".
27//
28// collection: The NSID of the record type.
29// limit: The number of records to return.
30// repo: The handle or DID of the repo.
31// reverse: Flag to reverse the order of the returned records.
32func RepoListRecords(ctx context.Context, c util.LexClient, collection string, cursor string, limit int64, repo string, reverse bool) (*RepoListRecords_Output, error) {
33 var out RepoListRecords_Output
34
35 params := map[string]interface{}{}
36 params["collection"] = collection
37 if cursor != "" {
38 params["cursor"] = cursor
39 }
40 if limit != 0 {
41 params["limit"] = limit
42 }
43 params["repo"] = repo
44 if reverse {
45 params["reverse"] = reverse
46 }
47 if err := c.LexDo(ctx, util.Query, "", "com.atproto.repo.listRecords", params, nil, &out); err != nil {
48 return nil, err
49 }
50
51 return &out, nil
52}