Bump msgraph sdk to 1.19.0 (#4314)

Needed some changes in the func names.

``` bash
$ sed -i "s/By\([a-zA-Z]*\)IdString/By\1Id/g" **/*.go
```

<!-- PR description-->

---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x]  Unit test
- [x] 💚 E2E
This commit is contained in:
Abin Simon 2023-09-21 12:31:07 +05:30 committed by GitHub
parent cac4298863
commit ccf8df3548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 226 additions and 213 deletions

View File

@ -250,7 +250,7 @@ func generateAndRestoreDriveItems(
d, err := ctrl.AC.Stable. d, err := ctrl.AC.Stable.
Client(). Client().
Sites(). Sites().
BySiteIdString(protectedResource.ID()). BySiteId(protectedResource.ID()).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
@ -261,7 +261,7 @@ func generateAndRestoreDriveItems(
default: default:
d, err := ctrl.AC.Stable.Client(). d, err := ctrl.AC.Stable.Client().
Users(). Users().
ByUserIdString(protectedResource.ID()). ByUserId(protectedResource.ID()).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {

View File

@ -22,7 +22,7 @@ func CheckOneDriveExport(
) { ) {
drive, err := client. drive, err := client.
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {

View File

@ -22,7 +22,7 @@ func CheckSharePointExport(
) { ) {
drive, err := client. drive, err := client.
Sites(). Sites().
BySiteIdString(siteID). BySiteId(siteID).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {

View File

@ -29,7 +29,7 @@ func CheckEmailRestoration(
restoreFolder models.MailFolderable restoreFolder models.MailFolderable
itemCount = make(map[string]int32) itemCount = make(map[string]int32)
restoreItemCount = make(map[string]int32) restoreItemCount = make(map[string]int32)
builder = client.Users().ByUserIdString(testUser).MailFolders() builder = client.Users().ByUserId(testUser).MailFolders()
) )
for { for {
@ -73,9 +73,9 @@ func CheckEmailRestoration(
childFolder, err := client. childFolder, err := client.
Users(). Users().
ByUserIdString(testUser). ByUserId(testUser).
MailFolders(). MailFolders().
ByMailFolderIdString(folderID). ByMailFolderId(folderID).
ChildFolders(). ChildFolders().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
@ -136,9 +136,9 @@ func getAllMailSubFolders(
childFolder, err := client. childFolder, err := client.
Users(). Users().
ByUserIdString(testUser). ByUserId(testUser).
MailFolders(). MailFolders().
ByMailFolderIdString(folderID). ByMailFolderId(folderID).
ChildFolders(). ChildFolders().
Get(ctx, options) Get(ctx, options)
if err != nil { if err != nil {
@ -188,9 +188,9 @@ func checkAllSubFolder(
childFolder, err := client. childFolder, err := client.
Users(). Users().
ByUserIdString(testUser). ByUserId(testUser).
MailFolders(). MailFolders().
ByMailFolderIdString(folderID). ByMailFolderId(folderID).
ChildFolders(). ChildFolders().
Get(ctx, options) Get(ctx, options)
if err != nil { if err != nil {

View File

@ -27,7 +27,7 @@ func CheckOneDriveRestoration(
) { ) {
drive, err := client. drive, err := client.
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
@ -115,9 +115,9 @@ func PopulateDriveDetails(
response, err := client. response, err := client.
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString("root"). ByDriveItemId("root").
Children(). Children().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
@ -234,7 +234,7 @@ func getOneDriveChildFolder(
folderPermission map[string][]common.PermissionInfo, folderPermission map[string][]common.PermissionInfo,
startTime time.Time, startTime time.Time,
) { ) {
response, err := client.Drives().ByDriveIdString(driveID).Items().ByDriveItemIdString(itemID).Children().Get(ctx, nil) response, err := client.Drives().ByDriveId(driveID).Items().ByDriveItemId(itemID).Children().Get(ctx, nil)
if err != nil { if err != nil {
common.Fatal(ctx, "getting child folder", err) common.Fatal(ctx, "getting child folder", err)
} }
@ -283,9 +283,9 @@ func getRestoredDrive(
) { ) {
restored, err := client. restored, err := client.
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(restoreFolderID). ByDriveItemId(restoreFolderID).
Children(). Children().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
@ -326,9 +326,9 @@ func permissionIn(
pcr, err := client. pcr, err := client.
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
Permissions(). Permissions().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {

View File

@ -19,7 +19,7 @@ func CheckSharePointRestoration(
) { ) {
drive, err := client. drive, err := client.
Sites(). Sites().
BySiteIdString(siteID). BySiteId(siteID).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {

View File

@ -13,12 +13,12 @@ require (
github.com/google/uuid v1.3.1 github.com/google/uuid v1.3.1
github.com/h2non/gock v1.2.0 github.com/h2non/gock v1.2.0
github.com/kopia/kopia v0.13.0 github.com/kopia/kopia v0.13.0
github.com/microsoft/kiota-abstractions-go v1.2.0 github.com/microsoft/kiota-abstractions-go v1.2.1
github.com/microsoft/kiota-authentication-azure-go v1.0.0 github.com/microsoft/kiota-authentication-azure-go v1.0.0
github.com/microsoft/kiota-http-go v1.1.0 github.com/microsoft/kiota-http-go v1.1.0
github.com/microsoft/kiota-serialization-form-go v1.0.0 github.com/microsoft/kiota-serialization-form-go v1.0.0
github.com/microsoft/kiota-serialization-json-go v1.0.4 github.com/microsoft/kiota-serialization-json-go v1.0.4
github.com/microsoftgraph/msgraph-sdk-go v1.17.0 github.com/microsoftgraph/msgraph-sdk-go v1.19.0
github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0 github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/puzpuzpuz/xsync/v2 v2.5.0 github.com/puzpuzpuz/xsync/v2 v2.5.0
@ -59,12 +59,12 @@ require (
github.com/subosito/gotenv v1.4.2 // indirect github.com/subosito/gotenv v1.4.2 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.48.0 // indirect github.com/valyala/fasthttp v1.48.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/otel/metric v1.18.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect
) )
require ( require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
@ -115,8 +115,8 @@ require (
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
github.com/zeebo/blake3 v0.2.3 // indirect github.com/zeebo/blake3 v0.2.3 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect go.opentelemetry.io/otel v1.18.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect go.opentelemetry.io/otel/trace v1.18.0 // indirect
go.uber.org/multierr v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.13.0 // indirect golang.org/x/crypto v0.13.0 // indirect
golang.org/x/mod v0.12.0 // indirect golang.org/x/mod v0.12.0 // indirect

View File

@ -38,6 +38,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 h1:/iHxaJhsFr0+xVFfbMr5vxz848jyiWuIEDhYq3y5odY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 h1:/iHxaJhsFr0+xVFfbMr5vxz848jyiWuIEDhYq3y5odY=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2 h1:t5+QXLCK9SVi0PPdaY0PrFvYUo24KwA0QwxnaHRSVd4=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh5k7k1LGIWLQfCjaneSj7Fc= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh5k7k1LGIWLQfCjaneSj7Fc=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY=
@ -289,6 +291,8 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQ
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/microsoft/kiota-abstractions-go v1.2.0 h1:lUriJgqdCY/QajwWQOgTCQE9Atywfe2NHhgoTCSXTRE= github.com/microsoft/kiota-abstractions-go v1.2.0 h1:lUriJgqdCY/QajwWQOgTCQE9Atywfe2NHhgoTCSXTRE=
github.com/microsoft/kiota-abstractions-go v1.2.0/go.mod h1:RkxyZ5x87Njik7iVeQY9M2wtrrL1MJZcXiI/BxD/82g= github.com/microsoft/kiota-abstractions-go v1.2.0/go.mod h1:RkxyZ5x87Njik7iVeQY9M2wtrrL1MJZcXiI/BxD/82g=
github.com/microsoft/kiota-abstractions-go v1.2.1 h1:TnLF7rjy1GfhuGK2ra/a3Vuz6piFXTR1OfdNoqesagA=
github.com/microsoft/kiota-abstractions-go v1.2.1/go.mod h1:rEeeaytcnal/If3f1tz6/spFz4V+Hiqvz3rxF+oWQFA=
github.com/microsoft/kiota-authentication-azure-go v1.0.0 h1:29FNZZ/4nnCOwFcGWlB/sxPvWz487HA2bXH8jR5k2Rk= github.com/microsoft/kiota-authentication-azure-go v1.0.0 h1:29FNZZ/4nnCOwFcGWlB/sxPvWz487HA2bXH8jR5k2Rk=
github.com/microsoft/kiota-authentication-azure-go v1.0.0/go.mod h1:rnx3PRlkGdXDcA/0lZQTbBwyYGmc+3POt7HpE/e4jGw= github.com/microsoft/kiota-authentication-azure-go v1.0.0/go.mod h1:rnx3PRlkGdXDcA/0lZQTbBwyYGmc+3POt7HpE/e4jGw=
github.com/microsoft/kiota-http-go v1.1.0 h1:L5I93EiNtlP/X6YzeTlhjWt7Q1DxzC9CmWSVtX3b0tE= github.com/microsoft/kiota-http-go v1.1.0 h1:L5I93EiNtlP/X6YzeTlhjWt7Q1DxzC9CmWSVtX3b0tE=
@ -303,6 +307,8 @@ github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0
github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M= github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M=
github.com/microsoftgraph/msgraph-sdk-go v1.17.0 h1:ODua+yyogMmYos5ihqK90fQ01yaj+S2A+pM2MYxzjJ8= 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 v1.17.0/go.mod h1:DdshtIL3VJ3abSG6O+gmlvbc/pX7Xh7xbruLTWoRjfU=
github.com/microsoftgraph/msgraph-sdk-go v1.19.0 h1:hx+SvDTm5ENYZFqmMIskF7tOn48zzT2Xv3OVFrxl2dc=
github.com/microsoftgraph/msgraph-sdk-go v1.19.0/go.mod h1:3DArbqPS7riix0VsJhdtYsgPaAFAH9Jer64psW55riI=
github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0 h1:7NWTfyXvOjoizW7PmxNp3+8wCKPgpODs/D1cUZ3fkAY= 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/microsoftgraph/msgraph-sdk-go-core v1.0.0/go.mod h1:tQb4q3YMIj2dWhhXhQSJ4ELpol931ANKzHSYK5kX1qE=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
@ -451,10 +457,16 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s=
go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4=
go.opentelemetry.io/otel v1.18.0 h1:TgVozPGZ01nHyDZxK5WGPFB9QexeTMXEH7+tIClWfzs=
go.opentelemetry.io/otel v1.18.0/go.mod h1:9lWqYO0Db579XzVuCKFNPDl4s73Voa+zEck3wHaAYQI=
go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo=
go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4=
go.opentelemetry.io/otel/metric v1.18.0 h1:JwVzw94UYmbx3ej++CwLUQZxEODDj/pOuTCvzhtRrSQ=
go.opentelemetry.io/otel/metric v1.18.0/go.mod h1:nNSpsVDjWGfb7chbRLUNW+PBNdcSTHD4Uu5pfFMOI0k=
go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs=
go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0=
go.opentelemetry.io/otel/trace v1.18.0 h1:NY+czwbHbmndxojTEKiSMHkG2ClNH2PwmcHrdo0JY10=
go.opentelemetry.io/otel/trace v1.18.0/go.mod h1:T2+SGJGuYZY3bjj5rgh/hN7KIrlpWC5nS8Mjvzckz+0=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=

View File

@ -422,9 +422,9 @@ func (suite *RestoreIntgSuite) TestRestoreAndBackupEvent_recurringInstancesWithA
ec, err := handler.ac.Stable. ec, err := handler.ac.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
ByCalendarIdString(calendarID). ByCalendarId(calendarID).
Events(). Events().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))

View File

@ -224,7 +224,7 @@ func (suite *SharePointCollectionSuite) TestListCollection_Restore() {
// Clean-Up // Clean-Up
var ( var (
builder = service.Client().Sites().BySiteIdString(suite.siteID).Lists() builder = service.Client().Sites().BySiteId(suite.siteID).Lists()
isFound bool isFound bool
deleteID string deleteID string
) )

View File

@ -57,7 +57,7 @@ func PreFetchLists(
siteID string, siteID string,
) ([]ListTuple, error) { ) ([]ListTuple, error) {
var ( var (
builder = gs.Client().Sites().BySiteIdString(siteID).Lists() builder = gs.Client().Sites().BySiteId(siteID).Lists()
options = preFetchListOptions() options = preFetchListOptions()
listTuples = make([]ListTuple, 0) listTuples = make([]ListTuple, 0)
) )
@ -149,7 +149,7 @@ func loadSiteLists(
err error err error
) )
entry, err = gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(id).Get(ctx, nil) entry, err = gs.Client().Sites().BySiteId(siteID).Lists().ByListId(id).Get(ctx, nil)
if err != nil { if err != nil {
el.AddRecoverable(ctx, graph.Wrap(ctx, err, "getting site list")) el.AddRecoverable(ctx, graph.Wrap(ctx, err, "getting site list"))
return return
@ -216,7 +216,7 @@ func fetchListItems(
errs *fault.Bus, errs *fault.Bus,
) ([]models.ListItemable, error) { ) ([]models.ListItemable, error) {
var ( var (
prefix = gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(listID) prefix = gs.Client().Sites().BySiteId(siteID).Lists().ByListId(listID)
builder = prefix.Items() builder = prefix.Items()
itms = make([]models.ListItemable, 0) itms = make([]models.ListItemable, 0)
el = errs.Local() el = errs.Local()
@ -237,7 +237,7 @@ func fetchListItems(
break break
} }
newPrefix := prefix.Items().ByListItemIdString(ptr.Val(itm.GetId())) newPrefix := prefix.Items().ByListItemId(ptr.Val(itm.GetId()))
fields, err := newPrefix.Fields().Get(ctx, nil) fields, err := newPrefix.Fields().Get(ctx, nil)
if err != nil { if err != nil {
@ -273,7 +273,7 @@ func fetchColumns(
cs := make([]models.ColumnDefinitionable, 0) cs := make([]models.ColumnDefinitionable, 0)
if len(cTypeID) == 0 { if len(cTypeID) == 0 {
builder := gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(listID).Columns() builder := gs.Client().Sites().BySiteId(siteID).Lists().ByListId(listID).Columns()
for { for {
resp, err := builder.Get(ctx, nil) resp, err := builder.Get(ctx, nil)
@ -293,11 +293,11 @@ func fetchColumns(
} else { } else {
builder := gs.Client(). builder := gs.Client().
Sites(). Sites().
BySiteIdString(siteID). BySiteId(siteID).
Lists(). Lists().
ByListIdString(listID). ByListId(listID).
ContentTypes(). ContentTypes().
ByContentTypeIdString(cTypeID). ByContentTypeId(cTypeID).
Columns() Columns()
for { for {
@ -335,7 +335,7 @@ func fetchContentTypes(
var ( var (
el = errs.Local() el = errs.Local()
cTypes = make([]models.ContentTypeable, 0) cTypes = make([]models.ContentTypeable, 0)
builder = gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(listID).ContentTypes() builder = gs.Client().Sites().BySiteId(siteID).Lists().ByListId(listID).ContentTypes()
) )
for { for {
@ -393,11 +393,11 @@ func fetchColumnLinks(
var ( var (
builder = gs.Client(). builder = gs.Client().
Sites(). Sites().
BySiteIdString(siteID). BySiteId(siteID).
Lists(). Lists().
ByListIdString(listID). ByListId(listID).
ContentTypes(). ContentTypes().
ByContentTypeIdString(cTypeID). ByContentTypeId(cTypeID).
ColumnLinks() ColumnLinks()
links = make([]models.ColumnLinkable, 0) links = make([]models.ColumnLinkable, 0)
) )
@ -431,7 +431,7 @@ func DeleteList(
gs graph.Servicer, gs graph.Servicer,
siteID, listID string, siteID, listID string,
) error { ) error {
err := gs.Client().Sites().BySiteIdString(siteID).Lists().ByListIdString(listID).Delete(ctx, nil) err := gs.Client().Sites().BySiteId(siteID).Lists().ByListId(listID).Delete(ctx, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "deleting list") return graph.Wrap(ctx, err, "deleting list")
} }

View File

@ -177,7 +177,7 @@ func restoreListItem(
newList.SetItems(contents) newList.SetItems(contents)
// Restore to List base to M365 back store // Restore to List base to M365 back store
restoredList, err := service.Client().Sites().BySiteIdString(siteID).Lists().Post(ctx, newList, nil) restoredList, err := service.Client().Sites().BySiteId(siteID).Lists().Post(ctx, newList, nil)
if err != nil { if err != nil {
return dii, graph.Wrap(ctx, err, "restoring list") return dii, graph.Wrap(ctx, err, "restoring list")
} }
@ -188,9 +188,9 @@ func restoreListItem(
for _, lItem := range contents { for _, lItem := range contents {
_, err := service.Client(). _, err := service.Client().
Sites(). Sites().
BySiteIdString(siteID). BySiteId(siteID).
Lists(). Lists().
ByListIdString(ptr.Val(restoredList.GetId())). ByListId(ptr.Val(restoredList.GetId())).
Items(). Items().
Post(ctx, lItem, nil) Post(ctx, lItem, nil)
if err != nil { if err != nil {

View File

@ -289,7 +289,7 @@ func (suite *RetryMWIntgSuite) TestRetryMiddleware_RetryRequest_resetBodyAfter50
_, err = NewService(adpt). _, err = NewService(adpt).
Client(). Client().
Users(). Users().
ByUserIdString("user"). ByUserId("user").
MailFolders(). MailFolders().
Post(ctx, body, nil) Post(ctx, body, nil)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))
@ -326,7 +326,7 @@ func (suite *RetryMWIntgSuite) TestRetryMiddleware_RetryResponse_maintainBodyAft
_, err = NewService(adpt). _, err = NewService(adpt).
Client(). Client().
Users(). Users().
ByUserIdString("user"). ByUserId("user").
MailFolders(). MailFolders().
Post(ctx, models.NewMailFolder(), nil) Post(ctx, models.NewMailFolder(), nil)
require.Error(t, err, clues.ToCore(err)) require.Error(t, err, clues.ToCore(err))

View File

@ -305,7 +305,7 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete
md, err = graphClient. md, err = graphClient.
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Patch(ctx, patchBody, nil) Patch(ctx, patchBody, nil)
require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err)))
@ -330,9 +330,9 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete
resp, err := graphClient. resp, err := graphClient.
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(rootFolderID). ByDriveItemId(rootFolderID).
Children(). Children().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err)))
@ -356,7 +356,7 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete
err = graphClient. err = graphClient.
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Delete(ctx, nil) Delete(ctx, nil)
require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err)))
@ -407,9 +407,9 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete
resp, err := graphClient. resp, err := graphClient.
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(rootFolderID). ByDriveItemId(rootFolderID).
Children(). Children().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err)))
@ -450,9 +450,9 @@ func (suite *SharePointRestoreNightlyIntgSuite) TestRestore_Run_sharepointDelete
resp, err := graphClient. resp, err := graphClient.
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(rootFolderID). ByDriveItemId(rootFolderID).
Children(). Children().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err))) require.NoError(t, err, clues.ToCore(graph.Stack(ctx, err)))

View File

@ -46,9 +46,9 @@ func (c Channels) GetChannel(
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Teams(). Teams().
ByTeamIdString(teamID). ByTeamId(teamID).
Channels(). Channels().
ByChannelIdString(containerID). ByChannelId(containerID).
Get(ctx, config) Get(ctx, config)
if err != nil { if err != nil {
return nil, graph.Stack(ctx, err) return nil, graph.Stack(ctx, err)
@ -74,7 +74,7 @@ func (c Channels) GetChannelByName(
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Teams(). Teams().
ByTeamIdString(teamID). ByTeamId(teamID).
Channels(). Channels().
Get(ctx, options) Get(ctx, options)
if err != nil { if err != nil {
@ -111,11 +111,11 @@ func (c Channels) GetChannelMessage(
message, err := c.Stable. message, err := c.Stable.
Client(). Client().
Teams(). Teams().
ByTeamIdString(teamID). ByTeamId(teamID).
Channels(). Channels().
ByChannelIdString(channelID). ByChannelId(channelID).
Messages(). Messages().
ByChatMessageIdString(messageID). ByChatMessageId(messageID).
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
return nil, nil, graph.Stack(ctx, err) return nil, nil, graph.Stack(ctx, err)

View File

@ -47,9 +47,9 @@ func (c Channels) NewChannelMessagePager(
builder := c.Stable. builder := c.Stable.
Client(). Client().
Teams(). Teams().
ByTeamIdString(teamID). ByTeamId(teamID).
Channels(). Channels().
ByChannelIdString(channelID). ByChannelId(channelID).
Messages() Messages()
options := &teams.ItemChannelsItemMessagesRequestBuilderGetRequestConfiguration{ options := &teams.ItemChannelsItemMessagesRequestBuilderGetRequestConfiguration{
@ -98,9 +98,9 @@ func (p *channelMessageDeltaPageCtrl) Reset(context.Context) {
p.builder = p.gs. p.builder = p.gs.
Client(). Client().
Teams(). Teams().
ByTeamIdString(p.resourceID). ByTeamId(p.resourceID).
Channels(). Channels().
ByChannelIdString(p.channelID). ByChannelId(p.channelID).
Messages(). Messages().
Delta() Delta()
} }
@ -116,9 +116,9 @@ func (c Channels) NewChannelMessageDeltaPager(
builder := c.Stable. builder := c.Stable.
Client(). Client().
Teams(). Teams().
ByTeamIdString(teamID). ByTeamId(teamID).
Channels(). Channels().
ByChannelIdString(channelID). ByChannelId(channelID).
Messages(). Messages().
Delta() Delta()
@ -211,11 +211,11 @@ func (c Channels) NewChannelMessageRepliesPager(
builder: c.Stable. builder: c.Stable.
Client(). Client().
Teams(). Teams().
ByTeamIdString(teamID). ByTeamId(teamID).
Channels(). Channels().
ByChannelIdString(channelID). ByChannelId(channelID).
Messages(). Messages().
ByChatMessageIdString(messageID). ByChatMessageId(messageID).
Replies(), Replies(),
} }
@ -272,7 +272,7 @@ func (c Channels) NewChannelPager(
builder: c.Stable. builder: c.Stable.
Client(). Client().
Teams(). Teams().
ByTeamIdString(teamID). ByTeamId(teamID).
Channels(), Channels(),
} }

View File

@ -46,7 +46,7 @@ func (c Contacts) CreateContainer(
mdl, err := c.Stable. mdl, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -71,9 +71,9 @@ func (c Contacts) DeleteContainer(
err = srv. err = srv.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
ByContactFolderIdString(containerID). ByContactFolderId(containerID).
Delete(ctx, nil) Delete(ctx, nil)
if err != nil { if err != nil {
return graph.Stack(ctx, err) return graph.Stack(ctx, err)
@ -95,9 +95,9 @@ func (c Contacts) GetContainerByID(
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
ByContactFolderIdString(containerID). ByContactFolderId(containerID).
Get(ctx, config) Get(ctx, config)
if err != nil { if err != nil {
return nil, graph.Stack(ctx, err) return nil, graph.Stack(ctx, err)
@ -124,7 +124,7 @@ func (c Contacts) GetContainerByName(
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
Get(ctx, options) Get(ctx, options)
if err != nil { if err != nil {
@ -164,9 +164,9 @@ func (c Contacts) PatchFolder(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
ByContactFolderIdString(containerID). ByContactFolderId(containerID).
Patch(ctx, body, nil) Patch(ctx, body, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "patching contact folder") return graph.Wrap(ctx, err, "patching contact folder")
@ -193,9 +193,9 @@ func (c Contacts) GetItem(
cont, err := c.Stable. cont, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Contacts(). Contacts().
ByContactIdString(itemID). ByContactId(itemID).
Get(ctx, options) Get(ctx, options)
if err != nil { if err != nil {
return nil, nil, graph.Stack(ctx, err) return nil, nil, graph.Stack(ctx, err)
@ -212,9 +212,9 @@ func (c Contacts) PostItem(
itm, err := c.Stable. itm, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
ByContactFolderIdString(containerID). ByContactFolderId(containerID).
Contacts(). Contacts().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -238,9 +238,9 @@ func (c Contacts) DeleteItem(
err = srv. err = srv.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Contacts(). Contacts().
ByContactIdString(itemID). ByContactId(itemID).
Delete(ctx, nil) Delete(ctx, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "deleting contact") return graph.Wrap(ctx, err, "deleting contact")

View File

@ -40,9 +40,9 @@ func (c Contacts) EnumerateContainers(
builder := c.Stable. builder := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
ByContactFolderIdString(baseContainerID). ByContactFolderId(baseContainerID).
ChildFolders() ChildFolders()
for { for {
@ -118,9 +118,9 @@ func (c Contacts) NewContactsPager(
builder := c.Stable. builder := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
ByContactFolderIdString(containerID). ByContactFolderId(containerID).
Contacts() Contacts()
return &contactsPageCtrl{c.Stable, builder, options} return &contactsPageCtrl{c.Stable, builder, options}
@ -204,9 +204,9 @@ func getContactDeltaBuilder(
) *users.ItemContactFoldersItemContactsDeltaRequestBuilder { ) *users.ItemContactFoldersItemContactsDeltaRequestBuilder {
builder := gs.Client(). builder := gs.Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
ContactFolders(). ContactFolders().
ByContactFolderIdString(containerID). ByContactFolderId(containerID).
Contacts(). Contacts().
Delta() Delta()

View File

@ -45,9 +45,9 @@ func (suite *ContactsPagerIntgSuite) TestContacts_GetItemsInContainerByCollision
conts, err := ac.Stable. conts, err := ac.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(suite.its.user.id). ByUserId(suite.its.user.id).
ContactFolders(). ContactFolders().
ByContactFolderIdString(ptr.Val(container.GetId())). ByContactFolderId(ptr.Val(container.GetId())).
Contacts(). Contacts().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))
@ -97,9 +97,9 @@ func (suite *ContactsPagerIntgSuite) TestContacts_GetItemsIDsInContainer() {
msgs, err := ac.Stable. msgs, err := ac.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(suite.its.user.id). ByUserId(suite.its.user.id).
ContactFolders(). ContactFolders().
ByContactFolderIdString(ptr.Val(container.GetId())). ByContactFolderId(ptr.Val(container.GetId())).
Contacts(). Contacts().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))

View File

@ -74,7 +74,7 @@ func (c Drives) GetRootFolder(
root, err := c.Stable. root, err := c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Root(). Root().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
@ -96,9 +96,9 @@ func (c Drives) GetItem(
di, err := c.Stable. di, err := c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
return nil, graph.Wrap(ctx, err, "getting item") return nil, graph.Wrap(ctx, err, "getting item")
@ -116,9 +116,9 @@ func (c Drives) NewItemContentUpload(
r, err := c.Stable. r, err := c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
CreateUploadSession(). CreateUploadSession().
Post(ctx, session, nil) Post(ctx, session, nil)
if err != nil { if err != nil {
@ -180,9 +180,9 @@ func (c Drives) PatchItem(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
Patch(ctx, item, nil) Patch(ctx, item, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "patching drive item") return graph.Wrap(ctx, err, "patching drive item")
@ -199,9 +199,9 @@ func (c Drives) PutItemContent(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
Content(). Content().
Put(ctx, content, nil) Put(ctx, content, nil)
if err != nil { if err != nil {
@ -227,9 +227,9 @@ func (c Drives) DeleteItem(
err = srv. err = srv.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
Delete(ctx, nil) Delete(ctx, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "deleting item").With("item_id", itemID) return graph.Wrap(ctx, err, "deleting item").With("item_id", itemID)
@ -249,9 +249,9 @@ func (c Drives) GetItemPermission(
perm, err := c.Stable. perm, err := c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
Permissions(). Permissions().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
@ -271,9 +271,9 @@ func (c Drives) PostItemPermissionUpdate(
itm, err := c.Stable. itm, err := c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
Invite(). Invite().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -297,11 +297,11 @@ func (c Drives) DeleteItemPermission(
err = srv. err = srv.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(itemID). ByDriveItemId(itemID).
Permissions(). Permissions().
ByPermissionIdString(permissionID). ByPermissionId(permissionID).
Delete(graph.ConsumeNTokens(ctx, graph.PermissionsLC), nil) Delete(graph.ConsumeNTokens(ctx, graph.PermissionsLC), nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "deleting drive item permission") return graph.Wrap(ctx, err, "deleting drive item permission")

View File

@ -42,9 +42,9 @@ func (c Drives) NewDriveItemPager(
builder := c.Stable. builder := c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(containerID). ByDriveItemId(containerID).
Children() Children()
return &driveItemPageCtrl{c.Stable, builder, options} return &driveItemPageCtrl{c.Stable, builder, options}
@ -156,9 +156,9 @@ func (c Drives) NewDriveItemDeltaPager(
builder: c.Stable. builder: c.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(driveID). ByDriveId(driveID).
Items(). Items().
ByDriveItemIdString(onedrive.RootID). ByDriveItemId(onedrive.RootID).
Delta(), Delta(),
} }
@ -183,9 +183,9 @@ func (p *DriveItemDeltaPageCtrl) SetNextLink(link string) {
func (p *DriveItemDeltaPageCtrl) Reset(context.Context) { func (p *DriveItemDeltaPageCtrl) Reset(context.Context) {
p.builder = p.gs.Client(). p.builder = p.gs.Client().
Drives(). Drives().
ByDriveIdString(p.driveID). ByDriveId(p.driveID).
Items(). Items().
ByDriveItemIdString(onedrive.RootID). ByDriveItemId(onedrive.RootID).
Delta() Delta()
} }
@ -223,7 +223,7 @@ func (c Drives) NewUserDrivePager(
builder: c.Stable. builder: c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Drives(), Drives(),
} }
@ -249,7 +249,7 @@ func (p *userDrivePager) GetPage(
d, err := p.gs. d, err := p.gs.
Client(). Client().
Users(). Users().
ByUserIdString(p.userID). ByUserId(p.userID).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
@ -297,7 +297,7 @@ func (c Drives) NewSiteDrivePager(
builder: c.Stable. builder: c.Stable.
Client(). Client().
Sites(). Sites().
BySiteIdString(siteID). BySiteId(siteID).
Drives(), Drives(),
} }

View File

@ -61,9 +61,9 @@ func (suite *DrivePagerIntgSuite) TestDrives_GetItemsInContainerByCollisionKey()
items, err := suite.its.ac.Stable. items, err := suite.its.ac.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(test.driveID). ByDriveId(test.driveID).
Items(). Items().
ByDriveItemIdString(test.rootFolderID). ByDriveItemId(test.rootFolderID).
Children(). Children().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))
@ -135,9 +135,9 @@ func (suite *DrivePagerIntgSuite) TestDrives_GetItemIDsInContainer() {
items, err := suite.its.ac.Stable. items, err := suite.its.ac.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(test.driveID). ByDriveId(test.driveID).
Items(). Items().
ByDriveItemIdString(test.rootFolderID). ByDriveItemId(test.rootFolderID).
Children(). Children().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))

View File

@ -274,9 +274,9 @@ func (suite *DriveAPIIntgSuite) TestDrives_PostItemInContainer_replaceFolderRegr
resultFileColl, err := acd.Stable. resultFileColl, err := acd.Stable.
Client(). Client().
Drives(). Drives().
ByDriveIdString(suite.its.user.driveID). ByDriveId(suite.its.user.driveID).
Items(). Items().
ByDriveItemIdString(ptr.Val(resultFolder.GetId())). ByDriveItemId(ptr.Val(resultFolder.GetId())).
Children(). Children().
Get(ctx, nil) Get(ctx, nil)
err = graph.Stack(ctx, err).OrNil() err = graph.Stack(ctx, err).OrNil()

View File

@ -55,7 +55,7 @@ func (c Events) CreateContainer(
container, err := c.Stable. container, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -80,9 +80,9 @@ func (c Events) DeleteContainer(
err = srv.Client(). err = srv.Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
ByCalendarIdString(containerID). ByCalendarId(containerID).
Delete(ctx, nil) Delete(ctx, nil)
if err != nil { if err != nil {
return graph.Stack(ctx, err) return graph.Stack(ctx, err)
@ -104,9 +104,9 @@ func (c Events) GetContainerByID(
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
ByCalendarIdString(containerID). ByCalendarId(containerID).
Get(ctx, config) Get(ctx, config)
if err != nil { if err != nil {
return nil, graph.Stack(ctx, err) return nil, graph.Stack(ctx, err)
@ -133,7 +133,7 @@ func (c Events) GetContainerByName(
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
Get(ctx, options) Get(ctx, options)
if err != nil { if err != nil {
@ -169,9 +169,9 @@ func (c Events) PatchCalendar(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
ByCalendarIdString(containerID). ByCalendarId(containerID).
Patch(ctx, body, nil) Patch(ctx, body, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "patching event calendar") return graph.Wrap(ctx, err, "patching event calendar")
@ -381,9 +381,9 @@ func (c Events) GetAttachments(
attached, err := c.LargeItem. attached, err := c.LargeItem.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Events(). Events().
ByEventIdString(itemID). ByEventId(itemID).
Attachments(). Attachments().
Get(ctx, config) Get(ctx, config)
if err != nil { if err != nil {
@ -400,13 +400,13 @@ func (c Events) DeleteAttachment(
return c.Stable. return c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
ByCalendarIdString(calendarID). ByCalendarId(calendarID).
Events(). Events().
ByEventIdString(eventID). ByEventId(eventID).
Attachments(). Attachments().
ByAttachmentIdString(attachmentID). ByAttachmentId(attachmentID).
Delete(ctx, nil) Delete(ctx, nil)
} }
@ -425,9 +425,9 @@ func (c Events) GetItemInstances(
events, err := c.Stable. events, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Events(). Events().
ByEventIdString(itemID). ByEventId(itemID).
Instances(). Instances().
Get(ctx, config) Get(ctx, config)
if err != nil { if err != nil {
@ -483,9 +483,9 @@ func (c Events) DeleteItem(
err = srv. err = srv.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Events(). Events().
ByEventIdString(itemID). ByEventId(itemID).
Delete(ctx, nil) Delete(ctx, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "deleting calendar event") return graph.Wrap(ctx, err, "deleting calendar event")
@ -502,11 +502,11 @@ func (c Events) PostSmallAttachment(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
ByCalendarIdString(containerID). ByCalendarId(containerID).
Events(). Events().
ByEventIdString(parentItemID). ByEventId(parentItemID).
Attachments(). Attachments().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -528,11 +528,11 @@ func (c Events) PostLargeAttachment(
us, err := c.LargeItem. us, err := c.LargeItem.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
ByCalendarIdString(containerID). ByCalendarId(containerID).
Events(). Events().
ByEventIdString(parentItemID). ByEventId(parentItemID).
Attachments(). Attachments().
CreateUploadSession(). CreateUploadSession().
Post(ctx, session, nil) Post(ctx, session, nil)

View File

@ -42,7 +42,7 @@ func (c Events) EnumerateContainers(
builder = c.Stable. builder = c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars() Calendars()
) )
@ -123,9 +123,9 @@ func (c Events) NewEventsPager(
builder := c.Stable. builder := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Calendars(). Calendars().
ByCalendarIdString(containerID). ByCalendarId(containerID).
Events() Events()
return &eventsPageCtrl{c.Stable, builder, options} return &eventsPageCtrl{c.Stable, builder, options}

View File

@ -45,9 +45,9 @@ func (suite *EventsPagerIntgSuite) TestEvents_GetItemsInContainerByCollisionKey(
evts, err := ac.Stable. evts, err := ac.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(suite.its.user.id). ByUserId(suite.its.user.id).
Calendars(). Calendars().
ByCalendarIdString(ptr.Val(container.GetId())). ByCalendarId(ptr.Val(container.GetId())).
Events(). Events().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))

View File

@ -119,7 +119,7 @@ func (c Groups) GetByID(
group, err = service. group, err = service.
Client(). Client().
Groups(). Groups().
ByGroupIdString(identifier). ByGroupId(identifier).
Get(ctx, nil) Get(ctx, nil)
if err == nil { if err == nil {
return group, nil return group, nil
@ -165,9 +165,9 @@ func (c Groups) GetRootSite(
resp, err := service. resp, err := service.
Client(). Client().
Groups(). Groups().
ByGroupIdString(identifier). ByGroupId(identifier).
Sites(). Sites().
BySiteIdString("root"). BySiteId("root").
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
return nil, clues.Wrap(err, "getting root site for group") return nil, clues.Wrap(err, "getting root site for group")

View File

@ -39,6 +39,7 @@ func odErr(code string) *odataerrors.ODataError {
odErr := odataerrors.NewODataError() odErr := odataerrors.NewODataError()
merr := odataerrors.NewMainError() merr := odataerrors.NewMainError()
merr.SetCode(&code) merr.SetCode(&code)
merr.SetMessage(&code) // sdk expect message to be available
odErr.SetErrorEscaped(merr) odErr.SetErrorEscaped(merr)
return odErr return odErr

View File

@ -42,7 +42,7 @@ func (c Lists) PostDrive(
builder := c.Stable. builder := c.Stable.
Client(). Client().
Sites(). Sites().
BySiteIdString(siteID). BySiteId(siteID).
Lists() Lists()
newList, err := builder.Post(ctx, list, nil) 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 information is not returned by the list creation.
drive, err := builder. drive, err := builder.
ByListIdString(ptr.Val(newList.GetId())). ByListId(ptr.Val(newList.GetId())).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)

View File

@ -53,9 +53,9 @@ func (c Mail) CreateContainer(
mdl, err := c.Stable. mdl, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(parentContainerID). ByMailFolderId(parentContainerID).
ChildFolders(). ChildFolders().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -80,9 +80,9 @@ func (c Mail) DeleteContainer(
err = srv.Client(). err = srv.Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Delete(ctx, nil) Delete(ctx, nil)
if err != nil { if err != nil {
return graph.Stack(ctx, err) return graph.Stack(ctx, err)
@ -104,9 +104,9 @@ func (c Mail) GetContainerByID(
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Get(ctx, config) Get(ctx, config)
if err != nil { if err != nil {
return nil, graph.Stack(ctx, err) return nil, graph.Stack(ctx, err)
@ -128,7 +128,7 @@ func (c Mail) GetContainerByName(
builder = c.Stable. builder = c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders() MailFolders()
resp models.MailFolderCollectionResponseable resp models.MailFolderCollectionResponseable
err error err error
@ -142,7 +142,7 @@ func (c Mail) GetContainerByName(
} }
resp, err = builder. resp, err = builder.
ByMailFolderIdString(parentContainerID). ByMailFolderId(parentContainerID).
ChildFolders(). ChildFolders().
Get(ctx, options) Get(ctx, options)
} else { } else {
@ -192,9 +192,9 @@ func (c Mail) MoveContainer(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Move(). Move().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -212,9 +212,9 @@ func (c Mail) PatchFolder(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Patch(ctx, body, nil) Patch(ctx, body, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "patching mail folder") return graph.Wrap(ctx, err, "patching mail folder")
@ -246,9 +246,9 @@ func (c Mail) GetItem(
mail, err := c.Stable. mail, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Messages(). Messages().
ByMessageIdString(itemID). ByMessageId(itemID).
Get(ctx, config) Get(ctx, config)
if err != nil { if err != nil {
return nil, nil, graph.Stack(ctx, err) return nil, nil, graph.Stack(ctx, err)
@ -276,9 +276,9 @@ func (c Mail) GetItem(
attached, err := c.LargeItem. attached, err := c.LargeItem.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Messages(). Messages().
ByMessageIdString(itemID). ByMessageId(itemID).
Attachments(). Attachments().
Get(ctx, attachConfig) Get(ctx, attachConfig)
if err == nil { if err == nil {
@ -309,9 +309,9 @@ func (c Mail) GetItem(
attachments, err := c.LargeItem. attachments, err := c.LargeItem.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Messages(). Messages().
ByMessageIdString(itemID). ByMessageId(itemID).
Attachments(). Attachments().
Get(ctx, attachConfig) Get(ctx, attachConfig)
if err != nil { if err != nil {
@ -331,11 +331,11 @@ func (c Mail) GetItem(
att, err := c.Stable. att, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Messages(). Messages().
ByMessageIdString(itemID). ByMessageId(itemID).
Attachments(). Attachments().
ByAttachmentIdString(ptr.Val(a.GetId())). ByAttachmentId(ptr.Val(a.GetId())).
Get(ctx, attachConfig) Get(ctx, attachConfig)
if err != nil { if err != nil {
// CannotOpenFileAttachment errors are not transient and // CannotOpenFileAttachment errors are not transient and
@ -376,9 +376,9 @@ func (c Mail) PostItem(
itm, err := c.Stable. itm, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Messages(). Messages().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -402,11 +402,11 @@ func (c Mail) MoveItem(
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(oldContainerID). ByMailFolderId(oldContainerID).
Messages(). Messages().
ByMessageIdString(itemID). ByMessageId(itemID).
Move(). Move().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -430,9 +430,9 @@ func (c Mail) DeleteItem(
err = srv. err = srv.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Messages(). Messages().
ByMessageIdString(itemID). ByMessageId(itemID).
Delete(ctx, nil) Delete(ctx, nil)
if err != nil { if err != nil {
return graph.Wrap(ctx, err, "deleting mail message") return graph.Wrap(ctx, err, "deleting mail message")
@ -449,11 +449,11 @@ func (c Mail) PostSmallAttachment(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Messages(). Messages().
ByMessageIdString(parentItemID). ByMessageId(parentItemID).
Attachments(). Attachments().
Post(ctx, body, nil) Post(ctx, body, nil)
if err != nil { if err != nil {
@ -475,11 +475,11 @@ func (c Mail) PostLargeAttachment(
us, err := c.LargeItem. us, err := c.LargeItem.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Messages(). Messages().
ByMessageIdString(parentItemID). ByMessageId(parentItemID).
Attachments(). Attachments().
CreateUploadSession(). CreateUploadSession().
Post(ctx, session, nil) Post(ctx, session, nil)

View File

@ -148,9 +148,9 @@ func (c Mail) NewMailPager(
builder := c.Stable. builder := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Messages() Messages()
return &mailsPageCtrl{c.Stable, builder, options} return &mailsPageCtrl{c.Stable, builder, options}
@ -234,9 +234,9 @@ func getMailDeltaBuilder(
) *users.ItemMailFoldersItemMessagesDeltaRequestBuilder { ) *users.ItemMailFoldersItemMessagesDeltaRequestBuilder {
builder := gs.Client(). builder := gs.Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(containerID). ByMailFolderId(containerID).
Messages(). Messages().
Delta() Delta()

View File

@ -46,9 +46,9 @@ func (suite *MailPagerIntgSuite) TestMail_GetItemsInContainerByCollisionKey() {
msgs, err := ac.Stable. msgs, err := ac.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(suite.its.user.id). ByUserId(suite.its.user.id).
MailFolders(). MailFolders().
ByMailFolderIdString(ptr.Val(container.GetId())). ByMailFolderId(ptr.Val(container.GetId())).
Messages(). Messages().
Get(ctx, nil) Get(ctx, nil)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))
@ -101,9 +101,9 @@ func (suite *MailPagerIntgSuite) TestMail_GetItemsIDsInContainer() {
msgs, err := ac.Stable. msgs, err := ac.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(suite.its.user.id). ByUserId(suite.its.user.id).
MailFolders(). MailFolders().
ByMailFolderIdString(api.MailInbox). ByMailFolderId(api.MailInbox).
Messages(). Messages().
Get(ctx, config) Get(ctx, config)
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))

View File

@ -45,7 +45,7 @@ func (c Sites) GetRoot(ctx context.Context) (models.Siteable, error) {
resp, err := c.Stable. resp, err := c.Stable.
Client(). Client().
Sites(). Sites().
BySiteIdString("root"). BySiteId("root").
Get(ctx, options) Get(ctx, options)
if err != nil { if err != nil {
return nil, graph.Wrap(ctx, err, "getting root site") return nil, graph.Wrap(ctx, err, "getting root site")
@ -134,7 +134,7 @@ func (c Sites) GetByID(ctx context.Context, identifier string) (models.Siteable,
resp, err = c.Stable. resp, err = c.Stable.
Client(). Client().
Sites(). Sites().
BySiteIdString(identifier). BySiteId(identifier).
Get(ctx, options) Get(ctx, options)
if err != nil { if err != nil {
err := graph.Wrap(ctx, err, "getting site by id") err := graph.Wrap(ctx, err, "getting site by id")
@ -210,7 +210,7 @@ func (c Sites) GetDefaultDrive(
d, err := c.Stable. d, err := c.Stable.
Client(). Client().
Sites(). Sites().
BySiteIdString(site). BySiteId(site).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {

View File

@ -120,7 +120,7 @@ func (c Users) GetByID(ctx context.Context, identifier string) (models.Userable,
err error err error
) )
resp, err = c.Stable.Client().Users().ByUserIdString(identifier).Get(ctx, nil) resp, err = c.Stable.Client().Users().ByUserId(identifier).Get(ctx, nil)
if err != nil { if err != nil {
return nil, graph.Wrap(ctx, err, "getting user") return nil, graph.Wrap(ctx, err, "getting user")
@ -222,9 +222,9 @@ func (c Users) GetMailInbox(
inbox, err := c.Stable. inbox, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(MailInbox). ByMailFolderId(MailInbox).
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
return nil, graph.Wrap(ctx, err, "getting MailFolders") return nil, graph.Wrap(ctx, err, "getting MailFolders")
@ -240,7 +240,7 @@ func (c Users) GetDefaultDrive(
d, err := c.Stable. d, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
Drive(). Drive().
Get(ctx, nil) Get(ctx, nil)
if err != nil { if err != nil {
@ -269,9 +269,9 @@ func (c Users) GetFirstInboxMessage(
_, err := c.Stable. _, err := c.Stable.
Client(). Client().
Users(). Users().
ByUserIdString(userID). ByUserId(userID).
MailFolders(). MailFolders().
ByMailFolderIdString(inboxID). ByMailFolderId(inboxID).
Messages(). Messages().
Delta(). Delta().
Get(ctx, config) Get(ctx, config)