1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.knot.listKeys
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 KnotListKeysNSID = "sh.tangled.knot.listKeys"
15)
16
17// KnotListKeys_Output is the output of a sh.tangled.knot.listKeys call.
18type KnotListKeys_Output struct {
19 // cursor: Pagination cursor for next page
20 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
21 Keys []*KnotListKeys_PublicKey `json:"keys" cborgen:"keys"`
22}
23
24// KnotListKeys_PublicKey is a "publicKey" in the sh.tangled.knot.listKeys schema.
25type KnotListKeys_PublicKey struct {
26 // createdAt: Key upload timestamp
27 CreatedAt string `json:"createdAt" cborgen:"createdAt"`
28 // did: DID associated with the public key
29 Did string `json:"did" cborgen:"did"`
30 // key: Public key contents
31 Key string `json:"key" cborgen:"key"`
32}
33
34// KnotListKeys calls the XRPC method "sh.tangled.knot.listKeys".
35//
36// cursor: Pagination cursor
37// limit: Maximum number of keys to return
38func KnotListKeys(ctx context.Context, c util.LexClient, cursor string, limit int64) (*KnotListKeys_Output, error) {
39 var out KnotListKeys_Output
40
41 params := map[string]interface{}{}
42 if cursor != "" {
43 params["cursor"] = cursor
44 }
45 if limit != 0 {
46 params["limit"] = limit
47 }
48 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.knot.listKeys", params, nil, &out); err != nil {
49 return nil, err
50 }
51
52 return &out, nil
53}