GC: Go.Mod update (#1479)

## Description
Versioning upgraded for GC
Packages updated:
- [x] github.com/microsoftgraph/msgraph-sdk-go v0.41.0 => v0.48.0
- [x] github.com/microsoft/kiota-abstractions-go v0.14.0
- [x] github.com/microsoft/kiota-authentication-azure-go v0.5.0
- [x] github.com/microsoft/kiota-http-go v0.9.0
- [x] github.com/microsoft/kiota-serialization-json-go v0.7.2
- [x] github.com/microsoftgraph/msgraph-sdk-go-core v0.30.1
- [x] github.com/stretchr/testify v1.8.1
- [x] github.com/cjlapao/common-go v0.0.29 => v0.0.35

<!-- Insert PR description-->

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🐹 Trivial/Minor
- Update library change. AdditionalData no longer contains `nextLink` for iteration.  See commit [e7c75ca](e7c75ca1cc) for full details. 

## Issue(s)

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

## Test Plan

- [x]  Unit test
This commit is contained in:
Danny 2022-12-08 16:54:22 -05:00 committed by GitHub
parent 53195017a1
commit 45e535c9b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 195 additions and 424 deletions

View File

@ -9,12 +9,12 @@ require (
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-multierror v1.1.1
github.com/kopia/kopia v0.12.0 github.com/kopia/kopia v0.12.0
github.com/microsoft/kiota-abstractions-go v0.11.0 github.com/microsoft/kiota-abstractions-go v0.14.0
github.com/microsoft/kiota-authentication-azure-go v0.4.1 github.com/microsoft/kiota-authentication-azure-go v0.5.0
github.com/microsoft/kiota-http-go v0.7.2 github.com/microsoft/kiota-http-go v0.9.0
github.com/microsoft/kiota-serialization-json-go v0.7.1 github.com/microsoft/kiota-serialization-json-go v0.7.2
github.com/microsoftgraph/msgraph-sdk-go v0.40.0 github.com/microsoftgraph/msgraph-sdk-go v0.48.0
github.com/microsoftgraph/msgraph-sdk-go-core v0.28.1 github.com/microsoftgraph/msgraph-sdk-go-core v0.30.1
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/rudderlabs/analytics-go v3.3.3+incompatible github.com/rudderlabs/analytics-go v3.3.3+incompatible
github.com/spf13/cobra v1.6.1 github.com/spf13/cobra v1.6.1
@ -49,14 +49,14 @@ require (
) )
require ( require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.3 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chmduquesne/rollinghash v4.0.0+incompatible // indirect github.com/chmduquesne/rollinghash v4.0.0+incompatible // indirect
github.com/cjlapao/common-go v0.0.27 // indirect github.com/cjlapao/common-go v0.0.35 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 github.com/dustin/go-humanize v1.0.0
github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect
@ -103,8 +103,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.10.0 // indirect go.opentelemetry.io/otel v1.11.2 // indirect
go.opentelemetry.io/otel/trace v1.10.0 // indirect go.opentelemetry.io/otel/trace v1.11.2 // indirect
go.uber.org/atomic v1.10.0 // indirect go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.1.0 // indirect golang.org/x/crypto v0.1.0 // indirect

View File

@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
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.1.3 h1:8LoU8N2lIUzkmstvwXvVfniMZlFbesfT2AmA1aqvRr8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUXTtj12tQ6zE2GZUgVQw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.3/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 h1:XUNQ4mw+zJmaA2KXzP9JlQiecy1SI+Eog7xVkPiqIbg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 h1:XUNQ4mw+zJmaA2KXzP9JlQiecy1SI+Eog7xVkPiqIbg=
@ -78,8 +78,8 @@ github.com/chmduquesne/rollinghash v4.0.0+incompatible/go.mod h1:Uc2I36RRfTAf7Dg
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cjlapao/common-go v0.0.27 h1:7k8R1Mz2LAudnPb1kaqQ/l+Ba7uL92FG7Rqp9W67mGM= github.com/cjlapao/common-go v0.0.35 h1:GElDHYC9qAAMDozfDOArl1ayn+W+X90mogcS38Y8d3k=
github.com/cjlapao/common-go v0.0.27/go.mod h1:OyTAY388jfEj8uaRzx0uYneFghKDLL5KP+ewSydlQ5g= github.com/cjlapao/common-go v0.0.35/go.mod h1:WkUjw+hVbUDfzcnRymlU5VT/HBzv5xPs9tIJJ1XrQCU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
@ -257,20 +257,20 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09
github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
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 v0.11.0 h1:JSelh3pj9CQlSYNYIpCUcE60flTR5Ninc+XnF4nC/FI= github.com/microsoft/kiota-abstractions-go v0.14.0 h1:TCYk1+CoBFNhTefKu8OTky4w4HnOoD72EJOeTsTNml8=
github.com/microsoft/kiota-abstractions-go v0.11.0/go.mod h1:wOO+hpReDIJa3BxbLNz4qvtZk2llS555mejkMc203bQ= github.com/microsoft/kiota-abstractions-go v0.14.0/go.mod h1:/zQPz5M7868/bbN8D4tZHhnOE23Tcc/JBKSNwljOch4=
github.com/microsoft/kiota-authentication-azure-go v0.4.1 h1:C+n4Vp3oCj8W8LPiKZDyASTNaKyUomQtUiXQ+B2W0TU= github.com/microsoft/kiota-authentication-azure-go v0.5.0 h1:RVA/tTgMnDIN3u4qPZtvYvVRsQDOFkd3yvi6KXjZJko=
github.com/microsoft/kiota-authentication-azure-go v0.4.1/go.mod h1:jIJAhpPh34bDQWNME65kd/yjqY6+CJZi5jus8H9EH4s= github.com/microsoft/kiota-authentication-azure-go v0.5.0/go.mod h1:1Io6h+88FlDRmrajdjSnXPz8oyObUVjNuQZLhrF9kQk=
github.com/microsoft/kiota-http-go v0.7.2 h1:R40vG0EkIFqGvVz5dZtLe4g1sXGVfBO5HxjdBjpwv8k= github.com/microsoft/kiota-http-go v0.9.0 h1:q/JZpWOvHFbxrOjbd8pbODuTx4dlcLahTemM48di/y8=
github.com/microsoft/kiota-http-go v0.7.2/go.mod h1:QTbXPh25mJsbxE23bFqw64BckCioCGfaE77hF/F3rIQ= github.com/microsoft/kiota-http-go v0.9.0/go.mod h1:F652dnY3jVNmwSk46qHXt+HeEbxLkbbn3dUi3lSLHws=
github.com/microsoft/kiota-serialization-json-go v0.7.1 h1:hmO3Jqp6szJKn9Y2sGHwa3zM8a4RqnioyK/X1zFOuWk= github.com/microsoft/kiota-serialization-json-go v0.7.2 h1:DSb4fNDi5O+DqJwrHo+vRy2kSvfxG5VtN6m1EHzn5Vw=
github.com/microsoft/kiota-serialization-json-go v0.7.1/go.mod h1:mqCksNRbL3AAqkt5C1vrw8giqpwG2NYa/+7Kf/Q4ZUw= github.com/microsoft/kiota-serialization-json-go v0.7.2/go.mod h1:Ojum5prlijopyCOZ2XctRcVlE2pU8h+43r3tMdiWoDU=
github.com/microsoft/kiota-serialization-text-go v0.6.0 h1:3N2vftYZlwKdog69AN7ha+FZT0QxPG7xp/hLv0/W2OQ= github.com/microsoft/kiota-serialization-text-go v0.6.0 h1:3N2vftYZlwKdog69AN7ha+FZT0QxPG7xp/hLv0/W2OQ=
github.com/microsoft/kiota-serialization-text-go v0.6.0/go.mod h1:OUA4dNH+f6afiJUs+rQAatJos7QVF5PJkyrqoD89lx4= github.com/microsoft/kiota-serialization-text-go v0.6.0/go.mod h1:OUA4dNH+f6afiJUs+rQAatJos7QVF5PJkyrqoD89lx4=
github.com/microsoftgraph/msgraph-sdk-go v0.40.0 h1:9AxA3FS+S3c7Him5C+7Lt0I8zaNXoSqXsLDink1Fg40= github.com/microsoftgraph/msgraph-sdk-go v0.48.0 h1:N93MVg4LgM45lK70PNTRaKCk5kw8sdfgHTXS0qc1VFg=
github.com/microsoftgraph/msgraph-sdk-go v0.40.0/go.mod h1:B8HORKdf1K05Z93FbkpiqJ25dnytjPEyAby6gHhOLiM= github.com/microsoftgraph/msgraph-sdk-go v0.48.0/go.mod h1:I2iR+gJmKiZZ8ebE8mKQEiKXpePAahAIazx3F1kL6og=
github.com/microsoftgraph/msgraph-sdk-go-core v0.28.1 h1:gN3pVVvx50KzhQdYwQKVnRSOSOIRaFpXj7pgPfqnNXw= github.com/microsoftgraph/msgraph-sdk-go-core v0.30.1 h1:jBuYexMqKnjsnQpyICfdu0RhZr7RFkEcKWRm3hf/jMM=
github.com/microsoftgraph/msgraph-sdk-go-core v0.28.1/go.mod h1:BnumnwWU8xUgX7ncgo68novbS1wMlO66Iny9iVhvHuM= github.com/microsoftgraph/msgraph-sdk-go-core v0.30.1/go.mod h1:RyqsMRKmZADSA/feLQMcynQJRENMzKM/Wg4dgQ/lW+s=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.39 h1:upnbu1jCGOqEvrGSpRauSN9ZG7RCHK7VHxXS8Vmg2zk= github.com/minio/minio-go/v7 v7.0.39 h1:upnbu1jCGOqEvrGSpRauSN9ZG7RCHK7VHxXS8Vmg2zk=
@ -410,10 +410,10 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 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.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0=
go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI=
go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0=
go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=

View File

@ -4,8 +4,6 @@ import (
"context" "context"
"github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/models"
ups "github.com/microsoftgraph/msgraph-sdk-go/users/item/calendars/item/events/item/attachments/createuploadsession"
"github.com/microsoftgraph/msgraph-sdk-go/users/item/messages/item/attachments/createuploadsession"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/connector/graph"
@ -57,7 +55,7 @@ func (mau *mailAttachmentUploader) uploadSession(
attachmentName string, attachmentName string,
attachmentSize int64, attachmentSize int64,
) (models.UploadSessionable, error) { ) (models.UploadSessionable, error) {
session := createuploadsession.NewCreateUploadSessionPostRequestBody() session := models.NewUsersItemMailFoldersItemMessagesItemAttachmentsCreateUploadSessionPostRequestBody()
session.SetAttachmentItem(makeSessionAttachment(attachmentName, attachmentSize)) session.SetAttachmentItem(makeSessionAttachment(attachmentName, attachmentSize))
r, err := mau.service.Client().UsersById(mau.userID).MailFoldersById(mau.folderID). r, err := mau.service.Client().UsersById(mau.userID).MailFoldersById(mau.folderID).
@ -105,7 +103,7 @@ func (eau *eventAttachmentUploader) uploadSession(
attachmentName string, attachmentName string,
attachmentSize int64, attachmentSize int64,
) (models.UploadSessionable, error) { ) (models.UploadSessionable, error) {
session := ups.NewCreateUploadSessionPostRequestBody() session := models.NewUsersItemCalendarEventsItemAttachmentsCreateUploadSessionPostRequestBody()
session.SetAttachmentItem(makeSessionAttachment(attachmentName, attachmentSize)) session.SetAttachmentItem(makeSessionAttachment(attachmentName, attachmentSize))
r, err := eau.service.Client(). r, err := eau.service.Client().

View File

@ -3,7 +3,7 @@ package exchange
import ( import (
"context" "context"
cf "github.com/microsoftgraph/msgraph-sdk-go/users/item/contactfolders/item/childfolders" msuser "github.com/microsoftgraph/msgraph-sdk-go/users"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/connector/graph"
@ -117,7 +117,7 @@ func (cfc *contactFolderCache) Populate(
break break
} }
builder = cf.NewChildFoldersRequestBuilder(*resp.GetOdataNextLink(), cfc.gs.Adapter()) builder = msuser.NewUsersItemContactFoldersItemChildFoldersRequestBuilder(*resp.GetOdataNextLink(), cfc.gs.Adapter())
} }
if err := cfc.populatePaths(ctx); err != nil { if err := cfc.populatePaths(ctx); err != nil {

View File

@ -1,121 +0,0 @@
package exchange
import (
"context"
abs "github.com/microsoft/kiota-abstractions-go"
"github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors"
mscontactdelta "github.com/microsoftgraph/msgraph-sdk-go/users/item/contactfolders/item/contacts/delta"
msmaildelta "github.com/microsoftgraph/msgraph-sdk-go/users/item/mailfolders/item/messages/delta"
)
//nolint:lll
const (
mailURLTemplate = "{+baseurl}/users/{user%2Did}/mailFolders/{mailFolder%2Did}/messages/microsoft.graph.delta(){?%24top,%24skip,%24search,%24filter,%24count,%24select,%24orderby}"
contactsURLTemplate = "{+baseurl}/users/{user%2Did}/contactFolders/{contactFolder%2Did}/contacts/microsoft.graph.delta(){?%24top,%24skip,%24search,%24filter,%24count,%24select,%24orderby}"
)
// The following functions are based off the code in v0.41.0 of msgraph-sdk-go
// for sending delta requests with query parameters.
func createGetRequestInformationWithRequestConfiguration(
baseRequestInfoFunc func() (*abs.RequestInformation, error),
requestConfig *DeltaRequestBuilderGetRequestConfiguration,
template string,
) (*abs.RequestInformation, error) {
requestInfo, err := baseRequestInfoFunc()
if err != nil {
return nil, err
}
requestInfo.UrlTemplate = template
if requestConfig != nil {
if requestConfig.QueryParameters != nil {
requestInfo.AddQueryParameters(*(requestConfig.QueryParameters))
}
requestInfo.AddRequestHeaders(requestConfig.Headers)
requestInfo.AddRequestOptions(requestConfig.Options)
}
return requestInfo, nil
}
func sendMessagesDeltaGet(
ctx context.Context,
m *msmaildelta.DeltaRequestBuilder,
requestConfiguration *DeltaRequestBuilderGetRequestConfiguration,
adapter abs.RequestAdapter,
) (msmaildelta.DeltaResponseable, error) {
requestInfo, err := createGetRequestInformationWithRequestConfiguration(
func() (*abs.RequestInformation, error) {
return m.CreateGetRequestInformationWithRequestConfiguration(nil)
},
requestConfiguration,
mailURLTemplate,
)
if err != nil {
return nil, err
}
errorMapping := abs.ErrorMappings{
"4XX": odataerrors.CreateODataErrorFromDiscriminatorValue,
"5XX": odataerrors.CreateODataErrorFromDiscriminatorValue,
}
res, err := adapter.SendAsync(
ctx,
requestInfo,
msmaildelta.CreateDeltaResponseFromDiscriminatorValue,
errorMapping,
)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.(msmaildelta.DeltaResponseable), nil
}
func sendContactsDeltaGet(
ctx context.Context,
m *mscontactdelta.DeltaRequestBuilder,
requestConfiguration *DeltaRequestBuilderGetRequestConfiguration,
adapter abs.RequestAdapter,
) (mscontactdelta.DeltaResponseable, error) {
requestInfo, err := createGetRequestInformationWithRequestConfiguration(
func() (*abs.RequestInformation, error) {
return m.CreateGetRequestInformationWithRequestConfiguration(nil)
},
requestConfiguration,
contactsURLTemplate,
)
if err != nil {
return nil, err
}
errorMapping := abs.ErrorMappings{
"4XX": odataerrors.CreateODataErrorFromDiscriminatorValue,
"5XX": odataerrors.CreateODataErrorFromDiscriminatorValue,
}
res, err := adapter.SendAsync(
ctx,
requestInfo,
mscontactdelta.CreateDeltaResponseFromDiscriminatorValue,
errorMapping,
)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.(mscontactdelta.DeltaResponseable), nil
}

View File

@ -3,7 +3,7 @@ package exchange
import ( import (
"context" "context"
mscal "github.com/microsoftgraph/msgraph-sdk-go/users/item/calendars" msuser "github.com/microsoftgraph/msgraph-sdk-go/users"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/connector/graph"
@ -68,7 +68,7 @@ func (ecc *eventCalendarCache) Populate(
break break
} }
builder = mscal.NewCalendarsRequestBuilder(*resp.GetOdataNextLink(), ecc.gs.Adapter()) builder = msuser.NewUsersItemCalendarsRequestBuilder(*resp.GetOdataNextLink(), ecc.gs.Adapter())
} }
for _, container := range directories { for _, container := range directories {

View File

@ -120,42 +120,6 @@ func (suite *ExchangeServiceSuite) TestOptionsForCalendars() {
} }
} }
// TestOptionsForMessages checks to ensure approved query
// options are added to the type specific RequestBuildConfiguration. Expected
// will be +1 on all select parameters
func (suite *ExchangeServiceSuite) TestOptionsForMessages() {
tests := []struct {
name string
params []string
checkError assert.ErrorAssertionFunc
}{
{
name: "Valid Message Option",
params: []string{"subject"},
checkError: assert.NoError,
},
{
name: "Multiple Message Options: Accepted",
params: []string{"webLink", "parentFolderId"},
checkError: assert.NoError,
},
{
name: "Invalid Message Parameter",
params: []string{"status"},
checkError: assert.Error,
},
}
for _, test := range tests {
suite.T().Run(test.name, func(t *testing.T) {
config, err := optionsForMessages(test.params)
test.checkError(t, err)
if err == nil {
suite.Equal(len(config.QueryParameters.Select), len(test.params)+1)
}
})
}
}
// TestOptionsForFolders ensures that approved query options // TestOptionsForFolders ensures that approved query options
// are added to the RequestBuildConfiguration. Expected will always be +1 // are added to the RequestBuildConfiguration. Expected will always be +1
// on than the input as "id" are always included within the select parameters // on than the input as "id" are always included within the select parameters

View File

@ -38,10 +38,4 @@ const (
rootFolderAlias = "msgfolderroot" rootFolderAlias = "msgfolderroot"
DefaultContactFolder = "Contacts" DefaultContactFolder = "Contacts"
DefaultCalendar = "Calendar" DefaultCalendar = "Calendar"
// ----------------------------------
// Paging
// ----------------------------------
// nextDataLink definition https://docs.microsoft.com/en-us/graph/paging
nextDataLink = "@odata.nextLink"
) )

View File

@ -4,7 +4,7 @@ import (
"context" "context"
multierror "github.com/hashicorp/go-multierror" multierror "github.com/hashicorp/go-multierror"
msfolderdelta "github.com/microsoftgraph/msgraph-sdk-go/users/item/mailfolders/item/childfolders/delta" msfolderdelta "github.com/microsoftgraph/msgraph-sdk-go/users"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/connector/graph"
@ -23,16 +23,13 @@ type mailFolderCache struct {
userID string userID string
} }
// populateMailRoot fetches and populates the "base" directory from user's inbox. // populateMailRoot manually fetches directories that are not returned during Graph for msgraph-sdk-go v. 40+
// rootFolderAlias is the top-level directory for exchange.Mail.
// DefaultMailFolder is the traditional "Inbox" for exchange.Mail
// Action ensures that cache will stop at appropriate level. // Action ensures that cache will stop at appropriate level.
// @param directory: M365 ID of the root all intended inquiries.
// Function should only be used directly when it is known that all
// folder inquiries are going to a specific node. In all other cases
// @error iff the struct is not properly instantiated // @error iff the struct is not properly instantiated
func (mc *mailFolderCache) populateMailRoot( func (mc *mailFolderCache) populateMailRoot(
ctx context.Context, ctx context.Context,
directoryID string,
baseContainerPath []string,
) error { ) error {
wantedOpts := []string{"displayName", "parentFolderId"} wantedOpts := []string{"displayName", "parentFolderId"}
@ -41,24 +38,32 @@ func (mc *mailFolderCache) populateMailRoot(
return errors.Wrapf(err, "getting options for mail folders %v", wantedOpts) return errors.Wrapf(err, "getting options for mail folders %v", wantedOpts)
} }
for _, fldr := range []string{rootFolderAlias, DefaultMailFolder} {
var directory string
f, err := mc. f, err := mc.
gs. gs.
Client(). Client().
UsersById(mc.userID). UsersById(mc.userID).
MailFoldersById(directoryID). MailFoldersById(fldr).
Get(ctx, opts) Get(ctx, opts)
if err != nil { if err != nil {
return errors.Wrap(err, "fetching root folder"+support.ConnectorStackErrorTrace(err)) return errors.Wrap(err, "fetching root folder"+support.ConnectorStackErrorTrace(err))
} }
if fldr == DefaultMailFolder {
directory = DefaultMailFolder
}
temp := cacheFolder{ temp := cacheFolder{
Container: f, Container: f,
p: path.Builder{}.Append(baseContainerPath...), p: path.Builder{}.Append(directory),
} }
if err := mc.addFolder(temp); err != nil { if err := mc.addFolder(temp); err != nil {
return errors.Wrap(err, "initializing mail resolver") return errors.Wrap(err, "initializing mail resolver")
} }
}
return nil return nil
} }
@ -73,7 +78,7 @@ func (mc *mailFolderCache) Populate(
baseID string, baseID string,
baseContainerPath ...string, baseContainerPath ...string,
) error { ) error {
if err := mc.init(ctx, baseID, baseContainerPath); err != nil { if err := mc.init(ctx); err != nil {
return err return err
} }
@ -81,13 +86,11 @@ func (mc *mailFolderCache) Populate(
gs. gs.
Client(). Client().
UsersById(mc.userID). UsersById(mc.userID).
MailFoldersById(baseID).ChildFolders(). MailFolders().
Delta() Delta()
var errs *multierror.Error var errs *multierror.Error
// TODO: Cannot use Iterator for delta
// Awaiting resolution: https://github.com/microsoftgraph/msgraph-sdk-go/issues/272
for { for {
resp, err := query.Get(ctx, nil) resp, err := query.Get(ctx, nil)
if err != nil { if err != nil {
@ -108,15 +111,12 @@ func (mc *mailFolderCache) Populate(
} }
} }
r := resp.GetAdditionalData() link := resp.GetOdataNextLink()
if link == nil {
n, ok := r[nextDataLink]
if !ok || n == nil {
break break
} }
link := *(n.(*string)) query = msfolderdelta.NewUsersItemMailFoldersDeltaRequestBuilder(*link, mc.gs.Adapter())
query = msfolderdelta.NewDeltaRequestBuilder(link, mc.gs.Adapter())
} }
if err := mc.populatePaths(ctx); err != nil { if err := mc.populatePaths(ctx); err != nil {
@ -131,16 +131,10 @@ func (mc *mailFolderCache) Populate(
// [mc.cache] // [mc.cache]
func (mc *mailFolderCache) init( func (mc *mailFolderCache) init(
ctx context.Context, ctx context.Context,
baseNode string,
baseContainerPath []string,
) error { ) error {
if len(baseNode) == 0 {
return errors.New("m365 folder ID required for base folder")
}
if mc.containerResolver == nil { if mc.containerResolver == nil {
mc.containerResolver = newContainerResolver() mc.containerResolver = newContainerResolver()
} }
return mc.populateMailRoot(ctx, baseNode, baseContainerPath) return mc.populateMailRoot(ctx)
} }

View File

@ -3,18 +3,7 @@ package exchange
import ( import (
"fmt" "fmt"
abs "github.com/microsoft/kiota-abstractions-go" msuser "github.com/microsoftgraph/msgraph-sdk-go/users"
mscalendars "github.com/microsoftgraph/msgraph-sdk-go/users/item/calendars"
mscevents "github.com/microsoftgraph/msgraph-sdk-go/users/item/calendars/item/events"
mscontactfolder "github.com/microsoftgraph/msgraph-sdk-go/users/item/contactfolders"
mscontactfolderitem "github.com/microsoftgraph/msgraph-sdk-go/users/item/contactfolders/item"
mscontactfolderchild "github.com/microsoftgraph/msgraph-sdk-go/users/item/contactfolders/item/childfolders"
mscontacts "github.com/microsoftgraph/msgraph-sdk-go/users/item/contacts"
msevents "github.com/microsoftgraph/msgraph-sdk-go/users/item/events"
msfolder "github.com/microsoftgraph/msgraph-sdk-go/users/item/mailfolders"
msfolderitem "github.com/microsoftgraph/msgraph-sdk-go/users/item/mailfolders/item"
msmessage "github.com/microsoftgraph/msgraph-sdk-go/users/item/messages"
msitem "github.com/microsoftgraph/msgraph-sdk-go/users/item/messages/item"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/path"
@ -136,82 +125,40 @@ type DeltaRequestBuilderGetQueryParameters struct {
Top *int32 `uriparametername:"%24top"` Top *int32 `uriparametername:"%24top"`
} }
type DeltaRequestBuilderGetRequestConfiguration struct { func optionsForFolderMessagesDelta(
Headers map[string]string moreOps []string,
Options []abs.RequestOption ) (*msuser.UsersItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration, error) {
QueryParameters *DeltaRequestBuilderGetQueryParameters
}
func optionsForFolderMessages(moreOps []string) (*DeltaRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, messages) selecting, err := buildOptions(moreOps, messages)
if err != nil { if err != nil {
return nil, err return nil, err
} }
requestParameters := &DeltaRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemMailFoldersItemMessagesDeltaRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &DeltaRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
return options, nil return options, nil
} }
// optionsForMessages - used to select allowable options for exchange.Mail types
// @param moreOps is []string of options(e.g. "parentFolderId, subject")
// @return is first call in Messages().GetWithRequestConfigurationAndResponseHandler
func optionsForMessages(moreOps []string) (*msmessage.MessagesRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, messages)
if err != nil {
return nil, err
}
requestParameters := &msmessage.MessagesRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msmessage.MessagesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
return options, nil
}
// optionsForSingleMessage to select allowable option for a singular exchange.Mail object
// @params moreOps is []string of options (e.g. subject, content.Type)
// @return is first call in MessageById().GetWithRequestConfigurationAndResponseHandler
func OptionsForSingleMessage(moreOps []string) (*msitem.MessageItemRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, messages)
if err != nil {
return nil, err
}
requestParams := &msitem.MessageItemRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msitem.MessageItemRequestBuilderGetRequestConfiguration{
QueryParameters: requestParams,
}
return options, nil
}
// optionsForCalendars places allowed options for exchange.Calendar object // optionsForCalendars places allowed options for exchange.Calendar object
// @param moreOps should reflect elements from fieldsForCalendars // @param moreOps should reflect elements from fieldsForCalendars
// @return is first call in Calendars().GetWithRequestConfigurationAndResponseHandler // @return is first call in Calendars().GetWithRequestConfigurationAndResponseHandler
func optionsForCalendars(moreOps []string) ( func optionsForCalendars(moreOps []string) (
*mscalendars.CalendarsRequestBuilderGetRequestConfiguration, *msuser.UsersItemCalendarsRequestBuilderGetRequestConfiguration,
error, error,
) { ) {
selecting, err := buildOptions(moreOps, calendars) selecting, err := buildOptions(moreOps, calendars)
if err != nil { if err != nil {
return nil, err return nil, err
} }
// should be a CalendarsRequestBuilderGetRequestConfiguration
requestParams := &mscalendars.CalendarsRequestBuilderGetQueryParameters{ requestParams := &msuser.UsersItemCalendarsRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &mscalendars.CalendarsRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemCalendarsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParams, QueryParameters: requestParams,
} }
@ -221,7 +168,7 @@ func optionsForCalendars(moreOps []string) (
// optionsForContactFolders places allowed options for exchange.ContactFolder object // optionsForContactFolders places allowed options for exchange.ContactFolder object
// @return is first call in ContactFolders().GetWithRequestConfigurationAndResponseHandler // @return is first call in ContactFolders().GetWithRequestConfigurationAndResponseHandler
func optionsForContactFolders(moreOps []string) ( func optionsForContactFolders(moreOps []string) (
*mscontactfolder.ContactFoldersRequestBuilderGetRequestConfiguration, *msuser.UsersItemContactFoldersRequestBuilderGetRequestConfiguration,
error, error,
) { ) {
selecting, err := buildOptions(moreOps, folders) selecting, err := buildOptions(moreOps, folders)
@ -229,10 +176,10 @@ func optionsForContactFolders(moreOps []string) (
return nil, err return nil, err
} }
requestParameters := &mscontactfolder.ContactFoldersRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemContactFoldersRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &mscontactfolder.ContactFoldersRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemContactFoldersRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
@ -240,7 +187,7 @@ func optionsForContactFolders(moreOps []string) (
} }
func optionsForContactFolderByID(moreOps []string) ( func optionsForContactFolderByID(moreOps []string) (
*mscontactfolderitem.ContactFolderItemRequestBuilderGetRequestConfiguration, *msuser.UsersItemContactFoldersContactFolderItemRequestBuilderGetRequestConfiguration,
error, error,
) { ) {
selecting, err := buildOptions(moreOps, folders) selecting, err := buildOptions(moreOps, folders)
@ -248,10 +195,10 @@ func optionsForContactFolderByID(moreOps []string) (
return nil, err return nil, err
} }
requestParameters := &mscontactfolderitem.ContactFolderItemRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemContactFoldersContactFolderItemRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &mscontactfolderitem.ContactFolderItemRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemContactFoldersContactFolderItemRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
@ -261,16 +208,18 @@ func optionsForContactFolderByID(moreOps []string) (
// optionsForMailFolders transforms the options into a more dynamic call for MailFolders. // optionsForMailFolders transforms the options into a more dynamic call for MailFolders.
// @param moreOps is a []string of options(e.g. "displayName", "isHidden") // @param moreOps is a []string of options(e.g. "displayName", "isHidden")
// @return is first call in MailFolders().GetWithRequestConfigurationAndResponseHandler(options, handler) // @return is first call in MailFolders().GetWithRequestConfigurationAndResponseHandler(options, handler)
func optionsForMailFolders(moreOps []string) (*msfolder.MailFoldersRequestBuilderGetRequestConfiguration, error) { func optionsForMailFolders(
moreOps []string,
) (*msuser.UsersItemMailFoldersRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, folders) selecting, err := buildOptions(moreOps, folders)
if err != nil { if err != nil {
return nil, err return nil, err
} }
requestParameters := &msfolder.MailFoldersRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemMailFoldersRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &msfolder.MailFoldersRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemMailFoldersRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
@ -282,35 +231,35 @@ func optionsForMailFolders(moreOps []string) (*msfolder.MailFoldersRequestBuilde
// Returns first call in MailFoldersById().GetWithRequestConfigurationAndResponseHandler(options, handler) // Returns first call in MailFoldersById().GetWithRequestConfigurationAndResponseHandler(options, handler)
func optionsForMailFoldersItem( func optionsForMailFoldersItem(
moreOps []string, moreOps []string,
) (*msfolderitem.MailFolderItemRequestBuilderGetRequestConfiguration, error) { ) (*msuser.UsersItemMailFoldersMailFolderItemRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, folders) selecting, err := buildOptions(moreOps, folders)
if err != nil { if err != nil {
return nil, err return nil, err
} }
requestParameters := &msfolderitem.MailFolderItemRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemMailFoldersMailFolderItemRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &msfolderitem.MailFolderItemRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemMailFoldersMailFolderItemRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
return options, nil return options, nil
} }
// optionsForContactFoldersItem is the same as optionsForContacts. func optionsForContactFoldersItemDelta(
func optionsForContactFoldersItem(
moreOps []string, moreOps []string,
) (*DeltaRequestBuilderGetRequestConfiguration, error) { ) (*msuser.UsersItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, contacts) selecting, err := buildOptions(moreOps, contacts)
if err != nil { if err != nil {
return nil, err return nil, err
} }
requestParameters := &DeltaRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemContactFoldersItemContactsDeltaRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &DeltaRequestBuilderGetRequestConfiguration{
options := &msuser.UsersItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
@ -319,34 +268,36 @@ func optionsForContactFoldersItem(
// optionsForEvents ensures valid option inputs for exchange.Events // optionsForEvents ensures valid option inputs for exchange.Events
// @return is first call in Events().GetWithRequestConfigurationAndResponseHandler(options, handler) // @return is first call in Events().GetWithRequestConfigurationAndResponseHandler(options, handler)
func optionsForCalendarEvents(moreOps []string) (*mscevents.EventsRequestBuilderGetRequestConfiguration, error) { func optionsForEvents(moreOps []string) (*msuser.UsersItemEventsRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, events) selecting, err := buildOptions(moreOps, events)
if err != nil { if err != nil {
return nil, err return nil, err
} }
requestParameters := &mscevents.EventsRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemEventsRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &mscevents.EventsRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemEventsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
return options, nil return options, nil
} }
// optionsForEvents ensures valid option inputs for exchange.Events // optionsForEvents ensures a valid option inputs for `exchange.Events` when selected from within a Calendar
// @return is first call in Events().GetWithRequestConfigurationAndResponseHandler(options, handler) func optionsForEventsByCalendar(
func optionsForEvents(moreOps []string) (*msevents.EventsRequestBuilderGetRequestConfiguration, error) { moreOps []string,
) (*msuser.UsersItemCalendarsItemEventsRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, events) selecting, err := buildOptions(moreOps, events)
if err != nil { if err != nil {
return nil, err return nil, err
} }
requestParameters := &msevents.EventsRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemCalendarsItemEventsRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &msevents.EventsRequestBuilderGetRequestConfiguration{
options := &msuser.UsersItemCalendarsItemEventsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
@ -356,16 +307,16 @@ func optionsForEvents(moreOps []string) (*msevents.EventsRequestBuilderGetReques
// optionsForContactChildFolders builds a contacts child folders request. // optionsForContactChildFolders builds a contacts child folders request.
func optionsForContactChildFolders( func optionsForContactChildFolders(
moreOps []string, moreOps []string,
) (*mscontactfolderchild.ChildFoldersRequestBuilderGetRequestConfiguration, error) { ) (*msuser.UsersItemContactFoldersItemChildFoldersRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, contacts) selecting, err := buildOptions(moreOps, contacts)
if err != nil { if err != nil {
return nil, err return nil, err
} }
requestParameters := &mscontactfolderchild.ChildFoldersRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemContactFoldersItemChildFoldersRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &mscontactfolderchild.ChildFoldersRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemContactFoldersItemChildFoldersRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }
@ -374,16 +325,16 @@ func optionsForContactChildFolders(
// optionsForContacts transforms options into select query for MailContacts // optionsForContacts transforms options into select query for MailContacts
// @return is the first call in Contacts().GetWithRequestConfigurationAndResponseHandler(options, handler) // @return is the first call in Contacts().GetWithRequestConfigurationAndResponseHandler(options, handler)
func optionsForContacts(moreOps []string) (*mscontacts.ContactsRequestBuilderGetRequestConfiguration, error) { func optionsForContacts(moreOps []string) (*msuser.UsersItemContactsRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, contacts) selecting, err := buildOptions(moreOps, contacts)
if err != nil { if err != nil {
return nil, err return nil, err
} }
requestParameters := &mscontacts.ContactsRequestBuilderGetQueryParameters{ requestParameters := &msuser.UsersItemContactsRequestBuilderGetQueryParameters{
Select: selecting, Select: selecting,
} }
options := &mscontacts.ContactsRequestBuilderGetRequestConfiguration{ options := &msuser.UsersItemContactsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters, QueryParameters: requestParameters,
} }

View File

@ -204,14 +204,11 @@ func pathAndMatch(
category, category,
false, false,
) )
// Containers without a path (e.g. Root mail folder) always err here.
if err != nil { if err != nil {
return nil, false return nil, false
} }
if dirPath == nil && category == path.EmailCategory {
return nil, false // Only true for root mail folder
}
directory = pb.String() directory = pb.String()
switch category { switch category {

View File

@ -9,9 +9,7 @@ import (
multierror "github.com/hashicorp/go-multierror" multierror "github.com/hashicorp/go-multierror"
"github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/models"
msevents "github.com/microsoftgraph/msgraph-sdk-go/users/item/calendars/item/events" msuser "github.com/microsoftgraph/msgraph-sdk-go/users"
cdelta "github.com/microsoftgraph/msgraph-sdk-go/users/item/contactfolders/item/contacts/delta"
mdelta "github.com/microsoftgraph/msgraph-sdk-go/users/item/mailfolders/item/messages/delta"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/connector/graph"
@ -22,31 +20,9 @@ import (
) )
const ( const (
nextLinkKey = "@odata.nextLink"
deltaLinkKey = "@odata.deltaLink"
metadataKey = "metadata" metadataKey = "metadata"
) )
// getAdditionalDataString gets a string value from the AdditionalData map. If
// the value is not in the map returns an empty string.
func getAdditionalDataString(
key string,
addtlData map[string]any,
) string {
iface := addtlData[key]
if iface == nil {
return ""
}
value, ok := iface.(*string)
if !ok {
return ""
}
return *value
}
// makeMetadataCollection creates a metadata collection that has a file // makeMetadataCollection creates a metadata collection that has a file
// containing all the delta tokens in tokens. Returns nil if the map does not // containing all the delta tokens in tokens. Returns nil if the map does not
// have any entries. // have any entries.
@ -265,7 +241,7 @@ func FetchEventIDsFromCalendar(
ids []string ids []string
) )
options, err := optionsForCalendarEvents([]string{"id"}) options, err := optionsForEventsByCalendar([]string{"id"})
if err != nil { if err != nil {
return nil, "", err return nil, "", err
} }
@ -300,7 +276,7 @@ func FetchEventIDsFromCalendar(
break break
} }
builder = msevents.NewEventsRequestBuilder(*nextLink, gs.Adapter()) builder = msuser.NewUsersItemCalendarsItemEventsRequestBuilder(*nextLink, gs.Adapter())
} }
// Events don't have a delta endpoint so just return an empty string. // Events don't have a delta endpoint so just return an empty string.
@ -320,7 +296,7 @@ func FetchContactIDsFromDirectory(
deltaToken string deltaToken string
) )
options, err := optionsForContactFoldersItem([]string{"parentFolderId"}) options, err := optionsForContactFoldersItemDelta([]string{"parentFolderId"})
if err != nil { if err != nil {
return nil, deltaToken, errors.Wrap(err, "getting query options") return nil, deltaToken, errors.Wrap(err, "getting query options")
} }
@ -332,8 +308,7 @@ func FetchContactIDsFromDirectory(
Delta() Delta()
for { for {
// TODO(ashmrtn): Update to pass options once graph SDK dependency is updated. resp, err := builder.Get(ctx, options)
resp, err := sendContactsDeltaGet(ctx, builder, options, gs.Adapter())
if err != nil { if err != nil {
return nil, deltaToken, errors.Wrap(err, support.ConnectorStackErrorTrace(err)) return nil, deltaToken, errors.Wrap(err, support.ConnectorStackErrorTrace(err))
} }
@ -352,19 +327,17 @@ func FetchContactIDsFromDirectory(
ids = append(ids, *item.GetId()) ids = append(ids, *item.GetId())
} }
addtlData := resp.GetAdditionalData() delta := resp.GetOdataDeltaLink()
if delta != nil && len(*delta) > 0 {
delta := getAdditionalDataString(deltaLinkKey, addtlData) deltaToken = *delta
if len(delta) > 0 {
deltaToken = delta
} }
nextLink := getAdditionalDataString(nextLinkKey, addtlData) nextLink := resp.GetOdataNextLink()
if len(nextLink) == 0 { if nextLink == nil || len(*nextLink) == 0 {
break break
} }
builder = cdelta.NewDeltaRequestBuilder(nextLink, gs.Adapter()) builder = msuser.NewUsersItemContactFoldersItemContactsDeltaRequestBuilder(*nextLink, gs.Adapter())
} }
return ids, deltaToken, errs.ErrorOrNil() return ids, deltaToken, errs.ErrorOrNil()
@ -383,7 +356,7 @@ func FetchMessageIDsFromDirectory(
deltaToken string deltaToken string
) )
options, err := optionsForFolderMessages([]string{"id"}) options, err := optionsForFolderMessagesDelta([]string{"id"})
if err != nil { if err != nil {
return nil, deltaToken, errors.Wrap(err, "getting query options") return nil, deltaToken, errors.Wrap(err, "getting query options")
} }
@ -395,8 +368,7 @@ func FetchMessageIDsFromDirectory(
Delta() Delta()
for { for {
// TODO(ashmrtn): Update to pass options once graph SDK dependency is updated. resp, err := builder.Get(ctx, options)
resp, err := sendMessagesDeltaGet(ctx, builder, options, gs.Adapter())
if err != nil { if err != nil {
return nil, deltaToken, errors.Wrap(err, support.ConnectorStackErrorTrace(err)) return nil, deltaToken, errors.Wrap(err, support.ConnectorStackErrorTrace(err))
} }
@ -415,19 +387,17 @@ func FetchMessageIDsFromDirectory(
ids = append(ids, *item.GetId()) ids = append(ids, *item.GetId())
} }
addtlData := resp.GetAdditionalData() delta := resp.GetOdataDeltaLink()
if delta != nil && len(*delta) > 0 {
delta := getAdditionalDataString(deltaLinkKey, addtlData) deltaToken = *delta
if len(delta) > 0 {
deltaToken = delta
} }
nextLink := getAdditionalDataString(nextLinkKey, addtlData) nextLink := resp.GetOdataNextLink()
if len(nextLink) == 0 { if nextLink == nil || len(*nextLink) == 0 {
break break
} }
builder = mdelta.NewDeltaRequestBuilder(nextLink, gs.Adapter()) builder = msuser.NewUsersItemMailFoldersItemMessagesDeltaRequestBuilder(*nextLink, gs.Adapter())
} }
return ids, deltaToken, errs.ErrorOrNil() return ids, deltaToken, errs.ErrorOrNil()

View File

@ -524,8 +524,8 @@ func establishMailRestoreLocation(
for _, folder := range folders { for _, folder := range folders {
pb = *pb.Append(folder) pb = *pb.Append(folder)
cached, ok := mfc.PathInCache(pb.String())
cached, ok := mfc.PathInCache(pb.String())
if ok { if ok {
folderID = cached folderID = cached
continue continue
@ -544,7 +544,7 @@ func establishMailRestoreLocation(
// newCache to false in this we'll only try to populate it once per function // newCache to false in this we'll only try to populate it once per function
// call even if we make a new cache. // call even if we make a new cache.
if isNewCache { if isNewCache {
if err := mfc.Populate(ctx, folderID, folder); err != nil { if err := mfc.Populate(ctx, rootFolderAlias); err != nil {
return "", errors.Wrap(err, "populating folder cache") return "", errors.Wrap(err, "populating folder cache")
} }

View File

@ -244,10 +244,9 @@ func checkMessage(
// Skip CreatedDateTime as it's tied to this specific instance of the item. // Skip CreatedDateTime as it's tied to this specific instance of the item.
assert.Equal(t, expected.GetFlag(), got.GetFlag(), "Flag") checkFlags(t, expected.GetFlag(), got.GetFlag())
assert.Equal(t, expected.GetFrom(), got.GetFrom(), "From")
checkRecipentables(t, expected.GetFrom(), got.GetFrom())
testEmptyOrEqual(t, expected.GetHasAttachments(), got.GetHasAttachments(), "HasAttachments") testEmptyOrEqual(t, expected.GetHasAttachments(), got.GetHasAttachments(), "HasAttachments")
// Skip Id as it's tied to this specific instance of the item. // Skip Id as it's tied to this specific instance of the item.
@ -281,7 +280,7 @@ func checkMessage(
assert.Equal(t, expected.GetReplyTo(), got.GetReplyTo(), "ReplyTo") assert.Equal(t, expected.GetReplyTo(), got.GetReplyTo(), "ReplyTo")
assert.Equal(t, expected.GetSender(), got.GetSender(), "Sender") checkRecipentables(t, expected.GetSender(), got.GetSender())
testEmptyOrEqual(t, expected.GetSentDateTime(), got.GetSentDateTime(), "SentDateTime") testEmptyOrEqual(t, expected.GetSentDateTime(), got.GetSentDateTime(), "SentDateTime")
@ -294,6 +293,39 @@ func checkMessage(
assert.Equal(t, expected.GetUniqueBody(), got.GetUniqueBody(), "UniqueBody") assert.Equal(t, expected.GetUniqueBody(), got.GetUniqueBody(), "UniqueBody")
} }
// checkFlags is a helper function to check equality of models.FollowupFlabables
// OdataTypes are omitted as these do change between msgraph-sdk-go versions
func checkFlags(
t *testing.T,
expected, got models.FollowupFlagable,
) {
assert.Equal(t, expected.GetCompletedDateTime(), got.GetCompletedDateTime())
assert.Equal(t, expected.GetDueDateTime(), got.GetDueDateTime())
assert.Equal(t, expected.GetFlagStatus(), got.GetFlagStatus())
assert.Equal(t, expected.GetStartDateTime(), got.GetStartDateTime())
assert.Equal(t, expected.GetAdditionalData(), got.GetAdditionalData())
}
// checkRecipentables is a helper function to check equality between
// models.Recipientables. OdataTypes omitted.
func checkRecipentables(
t *testing.T,
expected, got models.Recipientable,
) {
checkEmailAddressables(t, expected.GetEmailAddress(), got.GetEmailAddress())
assert.Equal(t, expected.GetAdditionalData(), got.GetAdditionalData())
}
// checkEmailAddressables inspects EmailAddressables for equality
func checkEmailAddressables(
t *testing.T,
expected, got models.EmailAddressable,
) {
assert.Equal(t, expected.GetAdditionalData(), got.GetAdditionalData())
assert.Equal(t, *expected.GetAddress(), *got.GetAddress())
assert.Equal(t, expected.GetName(), got.GetName())
}
func checkContact( func checkContact(
t *testing.T, t *testing.T,
expected models.Contactable, expected models.Contactable,

View File

@ -6,12 +6,11 @@ import (
"strings" "strings"
msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core" msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core"
"github.com/microsoftgraph/msgraph-sdk-go/drives/item/items" msdrive "github.com/microsoftgraph/msgraph-sdk-go/drive"
"github.com/microsoftgraph/msgraph-sdk-go/drives/item/items/item" msdrives "github.com/microsoftgraph/msgraph-sdk-go/drives"
"github.com/microsoftgraph/msgraph-sdk-go/drives/item/root/delta"
"github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/models"
"github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors"
mssitedrives "github.com/microsoftgraph/msgraph-sdk-go/sites/item/drives" "github.com/microsoftgraph/msgraph-sdk-go/sites"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/connector/graph"
@ -85,8 +84,8 @@ func drives(
} }
func siteDrives(ctx context.Context, service graph.Service, site string) ([]models.Driveable, error) { func siteDrives(ctx context.Context, service graph.Service, site string) ([]models.Driveable, error) {
options := &mssitedrives.DrivesRequestBuilderGetRequestConfiguration{ options := &sites.SitesItemDrivesRequestBuilderGetRequestConfiguration{
QueryParameters: &mssitedrives.DrivesRequestBuilderGetQueryParameters{ QueryParameters: &sites.SitesItemDrivesRequestBuilderGetQueryParameters{
Select: []string{"id", "name", "weburl", "system"}, Select: []string{"id", "name", "weburl", "system"},
}, },
} }
@ -161,13 +160,13 @@ func collectItems(
} }
// Check if there are more items // Check if there are more items
if _, found := r.GetAdditionalData()[nextLinkKey]; !found { nextLink := r.GetOdataNextLink()
if nextLink == nil {
break break
} }
nextLink := r.GetAdditionalData()[nextLinkKey].(*string)
logger.Ctx(ctx).Debugf("Found %s nextLink", *nextLink) logger.Ctx(ctx).Debugf("Found %s nextLink", *nextLink)
builder = delta.NewDeltaRequestBuilder(*nextLink, service.Adapter()) builder = msdrives.NewDrivesItemRootDeltaRequestBuilder(*nextLink, service.Adapter())
} }
return nil return nil
@ -185,8 +184,7 @@ func getFolder(
// https://learn.microsoft.com/en-us/graph/onedrive-addressing-driveitems#path-based-addressing // https://learn.microsoft.com/en-us/graph/onedrive-addressing-driveitems#path-based-addressing
// - which allows us to lookup an item by its path relative to the parent ID // - which allows us to lookup an item by its path relative to the parent ID
rawURL := fmt.Sprintf(itemByPathRawURLFmt, driveID, parentFolderID, folderName) rawURL := fmt.Sprintf(itemByPathRawURLFmt, driveID, parentFolderID, folderName)
builder := msdrive.NewDriveItemsDriveItemItemRequestBuilder(rawURL, service.Adapter())
builder := item.NewDriveItemItemRequestBuilder(rawURL, service.Adapter())
foundItem, err := builder.Get(ctx, nil) foundItem, err := builder.Get(ctx, nil)
if err != nil { if err != nil {
@ -225,7 +223,7 @@ func createItem(
// here: https://github.com/microsoftgraph/msgraph-sdk-go/issues/155#issuecomment-1136254310 // here: https://github.com/microsoftgraph/msgraph-sdk-go/issues/155#issuecomment-1136254310
rawURL := fmt.Sprintf(itemChildrenRawURLFmt, driveID, parentFolderID) rawURL := fmt.Sprintf(itemChildrenRawURLFmt, driveID, parentFolderID)
builder := items.NewItemsRequestBuilder(rawURL, service.Adapter()) builder := msdrive.NewDriveItemsRequestBuilder(rawURL, service.Adapter())
newItem, err := builder.Post(ctx, newItem, nil) newItem, err := builder.Post(ctx, newItem, nil)
if err != nil { if err != nil {

View File

@ -89,10 +89,6 @@ func (suite *OneDriveSuite) TestCreateGetDeleteFolder() {
for _, test := range table { for _, test := range table {
suite.T().Run(test.name, func(t *testing.T) { suite.T().Run(test.name, func(t *testing.T) {
if test.name == "NoPrefix" {
// TODO: Issue #1688
t.Skipf("Inconsistent test. Skipping until test is refactored")
}
allFolders, err := GetAllFolders(ctx, gs, suite.userID, test.prefix) allFolders, err := GetAllFolders(ctx, gs, suite.userID, test.prefix)
require.NoError(t, err) require.NoError(t, err)

View File

@ -7,7 +7,6 @@ import (
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core" msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core"
msup "github.com/microsoftgraph/msgraph-sdk-go/drives/item/items/item/createuploadsession"
"github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/models"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -161,14 +160,14 @@ func sharePointItemInfo(di models.DriveItemable, itemSize int64) *details.ShareP
// driveItemWriter is used to initialize and return an io.Writer to upload data for the specified item // driveItemWriter is used to initialize and return an io.Writer to upload data for the specified item
// It does so by creating an upload session and using that URL to initialize an `itemWriter` // It does so by creating an upload session and using that URL to initialize an `itemWriter`
// TODO: @vkamra verify if var session is the desired input
func driveItemWriter( func driveItemWriter(
ctx context.Context, ctx context.Context,
service graph.Service, service graph.Service,
driveID, itemID string, driveID, itemID string,
itemSize int64, itemSize int64,
) (io.Writer, error) { ) (io.Writer, error) {
// TODO: @vkamra verify if var session is the desired input session := models.NewUsersItemDrivesItemItemsItemCreateUploadSessionPostRequestBody()
session := msup.NewCreateUploadSessionPostRequestBody()
r, err := service.Client().DrivesById(driveID).ItemsById(itemID).CreateUploadSession().Post(ctx, session, nil) r, err := service.Client().DrivesById(driveID).ItemsById(itemID).CreateUploadSession().Post(ctx, session, nil)
if err != nil { if err != nil {

View File

@ -4,12 +4,7 @@ import (
"context" "context"
"github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/models"
"github.com/microsoftgraph/msgraph-sdk-go/sites/item/lists" mssite "github.com/microsoftgraph/msgraph-sdk-go/sites"
"github.com/microsoftgraph/msgraph-sdk-go/sites/item/lists/item/columns"
"github.com/microsoftgraph/msgraph-sdk-go/sites/item/lists/item/contenttypes"
"github.com/microsoftgraph/msgraph-sdk-go/sites/item/lists/item/contenttypes/item/columnlinks"
tc "github.com/microsoftgraph/msgraph-sdk-go/sites/item/lists/item/contenttypes/item/columns"
"github.com/microsoftgraph/msgraph-sdk-go/sites/item/lists/item/items"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/connector/graph"
@ -81,7 +76,7 @@ func loadLists(
break break
} }
builder = lists.NewListsRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter()) builder = mssite.NewSitesItemListsRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter())
} }
if errs != nil { if errs != nil {
@ -130,7 +125,7 @@ func fetchListItems(
break break
} }
builder = items.NewItemsRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter()) builder = mssite.NewSitesItemListsItemItemsRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter())
} }
if errs != nil { if errs != nil {
@ -166,7 +161,7 @@ func fetchColumns(
break break
} }
builder = columns.NewColumnsRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter()) builder = mssite.NewSitesItemListsItemColumnsRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter())
} }
} else { } else {
builder := gs.Client().SitesById(siteID).ListsById(listID).ContentTypesById(cTypeID).Columns() builder := gs.Client().SitesById(siteID).ListsById(listID).ContentTypesById(cTypeID).Columns()
@ -183,7 +178,7 @@ func fetchColumns(
break break
} }
builder = tc.NewColumnsRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter()) builder = mssite.NewSitesItemListsItemContentTypesItemColumnsRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter())
} }
} }
@ -245,7 +240,7 @@ func fetchContentTypes(
break break
} }
builder = contenttypes.NewContentTypesRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter()) builder = mssite.NewSitesItemListsItemContentTypesRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter())
} }
if errs != nil { if errs != nil {
@ -277,7 +272,11 @@ func fetchColumnLinks(
break break
} }
builder = columnlinks.NewColumnLinksRequestBuilder(*resp.GetOdataNextLink(), gs.Adapter()) builder = mssite.
NewSitesItemListsItemContentTypesItemColumnLinksRequestBuilder(
*resp.GetOdataNextLink(),
gs.Adapter(),
)
} }
return links, nil return links, nil