Merge branch 'main' into revert-3318-cor-84-calendar

This commit is contained in:
aviator-app[bot] 2023-05-05 23:08:27 +00:00 committed by GitHub
commit 70c35c6f7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 2 deletions

View File

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- --user and --mailbox flags have been removed from CLI examples for details and restore commands (they were already not supported, this only updates the docs).
- Improve restore time on large restores by optimizing how items are loaded from the remote repository.
- Remove exchange item filtering based on m365 item ID via the CLI.
- OneDrive backups no longer include a user's non-default drives.
## [v0.7.0] (beta) - 2023-05-02

View File

@ -104,6 +104,7 @@ func (p *driveItemPager) ValuesIn(l api.DeltaPageLinker) ([]models.DriveItemable
}
type userDrivePager struct {
userID string
gs graph.Servicer
builder *users.ItemDrivesRequestBuilder
options *users.ItemDrivesRequestBuilderGetRequestConfiguration
@ -121,6 +122,7 @@ func NewUserDrivePager(
}
res := &userDrivePager{
userID: userID,
gs: gs,
options: requestConfig,
builder: gs.Client().UsersById(userID).Drives(),
@ -129,17 +131,33 @@ func NewUserDrivePager(
return res
}
type nopUserDrivePageLinker struct {
drive models.Driveable
}
func (nl nopUserDrivePageLinker) GetOdataNextLink() *string { return nil }
func (p *userDrivePager) GetPage(ctx context.Context) (api.PageLinker, error) {
var (
resp api.PageLinker
err error
)
resp, err = p.builder.Get(ctx, p.options)
d, err := p.gs.Client().UsersById(p.userID).Drive().Get(ctx, nil)
if err != nil {
return nil, graph.Stack(ctx, err)
}
resp = &nopUserDrivePageLinker{drive: d}
// TODO(keepers): turn back on when we can separate drive enumeration
// from default drive lookup.
// resp, err = p.builder.Get(ctx, p.options)
// if err != nil {
// return nil, graph.Stack(ctx, err)
// }
return resp, nil
}
@ -148,7 +166,17 @@ func (p *userDrivePager) SetNext(link string) {
}
func (p *userDrivePager) ValuesIn(l api.PageLinker) ([]models.Driveable, error) {
return getValues[models.Driveable](l)
nl, ok := l.(*nopUserDrivePageLinker)
if !ok || nl == nil {
return nil, clues.New(fmt.Sprintf("improper page linker struct for user drives: %T", l))
}
// TODO(keepers): turn back on when we can separate drive enumeration
// from default drive lookup.
// return getValues[models.Driveable](l)
return []models.Driveable{nl.drive}, nil
}
type siteDrivePager struct {