Path: Category expanded to include SharePoint Lists (#1610)

## Description
Backup of SharePoint requires the extension of `path.CategoryType` to be able to support the creation of `data.Collections` for `SharePoint.Lists`. 
## Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature


## Test Plan

- [x]  Unit test
This commit is contained in:
Danny 2022-11-28 15:12:57 -05:00 committed by GitHub
parent f05d6dec43
commit 94145ecbf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -13,12 +13,13 @@ func _() {
_ = x[ContactsCategory-2] _ = x[ContactsCategory-2]
_ = x[EventsCategory-3] _ = x[EventsCategory-3]
_ = x[FilesCategory-4] _ = x[FilesCategory-4]
_ = x[LibrariesCategory-5] _ = x[ListsCategory-5]
_ = x[LibrariesCategory-6]
} }
const _CategoryType_name = "UnknownCategoryemailcontactseventsfileslibraries" const _CategoryType_name = "UnknownCategoryemailcontactseventsfileslistslibraries"
var _CategoryType_index = [...]uint8{0, 15, 20, 28, 34, 39, 48} var _CategoryType_index = [...]uint8{0, 15, 20, 28, 34, 39, 44, 53}
func (i CategoryType) String() string { func (i CategoryType) String() string {
if i < 0 || i >= CategoryType(len(_CategoryType_index)-1) { if i < 0 || i >= CategoryType(len(_CategoryType_index)-1) {

View File

@ -40,6 +40,7 @@ const (
ContactsCategory // contacts ContactsCategory // contacts
EventsCategory // events EventsCategory // events
FilesCategory // files FilesCategory // files
ListsCategory // lists
LibrariesCategory // libraries LibrariesCategory // libraries
) )
@ -55,6 +56,8 @@ func ToCategoryType(category string) CategoryType {
return FilesCategory return FilesCategory
case LibrariesCategory.String(): case LibrariesCategory.String():
return LibrariesCategory return LibrariesCategory
case ListsCategory.String():
return ListsCategory
default: default:
return UnknownCategory return UnknownCategory
} }
@ -72,7 +75,7 @@ var serviceCategories = map[ServiceType]map[CategoryType]struct{}{
}, },
SharePointService: { SharePointService: {
LibrariesCategory: {}, LibrariesCategory: {},
// TODO: Lists ListsCategory: {},
}, },
} }

View File

@ -109,6 +109,13 @@ var (
return pb.ToDataLayerSharePointPath(tenant, site, path.LibrariesCategory, isItem) return pb.ToDataLayerSharePointPath(tenant, site, path.LibrariesCategory, isItem)
}, },
}, },
{
service: path.SharePointService,
category: path.ListsCategory,
pathFunc: func(pb *path.Builder, tenant, site string, isItem bool) (path.Path, error) {
return pb.ToDataLayerSharePointPath(tenant, site, path.ListsCategory, isItem)
},
},
} }
) )