forked from
tangled.org/core
Monorepo for Tangled
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.repo.listCollaborators
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 RepoListCollaboratorsNSID = "sh.tangled.repo.listCollaborators"
15)
16
17// RepoListCollaborators_ListItem is a "listItem" in the sh.tangled.repo.listCollaborators schema.
18type RepoListCollaborators_ListItem struct {
19 // addedBy: DID that added this collaborator
20 AddedBy string `json:"addedBy" cborgen:"addedBy"`
21 // cid: Optional record CID for record-backed indexers
22 Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
23 // createdAt: When the collaborator was added
24 CreatedAt string `json:"createdAt" cborgen:"createdAt"`
25 // subject: DID of the collaborator
26 Subject string `json:"subject" cborgen:"subject"`
27 // uri: Optional record AT-URI for record-backed indexers
28 Uri *string `json:"uri,omitempty" cborgen:"uri,omitempty"`
29}
30
31// RepoListCollaborators_Output is the output of a sh.tangled.repo.listCollaborators call.
32type RepoListCollaborators_Output struct {
33 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
34 Items []*RepoListCollaborators_ListItem `json:"items" cborgen:"items"`
35}
36
37// RepoListCollaborators calls the XRPC method "sh.tangled.repo.listCollaborators".
38//
39// cursor: Pagination cursor
40// order: Sort direction by createdAt.
41// subject: Repo DID whose collaborator records to list.
42func RepoListCollaborators(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListCollaborators_Output, error) {
43 var out RepoListCollaborators_Output
44
45 params := map[string]interface{}{}
46 if cursor != "" {
47 params["cursor"] = cursor
48 }
49 if limit != 0 {
50 params["limit"] = limit
51 }
52 if order != "" {
53 params["order"] = order
54 }
55 params["subject"] = subject
56 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.listCollaborators", params, nil, &out); err != nil {
57 return nil, err
58 }
59
60 return &out, nil
61}