From 634076328c8ff5cc2b1c9a4c4e6d00f982263d99 Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Mon, 13 Feb 2023 12:42:18 -0800 Subject: [PATCH] hide fault param in Users call (#2483) ## Description Temporary change but based on the branch with the calendar ID fix. This PR should not be merged ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [ ] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Issue(s) * # ## Test Plan - [ ] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/pkg/services/m365/m365.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pkg/services/m365/m365.go b/src/pkg/services/m365/m365.go index b6564ea4d..3e4361bfa 100644 --- a/src/pkg/services/m365/m365.go +++ b/src/pkg/services/m365/m365.go @@ -20,6 +20,20 @@ type User struct { Name string } +// UsersCompat returns a list of users in the specified M365 tenant. +// TODO(ashmrtn): Remove when upstream consumers of the SDK support the fault +// package. +func UsersCompat(ctx context.Context, acct account.Account) ([]*User, error) { + errs := fault.New(true) + + users, err := Users(ctx, acct, errs) + if err != nil { + return nil, err + } + + return users, errs.Err() +} + // Users returns a list of users in the specified M365 tenant // TODO: Implement paging support func Users(ctx context.Context, acct account.Account, errs *fault.Errors) ([]*User, error) {