// Code generated by glex; DO NOT EDIT. // Lexicon schema: com.atproto.repo.listRecords package comatproto import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type RepoListRecords_Output struct { LexiconTypeID string `json:"$type,omitempty"` Cursor *string `json:"cursor,omitempty"` Records []RepoListRecords_Record `json:"records"` } // RecordTypeID implements glex.Record. func (t *RepoListRecords_Output) RecordTypeID() string { return "com.atproto.repo.listRecords" } func (t *RepoListRecords_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.listRecords" return glex.MarshalCBOR(w, &cp) } func (t *RepoListRecords_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // RepoListRecords calls the XRPC method "com.atproto.repo.listRecords". // // List a range of records in a repository, matching a specific collection. Does not require auth. // // collection: The NSID of the record type. // limit: The number of records to return. // repo: The handle or DID of the repo. // reverse: Flag to reverse the order of the returned records. func RepoListRecords(ctx context.Context, c glex.LexClient, collection string, cursor string, limit *int64, repo string, reverse *bool) (*RepoListRecords_Output, error) { var out RepoListRecords_Output params := map[string]interface{}{} if cursor != "" { params["cursor"] = cursor } if limit != nil { params["limit"] = *limit } if reverse != nil { params["reverse"] = *reverse } params["collection"] = collection params["repo"] = repo if err := c.LexDo(ctx, glex.Query, "", "com.atproto.repo.listRecords", params, nil, &out); err != nil { return nil, err } return &out, nil } // RepoListRecords_Record is a "record" in the com.atproto.repo.listRecords schema. type RepoListRecords_Record struct { LexiconTypeID string `json:"$type,omitempty"` Cid string `json:"cid"` Uri string `json:"uri"` Value *glex.LexiconTypeDecoder `json:"value"` } // RecordTypeID implements glex.Record. func (t *RepoListRecords_Record) RecordTypeID() string { return "com.atproto.repo.listRecords#record" } func (t *RepoListRecords_Record) 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.listRecords#record" return glex.MarshalCBOR(w, &cp) } func (t *RepoListRecords_Record) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }