// Code generated by glex; DO NOT EDIT. // Lexicon schema: com.atproto.repo.getRecord package comatproto import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type RepoGetRecord_Output struct { LexiconTypeID string `json:"$type,omitempty"` Cid *string `json:"cid,omitempty"` Uri string `json:"uri"` Value *glex.LexiconTypeDecoder `json:"value"` } // RecordTypeID implements glex.Record. func (t *RepoGetRecord_Output) RecordTypeID() string { return "com.atproto.repo.getRecord" } func (t *RepoGetRecord_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 = "com.atproto.repo.getRecord" return glex.MarshalCBOR(w, &cp) } func (t *RepoGetRecord_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // RepoGetRecord calls the XRPC method "com.atproto.repo.getRecord". // // Get a single record from a repository. Does not require auth. // // cid: The CID of the version of the record. If not specified, then return the most recent version. // collection: The NSID of the record collection. // repo: The handle or DID of the repo. // rkey: The Record Key. func RepoGetRecord(ctx context.Context, c glex.LexClient, cid string, collection string, repo string, rkey string) (*RepoGetRecord_Output, error) { var out RepoGetRecord_Output params := map[string]interface{}{} if cid != "" { params["cid"] = cid } params["collection"] = collection params["repo"] = repo params["rkey"] = rkey if err := c.LexDo(ctx, glex.Query, "", "com.atproto.repo.getRecord", params, nil, &out); err != nil { return nil, err } return &out, nil }