From ccdb672026ff46cffd6ca8e5e89b67e0fead0ca4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:45:27 +0000 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20github.com/microsof?= =?UTF-8?q?tgraph/msgraph-sdk-go=20from=201.16.0=20to=201.17.0=20in=20/src?= =?UTF-8?q?=20(#4167)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [github.com/microsoftgraph/msgraph-sdk-go](https://github.com/microsoftgraph/msgraph-sdk-go) from 1.16.0 to 1.17.0. Changelog Sourced from github.com/microsoftgraph/msgraph-sdk-go's changelog. [1.17.0]- 2023-08-30 Changed Weekly generation. Commits bd9689c Generated models and request builders (#563) See full diff in compare view [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) --- src/cmd/factory/impl/common.go | 4 +- src/cmd/sanity_test/export/onedrive.go | 2 +- src/cmd/sanity_test/export/sharepoint.go | 2 +- src/cmd/sanity_test/restore/exchange.go | 14 ++-- src/cmd/sanity_test/restore/onedrive.go | 16 ++--- src/cmd/sanity_test/restore/sharepoint.go | 2 +- src/go.mod | 2 +- src/go.sum | 4 +- .../m365/collection/exchange/restore_test.go | 4 +- .../m365/collection/site/collection_test.go | 2 +- src/internal/m365/collection/site/lists.go | 26 +++---- src/internal/m365/collection/site/restore.go | 6 +- src/internal/m365/graph/middleware_test.go | 4 +- .../operations/test/sharepoint_test.go | 16 ++--- src/pkg/services/m365/api/channels.go | 18 ++--- src/pkg/services/m365/api/channels_pager.go | 10 +-- src/pkg/services/m365/api/contacts.go | 28 ++++---- src/pkg/services/m365/api/contacts_pager.go | 21 ++++-- .../services/m365/api/contacts_pager_test.go | 8 +-- src/pkg/services/m365/api/drive.go | 36 +++++----- src/pkg/services/m365/api/drive_pager.go | 18 ++--- src/pkg/services/m365/api/drive_pager_test.go | 8 +-- src/pkg/services/m365/api/drive_test.go | 4 +- src/pkg/services/m365/api/events.go | 48 ++++++------- src/pkg/services/m365/api/events_pager.go | 10 +-- .../services/m365/api/events_pager_test.go | 4 +- src/pkg/services/m365/api/groups.go | 6 +- src/pkg/services/m365/api/lists.go | 4 +- src/pkg/services/m365/api/mail.go | 68 +++++++++---------- src/pkg/services/m365/api/mail_pager.go | 16 ++--- src/pkg/services/m365/api/mail_pager_test.go | 8 +-- src/pkg/services/m365/api/sites.go | 6 +- src/pkg/services/m365/api/users.go | 12 ++-- 33 files changed, 222 insertions(+), 215 deletions(-) diff --git a/src/cmd/factory/impl/common.go b/src/cmd/factory/impl/common.go index f6532828b..bec56762f 100644 --- a/src/cmd/factory/impl/common.go +++ b/src/cmd/factory/impl/common.go @@ -252,7 +252,7 @@ func generateAndRestoreDriveItems( d, err := ctrl.AC.Stable. Client(). Sites(). - BySiteId(protectedResource.ID()). + BySiteIdString(protectedResource.ID()). Drive(). Get(ctx, nil) if err != nil { @@ -263,7 +263,7 @@ func generateAndRestoreDriveItems( default: d, err := ctrl.AC.Stable.Client(). Users(). - ByUserId(protectedResource.ID()). + ByUserIdString(protectedResource.ID()). Drive(). Get(ctx, nil) if err != nil { diff --git a/src/cmd/sanity_test/export/onedrive.go b/src/cmd/sanity_test/export/onedrive.go index 3d5564bcc..014f89090 100644 --- a/src/cmd/sanity_test/export/onedrive.go +++ b/src/cmd/sanity_test/export/onedrive.go @@ -22,7 +22,7 @@ func CheckOneDriveExport( ) { drive, err := client. Users(). - ByUserId(userID). + ByUserIdString(userID). Drive(). Get(ctx, nil) if err != nil { diff --git a/src/cmd/sanity_test/export/sharepoint.go b/src/cmd/sanity_test/export/sharepoint.go index 55ab8ed5c..47dbd8096 100644 --- a/src/cmd/sanity_test/export/sharepoint.go +++ b/src/cmd/sanity_test/export/sharepoint.go @@ -22,7 +22,7 @@ func CheckSharePointExport( ) { drive, err := client. Sites(). - BySiteId(siteID). + BySiteIdString(siteID). Drive(). Get(ctx, nil) if err != nil { diff --git a/src/cmd/sanity_test/restore/exchange.go b/src/cmd/sanity_test/restore/exchange.go index 2dc65e6e1..60096d77c 100644 --- a/src/cmd/sanity_test/restore/exchange.go +++ b/src/cmd/sanity_test/restore/exchange.go @@ -29,7 +29,7 @@ func CheckEmailRestoration( restoreFolder models.MailFolderable itemCount = make(map[string]int32) restoreItemCount = make(map[string]int32) - builder = client.Users().ByUserId(testUser).MailFolders() + builder = client.Users().ByUserIdString(testUser).MailFolders() ) for { @@ -73,9 +73,9 @@ func CheckEmailRestoration( childFolder, err := client. Users(). - ByUserId(testUser). + ByUserIdString(testUser). MailFolders(). - ByMailFolderId(folderID). + ByMailFolderIdString(folderID). ChildFolders(). Get(ctx, nil) if err != nil { @@ -136,9 +136,9 @@ func getAllMailSubFolders( childFolder, err := client. Users(). - ByUserId(testUser). + ByUserIdString(testUser). MailFolders(). - ByMailFolderId(folderID). + ByMailFolderIdString(folderID). ChildFolders(). Get(ctx, options) if err != nil { @@ -188,9 +188,9 @@ func checkAllSubFolder( childFolder, err := client. Users(). - ByUserId(testUser). + ByUserIdString(testUser). MailFolders(). - ByMailFolderId(folderID). + ByMailFolderIdString(folderID). ChildFolders(). Get(ctx, options) if err != nil { diff --git a/src/cmd/sanity_test/restore/onedrive.go b/src/cmd/sanity_test/restore/onedrive.go index 14fa3b8cd..0b669ada4 100644 --- a/src/cmd/sanity_test/restore/onedrive.go +++ b/src/cmd/sanity_test/restore/onedrive.go @@ -27,7 +27,7 @@ func CheckOneDriveRestoration( ) { drive, err := client. Users(). - ByUserId(userID). + ByUserIdString(userID). Drive(). Get(ctx, nil) if err != nil { @@ -115,9 +115,9 @@ func PopulateDriveDetails( response, err := client. Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId("root"). + ByDriveItemIdString("root"). Children(). Get(ctx, nil) if err != nil { @@ -234,7 +234,7 @@ func getOneDriveChildFolder( folderPermission map[string][]common.PermissionInfo, startTime time.Time, ) { - response, err := client.Drives().ByDriveId(driveID).Items().ByDriveItemId(itemID).Children().Get(ctx, nil) + response, err := client.Drives().ByDriveIdString(driveID).Items().ByDriveItemIdString(itemID).Children().Get(ctx, nil) if err != nil { common.Fatal(ctx, "getting child folder", err) } @@ -283,9 +283,9 @@ func getRestoredDrive( ) { restored, err := client. Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(restoreFolderID). + ByDriveItemIdString(restoreFolderID). Children(). Get(ctx, nil) if err != nil { @@ -326,9 +326,9 @@ func permissionIn( pcr, err := client. Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). Permissions(). Get(ctx, nil) if err != nil { diff --git a/src/cmd/sanity_test/restore/sharepoint.go b/src/cmd/sanity_test/restore/sharepoint.go index a5146d7a4..c2439ff21 100644 --- a/src/cmd/sanity_test/restore/sharepoint.go +++ b/src/cmd/sanity_test/restore/sharepoint.go @@ -19,7 +19,7 @@ func CheckSharePointRestoration( ) { drive, err := client. Sites(). - BySiteId(siteID). + BySiteIdString(siteID). Drive(). Get(ctx, nil) if err != nil { diff --git a/src/go.mod b/src/go.mod index 55fddb86d..5895d880b 100644 --- a/src/go.mod +++ b/src/go.mod @@ -19,7 +19,7 @@ require ( github.com/microsoft/kiota-http-go v1.1.0 github.com/microsoft/kiota-serialization-form-go v1.0.0 github.com/microsoft/kiota-serialization-json-go v1.0.4 - github.com/microsoftgraph/msgraph-sdk-go v1.16.0 + github.com/microsoftgraph/msgraph-sdk-go v1.17.0 github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0 github.com/pkg/errors v0.9.1 github.com/puzpuzpuz/xsync/v2 v2.5.0 diff --git a/src/go.sum b/src/go.sum index 002a5b237..5fc22c282 100644 --- a/src/go.sum +++ b/src/go.sum @@ -303,8 +303,8 @@ github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJy github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so= github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0jlETWnWrEum0RhmbYrTFnA= github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M= -github.com/microsoftgraph/msgraph-sdk-go v1.16.0 h1:6YjL2f8PZFlJUuCoX1yJwhDFYKPtogxYr/SnKJHAHZ4= -github.com/microsoftgraph/msgraph-sdk-go v1.16.0/go.mod h1:DdshtIL3VJ3abSG6O+gmlvbc/pX7Xh7xbruLTWoRjfU= +github.com/microsoftgraph/msgraph-sdk-go v1.17.0 h1:ODua+yyogMmYos5ihqK90fQ01yaj+S2A+pM2MYxzjJ8= +github.com/microsoftgraph/msgraph-sdk-go v1.17.0/go.mod h1:DdshtIL3VJ3abSG6O+gmlvbc/pX7Xh7xbruLTWoRjfU= github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0 h1:7NWTfyXvOjoizW7PmxNp3+8wCKPgpODs/D1cUZ3fkAY= github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0/go.mod h1:tQb4q3YMIj2dWhhXhQSJ4ELpol931ANKzHSYK5kX1qE= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= diff --git a/src/internal/m365/collection/exchange/restore_test.go b/src/internal/m365/collection/exchange/restore_test.go index ac34946f4..4862dbfb9 100644 --- a/src/internal/m365/collection/exchange/restore_test.go +++ b/src/internal/m365/collection/exchange/restore_test.go @@ -425,9 +425,9 @@ func (suite *RestoreIntgSuite) TestRestoreAndBackupEvent_recurringInstancesWithA ec, err := handler.ac.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(calendarID). + ByCalendarIdString(calendarID). Events(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(err)) diff --git a/src/internal/m365/collection/site/collection_test.go b/src/internal/m365/collection/site/collection_test.go index 390d5cd14..1549448d4 100644 --- a/src/internal/m365/collection/site/collection_test.go +++ b/src/internal/m365/collection/site/collection_test.go @@ -221,7 +221,7 @@ func (suite *SharePointCollectionSuite) TestListCollection_Restore() { // Clean-Up var ( - builder = service.Client().Sites().BySiteId(suite.siteID).Lists() + builder = service.Client().Sites().BySiteIdString(suite.siteID).Lists() isFound bool deleteID string ) diff --git a/src/internal/m365/collection/site/lists.go b/src/internal/m365/collection/site/lists.go index e717f8d67..8bbc615cb 100644 --- a/src/internal/m365/collection/site/lists.go +++ b/src/internal/m365/collection/site/lists.go @@ -57,7 +57,7 @@ func PreFetchLists( siteID string, ) ([]ListTuple, error) { var ( - builder = gs.Client().Sites().BySiteId(siteID).Lists() + builder = gs.Client().Sites().BySiteIdString(siteID).Lists() options = preFetchListOptions() listTuples = make([]ListTuple, 0) ) @@ -149,7 +149,7 @@ func loadSiteLists( err error ) - entry, err = gs.Client().Sites().BySiteId(siteID).Lists().ByListId(id).Get(ctx, nil) + entry, err = gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(id).Get(ctx, nil) if err != nil { el.AddRecoverable(ctx, graph.Wrap(ctx, err, "getting site list")) return @@ -216,7 +216,7 @@ func fetchListItems( errs *fault.Bus, ) ([]models.ListItemable, error) { var ( - prefix = gs.Client().Sites().BySiteId(siteID).Lists().ByListId(listID) + prefix = gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(listID) builder = prefix.Items() itms = make([]models.ListItemable, 0) el = errs.Local() @@ -237,7 +237,7 @@ func fetchListItems( break } - newPrefix := prefix.Items().ByListItemId(ptr.Val(itm.GetId())) + newPrefix := prefix.Items().ByListItemIdString(ptr.Val(itm.GetId())) fields, err := newPrefix.Fields().Get(ctx, nil) if err != nil { @@ -273,7 +273,7 @@ func fetchColumns( cs := make([]models.ColumnDefinitionable, 0) if len(cTypeID) == 0 { - builder := gs.Client().Sites().BySiteId(siteID).Lists().ByListId(listID).Columns() + builder := gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(listID).Columns() for { resp, err := builder.Get(ctx, nil) @@ -293,11 +293,11 @@ func fetchColumns( } else { builder := gs.Client(). Sites(). - BySiteId(siteID). + BySiteIdString(siteID). Lists(). - ByListId(listID). + ByListIdString(listID). ContentTypes(). - ByContentTypeId(cTypeID). + ByContentTypeIdString(cTypeID). Columns() for { @@ -335,7 +335,7 @@ func fetchContentTypes( var ( el = errs.Local() cTypes = make([]models.ContentTypeable, 0) - builder = gs.Client().Sites().BySiteId(siteID).Lists().ByListId(listID).ContentTypes() + builder = gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(listID).ContentTypes() ) for { @@ -393,11 +393,11 @@ func fetchColumnLinks( var ( builder = gs.Client(). Sites(). - BySiteId(siteID). + BySiteIdString(siteID). Lists(). - ByListId(listID). + ByListIdString(listID). ContentTypes(). - ByContentTypeId(cTypeID). + ByContentTypeIdString(cTypeID). ColumnLinks() links = make([]models.ColumnLinkable, 0) ) @@ -431,7 +431,7 @@ func DeleteList( gs graph.Servicer, siteID, listID string, ) error { - err := gs.Client().Sites().BySiteId(siteID).Lists().ByListId(listID).Delete(ctx, nil) + err := gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(listID).Delete(ctx, nil) if err != nil { return graph.Wrap(ctx, err, "deleting list") } diff --git a/src/internal/m365/collection/site/restore.go b/src/internal/m365/collection/site/restore.go index c83dd6290..564d10e7a 100644 --- a/src/internal/m365/collection/site/restore.go +++ b/src/internal/m365/collection/site/restore.go @@ -177,7 +177,7 @@ func restoreListItem( newList.SetItems(contents) // Restore to List base to M365 back store - restoredList, err := service.Client().Sites().BySiteId(siteID).Lists().Post(ctx, newList, nil) + restoredList, err := service.Client().Sites().BySiteIdString(siteID).Lists().Post(ctx, newList, nil) if err != nil { return dii, graph.Wrap(ctx, err, "restoring list") } @@ -188,9 +188,9 @@ func restoreListItem( for _, lItem := range contents { _, err := service.Client(). Sites(). - BySiteId(siteID). + BySiteIdString(siteID). Lists(). - ByListId(ptr.Val(restoredList.GetId())). + ByListIdString(ptr.Val(restoredList.GetId())). Items(). Post(ctx, lItem, nil) if err != nil { diff --git a/src/internal/m365/graph/middleware_test.go b/src/internal/m365/graph/middleware_test.go index a85e98605..d03119acf 100644 --- a/src/internal/m365/graph/middleware_test.go +++ b/src/internal/m365/graph/middleware_test.go @@ -289,7 +289,7 @@ func (suite *RetryMWIntgSuite) TestRetryMiddleware_RetryRequest_resetBodyAfter50 _, err = NewService(adpt). Client(). Users(). - ByUserId("user"). + ByUserIdString("user"). MailFolders(). Post(ctx, body, nil) require.NoError(t, err, clues.ToCore(err)) @@ -326,7 +326,7 @@ func (suite *RetryMWIntgSuite) TestRetryMiddleware_RetryResponse_maintainBodyAft _, err = NewService(adpt). Client(). Users(). - ByUserId("user"). + ByUserIdString("user"). MailFolders(). Post(ctx, models.NewMailFolder(), nil) require.Error(t, err, clues.ToCore(err)) diff --git a/src/internal/operations/test/sharepoint_test.go b/src/internal/operations/test/sharepoint_test.go index 8ab7d3e4d..525e83ede 100644 --- a/src/internal/operations/test/sharepoint_test.go +++ b/src/internal/operations/test/sharepoint_test.go @@ -305,7 +305,7 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete md, err = graphClient. Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Patch(ctx, patchBody, nil) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) @@ -330,9 +330,9 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete resp, err := graphClient. Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(rootFolderID). + ByDriveItemIdString(rootFolderID). Children(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) @@ -356,7 +356,7 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete err = graphClient. Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Delete(ctx, nil) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) @@ -407,9 +407,9 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete resp, err := graphClient. Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(rootFolderID). + ByDriveItemIdString(rootFolderID). Children(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) @@ -450,9 +450,9 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete resp, err := graphClient. Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(rootFolderID). + ByDriveItemIdString(rootFolderID). Children(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) diff --git a/src/pkg/services/m365/api/channels.go b/src/pkg/services/m365/api/channels.go index d48b59d3d..4e99480c7 100644 --- a/src/pkg/services/m365/api/channels.go +++ b/src/pkg/services/m365/api/channels.go @@ -46,9 +46,9 @@ func (c Channels) GetChannel( resp, err := c.Stable. Client(). Teams(). - ByTeamId(teamID). + ByTeamIdString(teamID). Channels(). - ByChannelId(containerID). + ByChannelIdString(containerID). Get(ctx, config) if err != nil { return nil, graph.Stack(ctx, err) @@ -74,7 +74,7 @@ func (c Channels) GetChannelByName( resp, err := c.Stable. Client(). Teams(). - ByTeamId(teamID). + ByTeamIdString(teamID). Channels(). Get(ctx, options) if err != nil { @@ -115,11 +115,11 @@ func (c Channels) GetMessage( message, err := c.Stable. Client(). Teams(). - ByTeamId(teamID). + ByTeamIdString(teamID). Channels(). - ByChannelId(channelID). + ByChannelIdString(channelID). Messages(). - ByChatMessageId(itemID). + ByChatMessageIdString(itemID). Get(ctx, nil) if err != nil { return nil, nil, graph.Stack(ctx, err) @@ -140,11 +140,11 @@ func (c Channels) GetReplies( replies, err := c.Stable. Client(). Teams(). - ByTeamId(teamID). + ByTeamIdString(teamID). Channels(). - ByChannelId(channelID). + ByChannelIdString(channelID). Messages(). - ByChatMessageId(messageID). + ByChatMessageIdString(messageID). Replies(). Get(ctx, nil) if err != nil { diff --git a/src/pkg/services/m365/api/channels_pager.go b/src/pkg/services/m365/api/channels_pager.go index f7b7ccc43..eeaa41486 100644 --- a/src/pkg/services/m365/api/channels_pager.go +++ b/src/pkg/services/m365/api/channels_pager.go @@ -39,9 +39,9 @@ func (p *channelMessageDeltaPageCtrl) Reset(context.Context) { p.builder = p.gs. Client(). Teams(). - ByTeamId(p.resourceID). + ByTeamIdString(p.resourceID). Channels(). - ByChannelId(p.channelID). + ByChannelIdString(p.channelID). Messages(). Delta() } @@ -56,9 +56,9 @@ func (c Channels) NewChannelMessageDeltaPager( builder := c.Stable. Client(). Teams(). - ByTeamId(teamID). + ByTeamIdString(teamID). Channels(). - ByChannelId(channelID). + ByChannelIdString(channelID). Messages(). Delta() @@ -179,7 +179,7 @@ func (c Channels) NewChannelPager( builder: c.Stable. Client(). Teams(). - ByTeamId(teamID). + ByTeamIdString(teamID). Channels(), } diff --git a/src/pkg/services/m365/api/contacts.go b/src/pkg/services/m365/api/contacts.go index e2401c9fd..4f89c88ec 100644 --- a/src/pkg/services/m365/api/contacts.go +++ b/src/pkg/services/m365/api/contacts.go @@ -46,7 +46,7 @@ func (c Contacts) CreateContainer( mdl, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). Post(ctx, body, nil) if err != nil { @@ -71,9 +71,9 @@ func (c Contacts) DeleteContainer( err = srv. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). - ByContactFolderId(containerID). + ByContactFolderIdString(containerID). Delete(ctx, nil) if err != nil { return graph.Stack(ctx, err) @@ -95,9 +95,9 @@ func (c Contacts) GetContainerByID( resp, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). - ByContactFolderId(containerID). + ByContactFolderIdString(containerID). Get(ctx, config) if err != nil { return nil, graph.Stack(ctx, err) @@ -124,7 +124,7 @@ func (c Contacts) GetContainerByName( resp, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). Get(ctx, options) if err != nil { @@ -164,9 +164,9 @@ func (c Contacts) PatchFolder( _, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). - ByContactFolderId(containerID). + ByContactFolderIdString(containerID). Patch(ctx, body, nil) if err != nil { return graph.Wrap(ctx, err, "patching contact folder") @@ -193,9 +193,9 @@ func (c Contacts) GetItem( cont, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Contacts(). - ByContactId(itemID). + ByContactIdString(itemID). Get(ctx, options) if err != nil { return nil, nil, graph.Stack(ctx, err) @@ -212,9 +212,9 @@ func (c Contacts) PostItem( itm, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). - ByContactFolderId(containerID). + ByContactFolderIdString(containerID). Contacts(). Post(ctx, body, nil) if err != nil { @@ -238,9 +238,9 @@ func (c Contacts) DeleteItem( err = srv. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Contacts(). - ByContactId(itemID). + ByContactIdString(itemID). Delete(ctx, nil) if err != nil { return graph.Wrap(ctx, err, "deleting contact") diff --git a/src/pkg/services/m365/api/contacts_pager.go b/src/pkg/services/m365/api/contacts_pager.go index 3d973cc0c..4d8513b7e 100644 --- a/src/pkg/services/m365/api/contacts_pager.go +++ b/src/pkg/services/m365/api/contacts_pager.go @@ -38,9 +38,9 @@ func (c Contacts) EnumerateContainers( builder := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). - ByContactFolderId(baseContainerID). + ByContactFolderIdString(baseContainerID). ChildFolders() for { @@ -115,9 +115,9 @@ func (c Contacts) NewContactsPager( builder := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). - ByContactFolderId(containerID). + ByContactFolderIdString(containerID). Contacts() return &contactsPageCtrl{c.Stable, builder, options} @@ -209,9 +209,9 @@ func (c Contacts) NewContactIDsPager( builder := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). ContactFolders(). - ByContactFolderId(containerID). + ByContactFolderIdString(containerID). Contacts() return &contactIDPager{c.Stable, builder, config} @@ -257,7 +257,14 @@ func getContactDeltaBuilder( userID, containerID string, options *users.ItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration, ) *users.ItemContactFoldersItemContactsDeltaRequestBuilder { - builder := gs.Client().Users().ByUserId(userID).ContactFolders().ByContactFolderId(containerID).Contacts().Delta() + builder := gs.Client(). + Users(). + ByUserIdString(userID). + ContactFolders(). + ByContactFolderIdString(containerID). + Contacts(). + Delta() + return builder } diff --git a/src/pkg/services/m365/api/contacts_pager_test.go b/src/pkg/services/m365/api/contacts_pager_test.go index 5d859cd12..e5fb4fea7 100644 --- a/src/pkg/services/m365/api/contacts_pager_test.go +++ b/src/pkg/services/m365/api/contacts_pager_test.go @@ -45,9 +45,9 @@ func (suite *ContactsPagerIntgSuite) TestContacts_GetItemsInContainerByCollision conts, err := ac.Stable. Client(). Users(). - ByUserId(suite.its.user.id). + ByUserIdString(suite.its.user.id). ContactFolders(). - ByContactFolderId(ptr.Val(container.GetId())). + ByContactFolderIdString(ptr.Val(container.GetId())). Contacts(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(err)) @@ -97,9 +97,9 @@ func (suite *ContactsPagerIntgSuite) TestContacts_GetItemsIDsInContainer() { msgs, err := ac.Stable. Client(). Users(). - ByUserId(suite.its.user.id). + ByUserIdString(suite.its.user.id). ContactFolders(). - ByContactFolderId(ptr.Val(container.GetId())). + ByContactFolderIdString(ptr.Val(container.GetId())). Contacts(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(err)) diff --git a/src/pkg/services/m365/api/drive.go b/src/pkg/services/m365/api/drive.go index e40d7497a..318c783c0 100644 --- a/src/pkg/services/m365/api/drive.go +++ b/src/pkg/services/m365/api/drive.go @@ -74,7 +74,7 @@ func (c Drives) GetRootFolder( root, err := c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Root(). Get(ctx, nil) if err != nil { @@ -96,9 +96,9 @@ func (c Drives) GetItem( di, err := c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). Get(ctx, nil) if err != nil { return nil, graph.Wrap(ctx, err, "getting item") @@ -116,9 +116,9 @@ func (c Drives) NewItemContentUpload( r, err := c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). CreateUploadSession(). Post(ctx, session, nil) if err != nil { @@ -180,9 +180,9 @@ func (c Drives) PatchItem( _, err := c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). Patch(ctx, item, nil) if err != nil { return graph.Wrap(ctx, err, "patching drive item") @@ -199,9 +199,9 @@ func (c Drives) PutItemContent( _, err := c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). Content(). Put(ctx, content, nil) if err != nil { @@ -227,9 +227,9 @@ func (c Drives) DeleteItem( err = srv. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). Delete(ctx, nil) if err != nil { return graph.Wrap(ctx, err, "deleting item").With("item_id", itemID) @@ -249,9 +249,9 @@ func (c Drives) GetItemPermission( perm, err := c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). Permissions(). Get(ctx, nil) if err != nil { @@ -271,9 +271,9 @@ func (c Drives) PostItemPermissionUpdate( itm, err := c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). Invite(). Post(ctx, body, nil) if err != nil { @@ -297,11 +297,11 @@ func (c Drives) DeleteItemPermission( err = srv. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(itemID). + ByDriveItemIdString(itemID). Permissions(). - ByPermissionId(permissionID). + ByPermissionIdString(permissionID). Delete(graph.ConsumeNTokens(ctx, graph.PermissionsLC), nil) if err != nil { return graph.Wrap(ctx, err, "deleting drive item permission") diff --git a/src/pkg/services/m365/api/drive_pager.go b/src/pkg/services/m365/api/drive_pager.go index 1aa485200..4ebae8691 100644 --- a/src/pkg/services/m365/api/drive_pager.go +++ b/src/pkg/services/m365/api/drive_pager.go @@ -44,9 +44,9 @@ func (c Drives) NewDriveItemPager( builder := c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(containerID). + ByDriveItemIdString(containerID). Children() return &driveItemPageCtrl{c.Stable, builder, options} @@ -158,9 +158,9 @@ func (c Drives) NewDriveItemDeltaPager( builder: c.Stable. Client(). Drives(). - ByDriveId(driveID). + ByDriveIdString(driveID). Items(). - ByDriveItemId(onedrive.RootID). + ByDriveItemIdString(onedrive.RootID). Delta(), } @@ -192,9 +192,9 @@ func (p *DriveItemDeltaPageCtrl) SetNext(link string) { func (p *DriveItemDeltaPageCtrl) Reset(context.Context) { p.builder = p.gs.Client(). Drives(). - ByDriveId(p.driveID). + ByDriveIdString(p.driveID). Items(). - ByDriveItemId(onedrive.RootID). + ByDriveItemIdString(onedrive.RootID). Delta() } @@ -232,7 +232,7 @@ func (c Drives) NewUserDrivePager( builder: c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Drives(), } @@ -254,7 +254,7 @@ func (p *userDrivePager) GetPage(ctx context.Context) (PageLinker, error) { d, err := p.gs. Client(). Users(). - ByUserId(p.userID). + ByUserIdString(p.userID). Drive(). Get(ctx, nil) if err != nil { @@ -325,7 +325,7 @@ func (c Drives) NewSiteDrivePager( builder: c.Stable. Client(). Sites(). - BySiteId(siteID). + BySiteIdString(siteID). Drives(), } diff --git a/src/pkg/services/m365/api/drive_pager_test.go b/src/pkg/services/m365/api/drive_pager_test.go index f28277eee..370cacbbf 100644 --- a/src/pkg/services/m365/api/drive_pager_test.go +++ b/src/pkg/services/m365/api/drive_pager_test.go @@ -61,9 +61,9 @@ func (suite *DrivePagerIntgSuite) TestDrives_GetItemsInContainerByCollisionKey() items, err := suite.its.ac.Stable. Client(). Drives(). - ByDriveId(test.driveID). + ByDriveIdString(test.driveID). Items(). - ByDriveItemId(test.rootFolderID). + ByDriveItemIdString(test.rootFolderID). Children(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(err)) @@ -135,9 +135,9 @@ func (suite *DrivePagerIntgSuite) TestDrives_GetItemIDsInContainer() { items, err := suite.its.ac.Stable. Client(). Drives(). - ByDriveId(test.driveID). + ByDriveIdString(test.driveID). Items(). - ByDriveItemId(test.rootFolderID). + ByDriveItemIdString(test.rootFolderID). Children(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(err)) diff --git a/src/pkg/services/m365/api/drive_test.go b/src/pkg/services/m365/api/drive_test.go index 28173c27a..089cfb99c 100644 --- a/src/pkg/services/m365/api/drive_test.go +++ b/src/pkg/services/m365/api/drive_test.go @@ -274,9 +274,9 @@ func (suite *DriveAPIIntgSuite) TestDrives_PostItemInContainer_replaceFolderRegr resultFileColl, err := acd.Stable. Client(). Drives(). - ByDriveId(suite.its.user.driveID). + ByDriveIdString(suite.its.user.driveID). Items(). - ByDriveItemId(ptr.Val(resultFolder.GetId())). + ByDriveItemIdString(ptr.Val(resultFolder.GetId())). Children(). Get(ctx, nil) err = graph.Stack(ctx, err).OrNil() diff --git a/src/pkg/services/m365/api/events.go b/src/pkg/services/m365/api/events.go index 2bc1392dc..5ae03692e 100644 --- a/src/pkg/services/m365/api/events.go +++ b/src/pkg/services/m365/api/events.go @@ -55,7 +55,7 @@ func (c Events) CreateContainer( container, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). Post(ctx, body, nil) if err != nil { @@ -80,9 +80,9 @@ func (c Events) DeleteContainer( err = srv.Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(containerID). + ByCalendarIdString(containerID). Delete(ctx, nil) if err != nil { return graph.Stack(ctx, err) @@ -104,9 +104,9 @@ func (c Events) GetContainerByID( resp, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(containerID). + ByCalendarIdString(containerID). Get(ctx, config) if err != nil { return nil, graph.Stack(ctx, err) @@ -133,7 +133,7 @@ func (c Events) GetContainerByName( resp, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). Get(ctx, options) if err != nil { @@ -169,9 +169,9 @@ func (c Events) PatchCalendar( _, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(containerID). + ByCalendarIdString(containerID). Patch(ctx, body, nil) if err != nil { return graph.Wrap(ctx, err, "patching event calendar") @@ -380,9 +380,9 @@ func (c Events) GetAttachments( attached, err := c.LargeItem. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Events(). - ByEventId(itemID). + ByEventIdString(itemID). Attachments(). Get(ctx, config) if err != nil { @@ -399,13 +399,13 @@ func (c Events) DeleteAttachment( return c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(calendarID). + ByCalendarIdString(calendarID). Events(). - ByEventId(eventID). + ByEventIdString(eventID). Attachments(). - ByAttachmentId(attachmentID). + ByAttachmentIdString(attachmentID). Delete(ctx, nil) } @@ -424,9 +424,9 @@ func (c Events) GetItemInstances( events, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Events(). - ByEventId(itemID). + ByEventIdString(itemID). Instances(). Get(ctx, config) if err != nil { @@ -482,9 +482,9 @@ func (c Events) DeleteItem( err = srv. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Events(). - ByEventId(itemID). + ByEventIdString(itemID). Delete(ctx, nil) if err != nil { return graph.Wrap(ctx, err, "deleting calendar event") @@ -501,11 +501,11 @@ func (c Events) PostSmallAttachment( _, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(containerID). + ByCalendarIdString(containerID). Events(). - ByEventId(parentItemID). + ByEventIdString(parentItemID). Attachments(). Post(ctx, body, nil) if err != nil { @@ -527,11 +527,11 @@ func (c Events) PostLargeAttachment( us, err := c.LargeItem. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(containerID). + ByCalendarIdString(containerID). Events(). - ByEventId(parentItemID). + ByEventIdString(parentItemID). Attachments(). CreateUploadSession(). Post(ctx, session, nil) diff --git a/src/pkg/services/m365/api/events_pager.go b/src/pkg/services/m365/api/events_pager.go index 55e227d58..05cdc380c 100644 --- a/src/pkg/services/m365/api/events_pager.go +++ b/src/pkg/services/m365/api/events_pager.go @@ -43,7 +43,7 @@ func (c Events) EnumerateContainers( builder = c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars() ) @@ -124,9 +124,9 @@ func (c Events) NewEventsPager( builder := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(containerID). + ByCalendarIdString(containerID). Events() return &eventsPageCtrl{c.Stable, builder, options} @@ -196,9 +196,9 @@ func (c Events) NewEventIDsPager( builder := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Calendars(). - ByCalendarId(containerID). + ByCalendarIdString(containerID). Events() return &eventIDPager{c.Stable, builder, options}, nil diff --git a/src/pkg/services/m365/api/events_pager_test.go b/src/pkg/services/m365/api/events_pager_test.go index 610b449af..e1100d33f 100644 --- a/src/pkg/services/m365/api/events_pager_test.go +++ b/src/pkg/services/m365/api/events_pager_test.go @@ -45,9 +45,9 @@ func (suite *EventsPagerIntgSuite) TestEvents_GetItemsInContainerByCollisionKey( evts, err := ac.Stable. Client(). Users(). - ByUserId(suite.its.user.id). + ByUserIdString(suite.its.user.id). Calendars(). - ByCalendarId(ptr.Val(container.GetId())). + ByCalendarIdString(ptr.Val(container.GetId())). Events(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(err)) diff --git a/src/pkg/services/m365/api/groups.go b/src/pkg/services/m365/api/groups.go index 7a3a134f7..abb601bdf 100644 --- a/src/pkg/services/m365/api/groups.go +++ b/src/pkg/services/m365/api/groups.go @@ -106,7 +106,7 @@ func (c Groups) GetByID( return nil, err } - resp, err := service.Client().Groups().ByGroupId(identifier).Get(ctx, nil) + resp, err := service.Client().Groups().ByGroupIdString(identifier).Get(ctx, nil) if err != nil { err := graph.Wrap(ctx, err, "getting group by id") @@ -129,9 +129,9 @@ func (c Groups) GetRootSite( resp, err := service. Client(). Groups(). - ByGroupId(identifier). + ByGroupIdString(identifier). Sites(). - BySiteId("root"). + BySiteIdString("root"). Get(ctx, nil) if err != nil { return nil, clues.Wrap(err, "getting root site for group") diff --git a/src/pkg/services/m365/api/lists.go b/src/pkg/services/m365/api/lists.go index fb6abaa48..1784cebc3 100644 --- a/src/pkg/services/m365/api/lists.go +++ b/src/pkg/services/m365/api/lists.go @@ -42,7 +42,7 @@ func (c Lists) PostDrive( builder := c.Stable. Client(). Sites(). - BySiteId(siteID). + BySiteIdString(siteID). Lists() newList, err := builder.Post(ctx, list, nil) @@ -56,7 +56,7 @@ func (c Lists) PostDrive( // drive information is not returned by the list creation. drive, err := builder. - ByListId(ptr.Val(newList.GetId())). + ByListIdString(ptr.Val(newList.GetId())). Drive(). Get(ctx, nil) diff --git a/src/pkg/services/m365/api/mail.go b/src/pkg/services/m365/api/mail.go index 14762a192..047f6098e 100644 --- a/src/pkg/services/m365/api/mail.go +++ b/src/pkg/services/m365/api/mail.go @@ -53,9 +53,9 @@ func (c Mail) CreateContainer( mdl, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(parentContainerID). + ByMailFolderIdString(parentContainerID). ChildFolders(). Post(ctx, body, nil) if err != nil { @@ -80,9 +80,9 @@ func (c Mail) DeleteContainer( err = srv.Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Delete(ctx, nil) if err != nil { return graph.Stack(ctx, err) @@ -104,9 +104,9 @@ func (c Mail) GetContainerByID( resp, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Get(ctx, config) if err != nil { return nil, graph.Stack(ctx, err) @@ -128,7 +128,7 @@ func (c Mail) GetContainerByName( builder = c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders() resp models.MailFolderCollectionResponseable err error @@ -142,7 +142,7 @@ func (c Mail) GetContainerByName( } resp, err = builder. - ByMailFolderId(parentContainerID). + ByMailFolderIdString(parentContainerID). ChildFolders(). Get(ctx, options) } else { @@ -192,9 +192,9 @@ func (c Mail) MoveContainer( _, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Move(). Post(ctx, body, nil) if err != nil { @@ -212,9 +212,9 @@ func (c Mail) PatchFolder( _, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Patch(ctx, body, nil) if err != nil { return graph.Wrap(ctx, err, "patching mail folder") @@ -246,9 +246,9 @@ func (c Mail) GetItem( mail, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Messages(). - ByMessageId(itemID). + ByMessageIdString(itemID). Get(ctx, config) if err != nil { return nil, nil, graph.Stack(ctx, err) @@ -276,9 +276,9 @@ func (c Mail) GetItem( attached, err := c.LargeItem. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Messages(). - ByMessageId(itemID). + ByMessageIdString(itemID). Attachments(). Get(ctx, attachConfig) if err == nil { @@ -309,9 +309,9 @@ func (c Mail) GetItem( attachments, err := c.LargeItem. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Messages(). - ByMessageId(itemID). + ByMessageIdString(itemID). Attachments(). Get(ctx, attachConfig) if err != nil { @@ -331,11 +331,11 @@ func (c Mail) GetItem( att, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Messages(). - ByMessageId(itemID). + ByMessageIdString(itemID). Attachments(). - ByAttachmentId(ptr.Val(a.GetId())). + ByAttachmentIdString(ptr.Val(a.GetId())). Get(ctx, attachConfig) if err != nil { // CannotOpenFileAttachment errors are not transient and @@ -377,9 +377,9 @@ func (c Mail) PostItem( itm, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Messages(). Post(ctx, body, nil) if err != nil { @@ -403,11 +403,11 @@ func (c Mail) MoveItem( resp, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(oldContainerID). + ByMailFolderIdString(oldContainerID). Messages(). - ByMessageId(itemID). + ByMessageIdString(itemID). Move(). Post(ctx, body, nil) if err != nil { @@ -431,9 +431,9 @@ func (c Mail) DeleteItem( err = srv. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Messages(). - ByMessageId(itemID). + ByMessageIdString(itemID). Delete(ctx, nil) if err != nil { return graph.Wrap(ctx, err, "deleting mail message") @@ -450,11 +450,11 @@ func (c Mail) PostSmallAttachment( _, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Messages(). - ByMessageId(parentItemID). + ByMessageIdString(parentItemID). Attachments(). Post(ctx, body, nil) if err != nil { @@ -476,11 +476,11 @@ func (c Mail) PostLargeAttachment( us, err := c.LargeItem. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Messages(). - ByMessageId(parentItemID). + ByMessageIdString(parentItemID). Attachments(). CreateUploadSession(). Post(ctx, session, nil) diff --git a/src/pkg/services/m365/api/mail_pager.go b/src/pkg/services/m365/api/mail_pager.go index 634a89095..8498d2d4e 100644 --- a/src/pkg/services/m365/api/mail_pager.go +++ b/src/pkg/services/m365/api/mail_pager.go @@ -147,9 +147,9 @@ func (c Mail) NewMailPager( builder := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Messages() return &mailPageCtrl{c.Stable, builder, options} @@ -198,9 +198,9 @@ func (c Mail) NewMailIDsPager( builder := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Messages() return &mailIDPager{c.Stable, builder, config} @@ -291,9 +291,9 @@ func getMailDeltaBuilder( builder := gs. Client(). Users(). - ByUserId(user). + ByUserIdString(user). MailFolders(). - ByMailFolderId(containerID). + ByMailFolderIdString(containerID). Messages(). Delta() @@ -341,9 +341,9 @@ func (p *mailDeltaIDPager) Reset(ctx context.Context) { p.builder = p.gs. Client(). Users(). - ByUserId(p.userID). + ByUserIdString(p.userID). MailFolders(). - ByMailFolderId(p.containerID). + ByMailFolderIdString(p.containerID). Messages(). Delta() } diff --git a/src/pkg/services/m365/api/mail_pager_test.go b/src/pkg/services/m365/api/mail_pager_test.go index 7f367de1d..cc0d18555 100644 --- a/src/pkg/services/m365/api/mail_pager_test.go +++ b/src/pkg/services/m365/api/mail_pager_test.go @@ -46,9 +46,9 @@ func (suite *MailPagerIntgSuite) TestMail_GetItemsInContainerByCollisionKey() { msgs, err := ac.Stable. Client(). Users(). - ByUserId(suite.its.user.id). + ByUserIdString(suite.its.user.id). MailFolders(). - ByMailFolderId(ptr.Val(container.GetId())). + ByMailFolderIdString(ptr.Val(container.GetId())). Messages(). Get(ctx, nil) require.NoError(t, err, clues.ToCore(err)) @@ -101,9 +101,9 @@ func (suite *MailPagerIntgSuite) TestMail_GetItemsIDsInContainer() { msgs, err := ac.Stable. Client(). Users(). - ByUserId(suite.its.user.id). + ByUserIdString(suite.its.user.id). MailFolders(). - ByMailFolderId(api.MailInbox). + ByMailFolderIdString(api.MailInbox). Messages(). Get(ctx, config) require.NoError(t, err, clues.ToCore(err)) diff --git a/src/pkg/services/m365/api/sites.go b/src/pkg/services/m365/api/sites.go index 4e13ebcfb..7cbc2b1b0 100644 --- a/src/pkg/services/m365/api/sites.go +++ b/src/pkg/services/m365/api/sites.go @@ -39,7 +39,7 @@ func (c Sites) GetRoot(ctx context.Context) (models.Siteable, error) { resp, err := c.Stable. Client(). Sites(). - BySiteId("root"). + BySiteIdString("root"). Get(ctx, nil) if err != nil { return nil, graph.Wrap(ctx, err, "getting root site") @@ -120,7 +120,7 @@ func (c Sites) GetByID(ctx context.Context, identifier string) (models.Siteable, resp, err = c.Stable. Client(). Sites(). - BySiteId(identifier). + BySiteIdString(identifier). Get(ctx, nil) if err != nil { err := graph.Wrap(ctx, err, "getting site by id") @@ -196,7 +196,7 @@ func (c Sites) GetDefaultDrive( d, err := c.Stable. Client(). Sites(). - BySiteId(site). + BySiteIdString(site). Drive(). Get(ctx, nil) if err != nil { diff --git a/src/pkg/services/m365/api/users.go b/src/pkg/services/m365/api/users.go index efda53a40..644272ad0 100644 --- a/src/pkg/services/m365/api/users.go +++ b/src/pkg/services/m365/api/users.go @@ -121,7 +121,7 @@ func (c Users) GetByID(ctx context.Context, identifier string) (models.Userable, err error ) - resp, err = c.Stable.Client().Users().ByUserId(identifier).Get(ctx, nil) + resp, err = c.Stable.Client().Users().ByUserIdString(identifier).Get(ctx, nil) if err != nil { return nil, graph.Wrap(ctx, err, "getting user") @@ -291,9 +291,9 @@ func (c Users) GetMailInbox( inbox, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(MailInbox). + ByMailFolderIdString(MailInbox). Get(ctx, nil) if err != nil { return nil, graph.Wrap(ctx, err, "getting MailFolders") @@ -309,7 +309,7 @@ func (c Users) GetDefaultDrive( d, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). Drive(). Get(ctx, nil) if err != nil { @@ -338,9 +338,9 @@ func (c Users) GetFirstInboxMessage( _, err := c.Stable. Client(). Users(). - ByUserId(userID). + ByUserIdString(userID). MailFolders(). - ByMailFolderId(inboxID). + ByMailFolderIdString(inboxID). Messages(). Delta(). Get(ctx, config)
Sourced from github.com/microsoftgraph/msgraph-sdk-go's changelog.
[1.17.0]- 2023-08-30 Changed Weekly generation.
bd9689c