MCPcopy Create free account
hub / github.com/dropbox/dbxcli / listTeamGroups

Function listTeamGroups

cmd/list-groups.go:43–62  ·  view source on GitHub ↗
(dbx teamClient, arg *team.GroupsListArg)

Source from the content-addressed store, hash-verified

41}
42
43func listTeamGroups(dbx teamClient, arg *team.GroupsListArg) ([]*team_common.GroupSummary, error) {
44 var groups []*team_common.GroupSummary
45 res, err := dbx.GroupsListContext(currentContext(), arg)
46 if err != nil {
47 return nil, err
48 }
49 groups = append(groups, res.Groups...)
50
51 for res.HasMore {
52 if res.Cursor == "" {
53 return nil, errors.New("team group list has more results but no cursor")
54 }
55 res, err = dbx.GroupsListContinueContext(currentContext(), team.NewGroupsListContinueArg(res.Cursor))
56 if err != nil {
57 return nil, err
58 }
59 groups = append(groups, res.Groups...)
60 }
61 return groups, nil
62}
63
64func renderTeamGroups(out io.Writer, groups []*team_common.GroupSummary) error {
65 if len(groups) == 0 {

Callers 1

listGroupsFunction · 0.85

Calls 3

currentContextFunction · 0.85
GroupsListContextMethod · 0.65

Tested by

no test coverage detected