// Code generated by glex; DO NOT EDIT. // Lexicon schema: com.atproto.sync.listRepos package comatproto import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type SyncListRepos_Output struct { LexiconTypeID string `json:"$type,omitempty"` Cursor *string `json:"cursor,omitempty"` Repos []SyncListRepos_Repo `json:"repos"` } // RecordTypeID implements glex.Record. func (t *SyncListRepos_Output) RecordTypeID() string { return "com.atproto.sync.listRepos" } func (t *SyncListRepos_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.sync.listRepos" return glex.MarshalCBOR(w, &cp) } func (t *SyncListRepos_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // SyncListRepos calls the XRPC method "com.atproto.sync.listRepos". // // Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay. func SyncListRepos(ctx context.Context, c glex.LexClient, cursor string, limit *int64) (*SyncListRepos_Output, error) { var out SyncListRepos_Output params := map[string]interface{}{} if cursor != "" { params["cursor"] = cursor } if limit != nil { params["limit"] = *limit } if err := c.LexDo(ctx, glex.Query, "", "com.atproto.sync.listRepos", params, nil, &out); err != nil { return nil, err } return &out, nil } // SyncListRepos_Repo is a "repo" in the com.atproto.sync.listRepos schema. type SyncListRepos_Repo struct { LexiconTypeID string `json:"$type,omitempty"` Active *bool `json:"active,omitempty"` Did string `json:"did"` // head: Current repo commit CID Head string `json:"head"` Rev string `json:"rev"` // status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. Status *string `json:"status,omitempty"` } // RecordTypeID implements glex.Record. func (t *SyncListRepos_Repo) RecordTypeID() string { return "com.atproto.sync.listRepos#repo" } func (t *SyncListRepos_Repo) 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.sync.listRepos#repo" return glex.MarshalCBOR(w, &cp) } func (t *SyncListRepos_Repo) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }