From 62ff21927e184f6b7e245d78e961d2aab1e534e4 Mon Sep 17 00:00:00 2001 From: jules <130390278+juleslasarte@users.noreply.github.com> Date: Wed, 27 Sep 2023 17:31:21 -0700 Subject: [PATCH] by id --- src/pkg/services/m365/groups.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pkg/services/m365/groups.go b/src/pkg/services/m365/groups.go index a32195c1c..6c659ceaf 100644 --- a/src/pkg/services/m365/groups.go +++ b/src/pkg/services/m365/groups.go @@ -54,6 +54,24 @@ func Groups( return getAllGroups(ctx, ac.Groups()) } +func GroupByID( + ctx context.Context, + acct account.Account, + id string, +) (*Group, error) { + ac, err := makeAC(ctx, acct, path.SharePointService) + if err != nil { + return nil, clues.Stack(err).WithClues(ctx) + } + + group, err := ac.Groups().GetByID(ctx, id) + if err != nil { + return nil, clues.Stack(err) + } + + return parseGroup(ctx, group) +} + func getAllGroups( ctx context.Context, ga getAller[models.Groupable],