Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
GC: MSGRAPH Linked Library Upgrades (#1861)
Browse files Browse the repository at this point in the history
## Description
Upstream Breaking changes applied for upgrade to the following libraries.
- kiota-abstractions-go from 0.14.0 to 0.15.1
- msgraph-sdk-go from 0.48.0 to 0.49.0
- msgraph-sdk-go-core from 0.30.1 to 0.31.0
- kiota-http-go from 0.9.0 to 0.10.0

## Does this PR need a docs update or release note?
- [x] ⛔ No 

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🐹 Trivial/Minor --> Library support and Upstream bug fixes

## Issue(s)

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

## Test Plan


- [x] ⚡ Unit test
  • Loading branch information
Danny authored Dec 19, 2022
1 parent 5b568a4 commit 20bfaee
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 68 deletions.
8 changes: 4 additions & 4 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ require (
github.com/google/uuid v1.3.0
github.com/hashicorp/go-multierror v1.1.1
github.com/kopia/kopia v0.12.0
github.com/microsoft/kiota-abstractions-go v0.14.0
github.com/microsoft/kiota-abstractions-go v0.15.1
github.com/microsoft/kiota-authentication-azure-go v0.5.0
github.com/microsoft/kiota-http-go v0.9.0
github.com/microsoft/kiota-http-go v0.10.0
github.com/microsoft/kiota-serialization-json-go v0.7.2
github.com/microsoftgraph/msgraph-sdk-go v0.48.0
github.com/microsoftgraph/msgraph-sdk-go-core v0.30.1
github.com/microsoftgraph/msgraph-sdk-go v0.49.0
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1
github.com/pkg/errors v0.9.1
github.com/rudderlabs/analytics-go v3.3.3+incompatible
github.com/spf13/cobra v1.6.1
Expand Down
16 changes: 8 additions & 8 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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/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/microsoft/kiota-abstractions-go v0.14.0 h1:TCYk1+CoBFNhTefKu8OTky4w4HnOoD72EJOeTsTNml8=
github.com/microsoft/kiota-abstractions-go v0.14.0/go.mod h1:/zQPz5M7868/bbN8D4tZHhnOE23Tcc/JBKSNwljOch4=
github.com/microsoft/kiota-abstractions-go v0.15.1 h1:RgN8h9Z3AoFav1K4ODVSkmA8Es933hTlAWNesll1G5U=
github.com/microsoft/kiota-abstractions-go v0.15.1/go.mod h1:YqOu8G6bZTG0eCIWrmEny8PaF750uaw7tLFac4psf+4=
github.com/microsoft/kiota-authentication-azure-go v0.5.0 h1:RVA/tTgMnDIN3u4qPZtvYvVRsQDOFkd3yvi6KXjZJko=
github.com/microsoft/kiota-authentication-azure-go v0.5.0/go.mod h1:1Io6h+88FlDRmrajdjSnXPz8oyObUVjNuQZLhrF9kQk=
github.com/microsoft/kiota-http-go v0.9.0 h1:q/JZpWOvHFbxrOjbd8pbODuTx4dlcLahTemM48di/y8=
github.com/microsoft/kiota-http-go v0.9.0/go.mod h1:F652dnY3jVNmwSk46qHXt+HeEbxLkbbn3dUi3lSLHws=
github.com/microsoft/kiota-http-go v0.10.0 h1:hJwIMkZqgPwRsoZfV5hC4O2OeMvPEZDuhTcyI7Xx3IM=
github.com/microsoft/kiota-http-go v0.10.0/go.mod h1:qr6x7O4SkEJiFVtnlwvNXapwmtJ85ifAiuqOYkKc7hY=
github.com/microsoft/kiota-serialization-json-go v0.7.2 h1:DSb4fNDi5O+DqJwrHo+vRy2kSvfxG5VtN6m1EHzn5Vw=
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/go.mod h1:OUA4dNH+f6afiJUs+rQAatJos7QVF5PJkyrqoD89lx4=
github.com/microsoftgraph/msgraph-sdk-go v0.48.0 h1:N93MVg4LgM45lK70PNTRaKCk5kw8sdfgHTXS0qc1VFg=
github.com/microsoftgraph/msgraph-sdk-go v0.48.0/go.mod h1:I2iR+gJmKiZZ8ebE8mKQEiKXpePAahAIazx3F1kL6og=
github.com/microsoftgraph/msgraph-sdk-go-core v0.30.1 h1:jBuYexMqKnjsnQpyICfdu0RhZr7RFkEcKWRm3hf/jMM=
github.com/microsoftgraph/msgraph-sdk-go-core v0.30.1/go.mod h1:RyqsMRKmZADSA/feLQMcynQJRENMzKM/Wg4dgQ/lW+s=
github.com/microsoftgraph/msgraph-sdk-go v0.49.0 h1:ZCjnH6AElZ20wXXTzJn3sfZeG+2Q2+KGvUsFrmhJzZY=
github.com/microsoftgraph/msgraph-sdk-go v0.49.0/go.mod h1:pZ3XhqN+Ll9trl1HEGQhyS905PcqHv9EhuCMMxPR9EQ=
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1 h1:aVvnO5l8qLCEcvELc5n9grt7UXhAVtpog1QeQKLMlTE=
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1/go.mod h1:RE4F2qGCTehGtQGc9Txafc4l+XMpbjYuO4amDLFgOWE=
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/minio-go/v7 v7.0.39 h1:upnbu1jCGOqEvrGSpRauSN9ZG7RCHK7VHxXS8Vmg2zk=
Expand Down
16 changes: 12 additions & 4 deletions src/internal/connector/exchange/attachment_uploadable.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/microsoftgraph/msgraph-sdk-go/models"
msusers "github.com/microsoftgraph/msgraph-sdk-go/users"
"github.com/pkg/errors"

"github.com/alcionai/corso/src/internal/connector/graph"
Expand Down Expand Up @@ -55,11 +56,18 @@ func (mau *mailAttachmentUploader) uploadSession(
attachmentName string,
attachmentSize int64,
) (models.UploadSessionable, error) {
session := models.NewUsersItemMailFoldersItemMessagesItemAttachmentsCreateUploadSessionPostRequestBody()
session := msusers.NewItemMailFoldersItemMessagesItemAttachmentsCreateUploadSessionPostRequestBody()
session.SetAttachmentItem(makeSessionAttachment(attachmentName, attachmentSize))

r, err := mau.service.Client().UsersById(mau.userID).MailFoldersById(mau.folderID).
MessagesById(mau.itemID).Attachments().CreateUploadSession().Post(ctx, session, nil)
r, err := mau.
service.
Client().
UsersById(mau.userID).
MailFoldersById(mau.folderID).
MessagesById(mau.itemID).
Attachments().
CreateUploadSession().
Post(ctx, session, nil)
if err != nil {
return nil, errors.Wrapf(
err,
Expand Down Expand Up @@ -103,7 +111,7 @@ func (eau *eventAttachmentUploader) uploadSession(
attachmentName string,
attachmentSize int64,
) (models.UploadSessionable, error) {
session := models.NewUsersItemCalendarEventsItemAttachmentsCreateUploadSessionPostRequestBody()
session := msusers.NewItemCalendarEventsItemAttachmentsCreateUploadSessionPostRequestBody()
session.SetAttachmentItem(makeSessionAttachment(attachmentName, attachmentSize))

r, err := eau.service.Client().
Expand Down
2 changes: 1 addition & 1 deletion src/internal/connector/exchange/contact_folder_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (cfc *contactFolderCache) Populate(
break
}

builder = msuser.NewUsersItemContactFoldersItemChildFoldersRequestBuilder(*resp.GetOdataNextLink(), cfc.gs.Adapter())
builder = msuser.NewItemContactFoldersItemChildFoldersRequestBuilder(*resp.GetOdataNextLink(), cfc.gs.Adapter())
}

if err := cfc.populatePaths(ctx); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/connector/exchange/event_calendar_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (ecc *eventCalendarCache) Populate(
break
}

builder = msuser.NewUsersItemCalendarsRequestBuilder(*resp.GetOdataNextLink(), ecc.gs.Adapter())
builder = msuser.NewItemCalendarsRequestBuilder(*resp.GetOdataNextLink(), ecc.gs.Adapter())
}

for _, container := range directories {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/connector/exchange/mail_folder_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (mc *mailFolderCache) Populate(
break
}

query = msfolderdelta.NewUsersItemMailFoldersDeltaRequestBuilder(*link, mc.gs.Adapter())
query = msfolderdelta.NewItemMailFoldersDeltaRequestBuilder(*link, mc.gs.Adapter())
}

if err := mc.populatePaths(ctx); err != nil {
Expand Down
66 changes: 33 additions & 33 deletions src/internal/connector/exchange/query_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ func CategoryToOptionIdentifier(category path.CategoryType) optionIdentifier {

func optionsForFolderMessagesDelta(
moreOps []string,
) (*msuser.UsersItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration, error) {
) (*msuser.ItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, messages)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemMailFoldersItemMessagesDeltaRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemMailFoldersItemMessagesDeltaRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration{
options := &msuser.ItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand All @@ -135,18 +135,18 @@ func optionsForFolderMessagesDelta(
// @param moreOps should reflect elements from fieldsForCalendars
// @return is first call in Calendars().GetWithRequestConfigurationAndResponseHandler
func optionsForCalendars(moreOps []string) (
*msuser.UsersItemCalendarsRequestBuilderGetRequestConfiguration,
*msuser.ItemCalendarsRequestBuilderGetRequestConfiguration,
error,
) {
selecting, err := buildOptions(moreOps, calendars)
if err != nil {
return nil, err
}
// should be a CalendarsRequestBuilderGetRequestConfiguration
requestParams := &msuser.UsersItemCalendarsRequestBuilderGetQueryParameters{
requestParams := &msuser.ItemCalendarsRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemCalendarsRequestBuilderGetRequestConfiguration{
options := &msuser.ItemCalendarsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParams,
}

Expand All @@ -156,37 +156,37 @@ func optionsForCalendars(moreOps []string) (
// optionsForContactFolders places allowed options for exchange.ContactFolder object
// @return is first call in ContactFolders().GetWithRequestConfigurationAndResponseHandler
func optionsForContactFolders(moreOps []string) (
*msuser.UsersItemContactFoldersRequestBuilderGetRequestConfiguration,
*msuser.ItemContactFoldersRequestBuilderGetRequestConfiguration,
error,
) {
selecting, err := buildOptions(moreOps, folders)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemContactFoldersRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemContactFoldersRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemContactFoldersRequestBuilderGetRequestConfiguration{
options := &msuser.ItemContactFoldersRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

return options, nil
}

func optionsForContactFolderByID(moreOps []string) (
*msuser.UsersItemContactFoldersContactFolderItemRequestBuilderGetRequestConfiguration,
*msuser.ItemContactFoldersContactFolderItemRequestBuilderGetRequestConfiguration,
error,
) {
selecting, err := buildOptions(moreOps, folders)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemContactFoldersContactFolderItemRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemContactFoldersContactFolderItemRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemContactFoldersContactFolderItemRequestBuilderGetRequestConfiguration{
options := &msuser.ItemContactFoldersContactFolderItemRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand All @@ -198,16 +198,16 @@ func optionsForContactFolderByID(moreOps []string) (
// @return is first call in MailFolders().GetWithRequestConfigurationAndResponseHandler(options, handler)
func optionsForMailFolders(
moreOps []string,
) (*msuser.UsersItemMailFoldersRequestBuilderGetRequestConfiguration, error) {
) (*msuser.ItemMailFoldersRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, folders)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemMailFoldersRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemMailFoldersRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemMailFoldersRequestBuilderGetRequestConfiguration{
options := &msuser.ItemMailFoldersRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand All @@ -219,16 +219,16 @@ func optionsForMailFolders(
// Returns first call in MailFoldersById().GetWithRequestConfigurationAndResponseHandler(options, handler)
func optionsForMailFoldersItem(
moreOps []string,
) (*msuser.UsersItemMailFoldersMailFolderItemRequestBuilderGetRequestConfiguration, error) {
) (*msuser.ItemMailFoldersMailFolderItemRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, folders)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemMailFoldersMailFolderItemRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemMailFoldersMailFolderItemRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemMailFoldersMailFolderItemRequestBuilderGetRequestConfiguration{
options := &msuser.ItemMailFoldersMailFolderItemRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand All @@ -237,17 +237,17 @@ func optionsForMailFoldersItem(

func optionsForContactFoldersItemDelta(
moreOps []string,
) (*msuser.UsersItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration, error) {
) (*msuser.ItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, contacts)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemContactFoldersItemContactsDeltaRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemContactFoldersItemContactsDeltaRequestBuilderGetQueryParameters{
Select: selecting,
}

options := &msuser.UsersItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration{
options := &msuser.ItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand All @@ -256,16 +256,16 @@ func optionsForContactFoldersItemDelta(

// optionsForEvents ensures valid option inputs for exchange.Events
// @return is first call in Events().GetWithRequestConfigurationAndResponseHandler(options, handler)
func optionsForEvents(moreOps []string) (*msuser.UsersItemEventsRequestBuilderGetRequestConfiguration, error) {
func optionsForEvents(moreOps []string) (*msuser.ItemEventsRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, events)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemEventsRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemEventsRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemEventsRequestBuilderGetRequestConfiguration{
options := &msuser.ItemEventsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand All @@ -275,17 +275,17 @@ func optionsForEvents(moreOps []string) (*msuser.UsersItemEventsRequestBuilderGe
// optionsForEvents ensures a valid option inputs for `exchange.Events` when selected from within a Calendar
func optionsForEventsByCalendar(
moreOps []string,
) (*msuser.UsersItemCalendarsItemEventsRequestBuilderGetRequestConfiguration, error) {
) (*msuser.ItemCalendarsItemEventsRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, events)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemCalendarsItemEventsRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemCalendarsItemEventsRequestBuilderGetQueryParameters{
Select: selecting,
}

options := &msuser.UsersItemCalendarsItemEventsRequestBuilderGetRequestConfiguration{
options := &msuser.ItemCalendarsItemEventsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand All @@ -295,16 +295,16 @@ func optionsForEventsByCalendar(
// optionsForContactChildFolders builds a contacts child folders request.
func optionsForContactChildFolders(
moreOps []string,
) (*msuser.UsersItemContactFoldersItemChildFoldersRequestBuilderGetRequestConfiguration, error) {
) (*msuser.ItemContactFoldersItemChildFoldersRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, contacts)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemContactFoldersItemChildFoldersRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemContactFoldersItemChildFoldersRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemContactFoldersItemChildFoldersRequestBuilderGetRequestConfiguration{
options := &msuser.ItemContactFoldersItemChildFoldersRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand All @@ -313,16 +313,16 @@ func optionsForContactChildFolders(

// optionsForContacts transforms options into select query for MailContacts
// @return is the first call in Contacts().GetWithRequestConfigurationAndResponseHandler(options, handler)
func optionsForContacts(moreOps []string) (*msuser.UsersItemContactsRequestBuilderGetRequestConfiguration, error) {
func optionsForContacts(moreOps []string) (*msuser.ItemContactsRequestBuilderGetRequestConfiguration, error) {
selecting, err := buildOptions(moreOps, contacts)
if err != nil {
return nil, err
}

requestParameters := &msuser.UsersItemContactsRequestBuilderGetQueryParameters{
requestParameters := &msuser.ItemContactsRequestBuilderGetQueryParameters{
Select: selecting,
}
options := &msuser.UsersItemContactsRequestBuilderGetRequestConfiguration{
options := &msuser.ItemContactsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}

Expand Down
6 changes: 3 additions & 3 deletions src/internal/connector/exchange/service_iterators.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func FetchEventIDsFromCalendar(
break
}

builder = msuser.NewUsersItemCalendarsItemEventsRequestBuilder(*nextLink, gs.Adapter())
builder = msuser.NewItemCalendarsItemEventsRequestBuilder(*nextLink, gs.Adapter())
}

// Events don't have a delta endpoint so just return an empty string.
Expand Down Expand Up @@ -402,7 +402,7 @@ func FetchContactIDsFromDirectory(
break
}

builder = msuser.NewUsersItemContactFoldersItemContactsDeltaRequestBuilder(*nextLink, gs.Adapter())
builder = msuser.NewItemContactFoldersItemContactsDeltaRequestBuilder(*nextLink, gs.Adapter())
}

return ids, deltaURL, errs.ErrorOrNil()
Expand Down Expand Up @@ -476,7 +476,7 @@ func FetchMessageIDsFromDirectory(
break
}

builder = msuser.NewUsersItemMailFoldersItemMessagesDeltaRequestBuilder(*nextLink, gs.Adapter())
builder = msuser.NewItemMailFoldersItemMessagesDeltaRequestBuilder(*nextLink, gs.Adapter())
}

return ids, deltaURL, errs.ErrorOrNil()
Expand Down
Loading

0 comments on commit 20bfaee

Please sign in to comment.