Path: Add category --> Pages. (#2109)

## Description
Adds path.Category `Pages` for SharePoint pages data type
<!-- Insert PR description-->

## 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 #2108 #<issue>

## Test Plan

- [z]  Unit test
This commit is contained in:
Danny 2023-01-11 13:38:22 -05:00 committed by GitHub
parent 7829c07079
commit 53c5828caa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 3 deletions

View File

@ -15,12 +15,13 @@ func _() {
_ = x[FilesCategory-4]
_ = x[ListsCategory-5]
_ = x[LibrariesCategory-6]
_ = x[DetailsCategory-7]
_ = x[PagesCategory-7]
_ = x[DetailsCategory-8]
}
const _CategoryType_name = "UnknownCategoryemailcontactseventsfileslistslibrariesdetails"
const _CategoryType_name = "UnknownCategoryemailcontactseventsfileslistslibrariespagesdetails"
var _CategoryType_index = [...]uint8{0, 15, 20, 28, 34, 39, 44, 53, 60}
var _CategoryType_index = [...]uint8{0, 15, 20, 28, 34, 39, 44, 53, 58, 65}
func (i CategoryType) String() string {
if i < 0 || i >= CategoryType(len(_CategoryType_index)-1) {

View File

@ -65,6 +65,7 @@ const (
FilesCategory // files
ListsCategory // lists
LibrariesCategory // libraries
PagesCategory // pages
DetailsCategory // details
)
@ -82,6 +83,8 @@ func ToCategoryType(category string) CategoryType {
return LibrariesCategory
case ListsCategory.String():
return ListsCategory
case PagesCategory.String():
return PagesCategory
case DetailsCategory.String():
return DetailsCategory
default:
@ -103,6 +106,7 @@ var serviceCategories = map[ServiceType]map[CategoryType]struct{}{
SharePointService: {
LibrariesCategory: {},
ListsCategory: {},
PagesCategory: {},
},
}

View File

@ -116,6 +116,13 @@ var (
return pb.ToDataLayerSharePointPath(tenant, site, path.ListsCategory, isItem)
},
},
{
service: path.SharePointService,
category: path.PagesCategory,
pathFunc: func(pb *path.Builder, tenant, site string, isItem bool) (path.Path, error) {
return pb.ToDataLayerSharePointPath(tenant, site, path.PagesCategory, isItem)
},
},
}
)
@ -300,6 +307,13 @@ func (suite *DataLayerResourcePath) TestToServiceCategoryMetadataPath() {
expectedService: path.SharePointMetadataService,
check: assert.NoError,
},
{
name: "Passes",
service: path.SharePointService,
category: path.PagesCategory,
expectedService: path.SharePointMetadataService,
check: assert.NoError,
},
}
for _, test := range table {