fork of indigo with slightly nicer lexgen
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package atproto
4
5// schema: com.atproto.repo.getRecord
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13// RepoGetRecord_Output is the output of a com.atproto.repo.getRecord call.
14type RepoGetRecord_Output struct {
15 Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
16 Uri string `json:"uri" cborgen:"uri"`
17 Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
18}
19
20// RepoGetRecord calls the XRPC method "com.atproto.repo.getRecord".
21//
22// cid: The CID of the version of the record. If not specified, then return the most recent version.
23// collection: The NSID of the record collection.
24// repo: The handle or DID of the repo.
25// rkey: The Record Key.
26func RepoGetRecord(ctx context.Context, c util.LexClient, cid string, collection string, repo string, rkey string) (*RepoGetRecord_Output, error) {
27 var out RepoGetRecord_Output
28
29 params := map[string]interface{}{}
30 if cid != "" {
31 params["cid"] = cid
32 }
33 params["collection"] = collection
34 params["repo"] = repo
35 params["rkey"] = rkey
36 if err := c.LexDo(ctx, util.Query, "", "com.atproto.repo.getRecord", params, nil, &out); err != nil {
37 return nil, err
38 }
39
40 return &out, nil
41}