Backup Details: Onedrive details expanded (#2085)
## Description Updates the amount of metadata available for OneDrive backups. This does not affect the way `OneDrive` information is displayed to the user. ## 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] 🌻 Feature ## Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> *closes #2074<issue> ## Test Plan - [x] ⚡ Unit test
This commit is contained in:
parent
daaa258867
commit
85b5877987
@ -94,7 +94,7 @@ func driveItemReader(
|
|||||||
// doesn't have its size value updated as a side effect of creation,
|
// doesn't have its size value updated as a side effect of creation,
|
||||||
// and kiota drops any SetSize update.
|
// and kiota drops any SetSize update.
|
||||||
func oneDriveItemInfo(di models.DriveItemable, itemSize int64) *details.OneDriveInfo {
|
func oneDriveItemInfo(di models.DriveItemable, itemSize int64) *details.OneDriveInfo {
|
||||||
email := ""
|
var email, parent string
|
||||||
|
|
||||||
if di.GetCreatedBy().GetUser() != nil {
|
if di.GetCreatedBy().GetUser() != nil {
|
||||||
// User is sometimes not available when created via some
|
// User is sometimes not available when created via some
|
||||||
@ -105,13 +105,21 @@ func oneDriveItemInfo(di models.DriveItemable, itemSize int64) *details.OneDrive
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if di.GetParentReference() != nil {
|
||||||
|
if di.GetParentReference().GetName() != nil {
|
||||||
|
// EndPoint is not always populated from external apps
|
||||||
|
parent = *di.GetParentReference().GetName()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return &details.OneDriveInfo{
|
return &details.OneDriveInfo{
|
||||||
ItemType: details.OneDriveItem,
|
ItemType: details.OneDriveItem,
|
||||||
ItemName: *di.GetName(),
|
ItemName: *di.GetName(),
|
||||||
Created: *di.GetCreatedDateTime(),
|
Created: *di.GetCreatedDateTime(),
|
||||||
Modified: *di.GetLastModifiedDateTime(),
|
Modified: *di.GetLastModifiedDateTime(),
|
||||||
Size: itemSize,
|
DriveName: parent,
|
||||||
Owner: email,
|
Size: itemSize,
|
||||||
|
Owner: email,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -520,6 +520,7 @@ func (i *SharePointInfo) UpdateParentPath(newPath path.Path) error {
|
|||||||
type OneDriveInfo struct {
|
type OneDriveInfo struct {
|
||||||
Created time.Time `json:"created,omitempty"`
|
Created time.Time `json:"created,omitempty"`
|
||||||
ItemName string `json:"itemName"`
|
ItemName string `json:"itemName"`
|
||||||
|
DriveName string `json:"driveName"`
|
||||||
ItemType ItemType `json:"itemType,omitempty"`
|
ItemType ItemType `json:"itemType,omitempty"`
|
||||||
Modified time.Time `json:"modified,omitempty"`
|
Modified time.Time `json:"modified,omitempty"`
|
||||||
Owner string `json:"owner,omitempty"`
|
Owner string `json:"owner,omitempty"`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user