From 396943f57e2fbd577c8d51f772415c30b44e132a Mon Sep 17 00:00:00 2001 From: LalitTurbot Date: Wed, 28 Jul 2021 20:26:59 +0530 Subject: [PATCH 1/2] Add memberOf property to User struct --- msgraph/models.go | 1 + msgraph/users_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/msgraph/models.go b/msgraph/models.go index c72ec74e..80286176 100644 --- a/msgraph/models.go +++ b/msgraph/models.go @@ -1047,6 +1047,7 @@ type User struct { JobTitle *StringNullWhenEmpty `json:"jobTitle,omitempty"` Mail *StringNullWhenEmpty `json:"mail,omitempty"` MailNickname *string `json:"mailNickname,omitempty"` + MemberOf *[]Group `json:"memberOf,omitempty"` MobilePhone *StringNullWhenEmpty `json:"mobilePhone,omitempty"` MySite *string `json:"mySite,omitempty"` OfficeLocation *StringNullWhenEmpty `json:"officeLocation,omitempty"` diff --git a/msgraph/users_test.go b/msgraph/users_test.go index d351b5e1..a6ff2501 100644 --- a/msgraph/users_test.go +++ b/msgraph/users_test.go @@ -107,7 +107,7 @@ func testUsersClient_Update(t *testing.T, c UsersClientTest, u msgraph.User) { } func testUsersClient_List(t *testing.T, c UsersClientTest) (users *[]msgraph.User) { - users, _, err := c.client.List(c.connection.Context, odata.Query{Top: 10}) + users, _, err := c.client.List(c.connection.Context, odata.Query{Top: 10, Expand: odata.Expand{Relationship: "memberOf"}}) if err != nil { t.Fatalf("UsersClient.List(): %v", err) } From bd82568b3864fb94b48b73ad3930cba59aa812d3 Mon Sep 17 00:00:00 2001 From: LalitTurbot Date: Thu, 29 Jul 2021 12:16:35 +0530 Subject: [PATCH 2/2] Update MemberOf reference to DirectoryObject --- msgraph/models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msgraph/models.go b/msgraph/models.go index 80286176..57902cd8 100644 --- a/msgraph/models.go +++ b/msgraph/models.go @@ -1047,7 +1047,7 @@ type User struct { JobTitle *StringNullWhenEmpty `json:"jobTitle,omitempty"` Mail *StringNullWhenEmpty `json:"mail,omitempty"` MailNickname *string `json:"mailNickname,omitempty"` - MemberOf *[]Group `json:"memberOf,omitempty"` + MemberOf *[]DirectoryObject `json:"memberOf,omitempty"` MobilePhone *StringNullWhenEmpty `json:"mobilePhone,omitempty"` MySite *string `json:"mySite,omitempty"` OfficeLocation *StringNullWhenEmpty `json:"officeLocation,omitempty"`