Merge branch 'main' into beta-page-connector
This commit is contained in:
commit
6b1e84732e
@ -24,6 +24,7 @@ const (
|
|||||||
OneDriveSource
|
OneDriveSource
|
||||||
SharePointSource
|
SharePointSource
|
||||||
)
|
)
|
||||||
|
const restrictedDirectory = "Site Pages"
|
||||||
|
|
||||||
func (ds driveSource) toPathServiceCat() (path.ServiceType, path.CategoryType) {
|
func (ds driveSource) toPathServiceCat() (path.ServiceType, path.CategoryType) {
|
||||||
switch ds {
|
switch ds {
|
||||||
@ -102,8 +103,9 @@ func (c *Collections) Get(ctx context.Context) ([]data.Collection, error) {
|
|||||||
// Update the collection map with items from each drive
|
// Update the collection map with items from each drive
|
||||||
for _, d := range drives {
|
for _, d := range drives {
|
||||||
driveID := *d.GetId()
|
driveID := *d.GetId()
|
||||||
|
driveName := *d.GetName()
|
||||||
|
|
||||||
delta, paths, err := collectItems(ctx, c.service, driveID, c.UpdateCollections)
|
delta, paths, err := collectItems(ctx, c.service, driveID, driveName, c.UpdateCollections)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -162,7 +164,7 @@ func (c *Collections) Get(ctx context.Context) ([]data.Collection, error) {
|
|||||||
// A new collection is created for every drive folder (or package)
|
// A new collection is created for every drive folder (or package)
|
||||||
func (c *Collections) UpdateCollections(
|
func (c *Collections) UpdateCollections(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
driveID string,
|
driveID, driveName string,
|
||||||
items []models.DriveItemable,
|
items []models.DriveItemable,
|
||||||
paths map[string]string,
|
paths map[string]string,
|
||||||
) error {
|
) error {
|
||||||
@ -188,7 +190,7 @@ func (c *Collections) UpdateCollections(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Skip items that don't match the folder selectors we were given.
|
// Skip items that don't match the folder selectors we were given.
|
||||||
if !includePath(ctx, c.matcher, collectionPath) {
|
if shouldSkipDrive(ctx, collectionPath, c.matcher, driveName) {
|
||||||
logger.Ctx(ctx).Infof("Skipping path %s", collectionPath.String())
|
logger.Ctx(ctx).Infof("Skipping path %s", collectionPath.String())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -239,6 +241,11 @@ func (c *Collections) UpdateCollections(
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func shouldSkipDrive(ctx context.Context, drivePath path.Path, m folderMatcher, driveName string) bool {
|
||||||
|
return !includePath(ctx, m, drivePath) ||
|
||||||
|
(drivePath.Category() == path.LibrariesCategory && restrictedDirectory == driveName)
|
||||||
|
}
|
||||||
|
|
||||||
// GetCanonicalPath constructs the standard path for the given source.
|
// GetCanonicalPath constructs the standard path for the given source.
|
||||||
func GetCanonicalPath(p, tenant, resourceOwner string, source driveSource) (path.Path, error) {
|
func GetCanonicalPath(p, tenant, resourceOwner string, source driveSource) (path.Path, error) {
|
||||||
var (
|
var (
|
||||||
|
|||||||
@ -326,7 +326,7 @@ func (suite *OneDriveCollectionsSuite) TestUpdateCollections() {
|
|||||||
nil,
|
nil,
|
||||||
control.Options{})
|
control.Options{})
|
||||||
|
|
||||||
err := c.UpdateCollections(ctx, "driveID", tt.items, paths)
|
err := c.UpdateCollections(ctx, "driveID", "General", tt.items, paths)
|
||||||
tt.expect(t, err)
|
tt.expect(t, err)
|
||||||
assert.Equal(t, len(tt.expectedCollectionPaths), len(c.CollectionMap), "collection paths")
|
assert.Equal(t, len(tt.expectedCollectionPaths), len(c.CollectionMap), "collection paths")
|
||||||
assert.Equal(t, tt.expectedItemCount, c.NumItems, "item count")
|
assert.Equal(t, tt.expectedItemCount, c.NumItems, "item count")
|
||||||
|
|||||||
@ -163,7 +163,7 @@ func userDrives(ctx context.Context, service graph.Servicer, user string) ([]mod
|
|||||||
// itemCollector functions collect the items found in a drive
|
// itemCollector functions collect the items found in a drive
|
||||||
type itemCollector func(
|
type itemCollector func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
driveID string,
|
driveID, driveName string,
|
||||||
driveItems []models.DriveItemable,
|
driveItems []models.DriveItemable,
|
||||||
paths map[string]string,
|
paths map[string]string,
|
||||||
) error
|
) error
|
||||||
@ -173,7 +173,7 @@ type itemCollector func(
|
|||||||
func collectItems(
|
func collectItems(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
service graph.Servicer,
|
service graph.Servicer,
|
||||||
driveID string,
|
driveID, driveName string,
|
||||||
collector itemCollector,
|
collector itemCollector,
|
||||||
) (string, map[string]string, error) {
|
) (string, map[string]string, error) {
|
||||||
var (
|
var (
|
||||||
@ -219,7 +219,7 @@ func collectItems(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = collector(ctx, driveID, r.GetValue(), paths)
|
err = collector(ctx, driveID, driveName, r.GetValue(), paths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", nil, err
|
return "", nil, err
|
||||||
}
|
}
|
||||||
@ -349,9 +349,10 @@ func GetAllFolders(
|
|||||||
ctx,
|
ctx,
|
||||||
gs,
|
gs,
|
||||||
*d.GetId(),
|
*d.GetId(),
|
||||||
|
*d.GetName(),
|
||||||
func(
|
func(
|
||||||
innerCtx context.Context,
|
innerCtx context.Context,
|
||||||
driveID string,
|
driveID, driveName string,
|
||||||
items []models.DriveItemable,
|
items []models.DriveItemable,
|
||||||
paths map[string]string,
|
paths map[string]string,
|
||||||
) error {
|
) error {
|
||||||
|
|||||||
@ -97,7 +97,7 @@ func (suite *ItemIntegrationSuite) TestItemReader_oneDrive() {
|
|||||||
// This item collector tries to find "a" drive item that is a file to test the reader function
|
// This item collector tries to find "a" drive item that is a file to test the reader function
|
||||||
itemCollector := func(
|
itemCollector := func(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
driveID string,
|
driveID, driveName string,
|
||||||
items []models.DriveItemable,
|
items []models.DriveItemable,
|
||||||
paths map[string]string,
|
paths map[string]string,
|
||||||
) error {
|
) error {
|
||||||
@ -110,7 +110,7 @@ func (suite *ItemIntegrationSuite) TestItemReader_oneDrive() {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
_, _, err := collectItems(ctx, suite, suite.userDriveID, itemCollector)
|
_, _, err := collectItems(ctx, suite, suite.userDriveID, "General", itemCollector)
|
||||||
require.NoError(suite.T(), err)
|
require.NoError(suite.T(), err)
|
||||||
|
|
||||||
// Test Requirement 2: Need a file
|
// Test Requirement 2: Need a file
|
||||||
|
|||||||
@ -96,7 +96,7 @@ func (suite *SharePointLibrariesSuite) TestUpdateCollections() {
|
|||||||
&MockGraphService{},
|
&MockGraphService{},
|
||||||
nil,
|
nil,
|
||||||
control.Options{})
|
control.Options{})
|
||||||
err := c.UpdateCollections(ctx, "driveID", test.items, paths)
|
err := c.UpdateCollections(ctx, "driveID", "General", test.items, paths)
|
||||||
test.expect(t, err)
|
test.expect(t, err)
|
||||||
assert.Equal(t, len(test.expectedCollectionPaths), len(c.CollectionMap), "collection paths")
|
assert.Equal(t, len(test.expectedCollectionPaths), len(c.CollectionMap), "collection paths")
|
||||||
assert.Equal(t, test.expectedItemCount, c.NumItems, "item count")
|
assert.Equal(t, test.expectedItemCount, c.NumItems, "item count")
|
||||||
|
|||||||
@ -20,33 +20,33 @@ func TestSharePointInfoSuite(t *testing.T) {
|
|||||||
|
|
||||||
func (suite *SharePointInfoSuite) TestSharePointInfo() {
|
func (suite *SharePointInfoSuite) TestSharePointInfo() {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
listAndRP func() (models.Listable, *details.SharePointInfo)
|
listAndDeets func() (models.Listable, *details.SharePointInfo)
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "Empty List",
|
name: "Empty List",
|
||||||
listAndRP: func() (models.Listable, *details.SharePointInfo) {
|
listAndDeets: func() (models.Listable, *details.SharePointInfo) {
|
||||||
i := &details.SharePointInfo{ItemType: details.SharePointItem}
|
i := &details.SharePointInfo{ItemType: details.SharePointItem}
|
||||||
return models.NewList(), i
|
return models.NewList(), i
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
name: "Only Name",
|
name: "Only Name",
|
||||||
listAndRP: func() (models.Listable, *details.SharePointInfo) {
|
listAndDeets: func() (models.Listable, *details.SharePointInfo) {
|
||||||
aTitle := "Whole List"
|
aTitle := "Whole List"
|
||||||
listing := models.NewList()
|
listing := models.NewList()
|
||||||
listing.SetDisplayName(&aTitle)
|
listing.SetDisplayName(&aTitle)
|
||||||
i := &details.SharePointInfo{
|
i := &details.SharePointInfo{
|
||||||
ItemType: details.SharePointItem,
|
ItemType: details.SharePointItem,
|
||||||
ItemName: aTitle,
|
ItemName: aTitle,
|
||||||
Size: 10,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return listing, i
|
return listing, i
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
suite.T().Run(test.name, func(t *testing.T) {
|
suite.T().Run(test.name, func(t *testing.T) {
|
||||||
list, expected := test.listAndRP()
|
list, expected := test.listAndDeets()
|
||||||
info := sharePointListInfo(list, 10)
|
info := sharePointListInfo(list, 10)
|
||||||
assert.Equal(t, expected.ItemType, info.ItemType)
|
assert.Equal(t, expected.ItemType, info.ItemType)
|
||||||
assert.Equal(t, expected.ItemName, info.ItemName)
|
assert.Equal(t, expected.ItemName, info.ItemName)
|
||||||
|
|||||||
42
src/internal/connector/sharepoint/pageInfo.go
Normal file
42
src/internal/connector/sharepoint/pageInfo.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package sharepoint
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||||
|
)
|
||||||
|
|
||||||
|
// sharePointPageInfo propagates metadata from the SharePoint Page data type
|
||||||
|
// into searchable content.
|
||||||
|
// Page Details: https://learn.microsoft.com/en-us/graph/api/resources/sitepage?view=graph-rest-beta
|
||||||
|
func sharePointPageInfo(page SitePageable, size int64) *details.SharePointInfo {
|
||||||
|
var (
|
||||||
|
name, webURL string
|
||||||
|
created, modified time.Time
|
||||||
|
)
|
||||||
|
|
||||||
|
if page.GetTitle() != nil {
|
||||||
|
name = *page.GetTitle()
|
||||||
|
}
|
||||||
|
|
||||||
|
if page.GetWebUrl() != nil {
|
||||||
|
webURL = *page.GetWebUrl()
|
||||||
|
}
|
||||||
|
|
||||||
|
if page.GetCreatedDateTime() != nil {
|
||||||
|
created = *page.GetCreatedDateTime()
|
||||||
|
}
|
||||||
|
|
||||||
|
if page.GetLastModifiedDateTime() != nil {
|
||||||
|
modified = *page.GetLastModifiedDateTime()
|
||||||
|
}
|
||||||
|
|
||||||
|
return &details.SharePointInfo{
|
||||||
|
ItemType: details.SharePointItem,
|
||||||
|
ItemName: name,
|
||||||
|
Created: created,
|
||||||
|
Modified: modified,
|
||||||
|
WebURL: webURL,
|
||||||
|
Size: size,
|
||||||
|
}
|
||||||
|
}
|
||||||
47
src/internal/connector/sharepoint/pageInfo_test.go
Normal file
47
src/internal/connector/sharepoint/pageInfo_test.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package sharepoint
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (suite *SharePointInfoSuite) TestSharePointInfo_Pages() {
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
pageAndDeets func() (SitePageable, *details.SharePointInfo)
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "Empty Page",
|
||||||
|
pageAndDeets: func() (SitePageable, *details.SharePointInfo) {
|
||||||
|
deets := &details.SharePointInfo{ItemType: details.SharePointItem}
|
||||||
|
return NewSitePage(), deets
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Only Name",
|
||||||
|
pageAndDeets: func() (SitePageable, *details.SharePointInfo) {
|
||||||
|
title := "Blank Page"
|
||||||
|
sPage := NewSitePage()
|
||||||
|
sPage.SetTitle(&title)
|
||||||
|
deets := &details.SharePointInfo{
|
||||||
|
ItemType: details.SharePointItem,
|
||||||
|
ItemName: title,
|
||||||
|
}
|
||||||
|
|
||||||
|
return sPage, deets
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for _, test := range tests {
|
||||||
|
suite.T().Run(test.name, func(t *testing.T) {
|
||||||
|
paged, expected := test.pageAndDeets()
|
||||||
|
info := sharePointPageInfo(paged, 0)
|
||||||
|
assert.Equal(t, expected.ItemType, info.ItemType)
|
||||||
|
assert.Equal(t, expected.ItemName, info.ItemName)
|
||||||
|
assert.Equal(t, expected.WebURL, info.WebURL)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -76,6 +76,12 @@ func RestoreCollections(
|
|||||||
deets,
|
deets,
|
||||||
errUpdater,
|
errUpdater,
|
||||||
)
|
)
|
||||||
|
case path.PagesCategory:
|
||||||
|
errorMessage := fmt.Sprintf("restore of %s not supported", dc.FullPath().Category())
|
||||||
|
logger.Ctx(ctx).Error(errorMessage)
|
||||||
|
|
||||||
|
return nil, errors.New(errorMessage)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil, errors.Errorf("category %s not supported", dc.FullPath().Category())
|
return nil, errors.Errorf("category %s not supported", dc.FullPath().Category())
|
||||||
}
|
}
|
||||||
|
|||||||
187
src/internal/connector/sharepoint/site_page.go
Normal file
187
src/internal/connector/sharepoint/site_page.go
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
package sharepoint
|
||||||
|
|
||||||
|
import (
|
||||||
|
kioser "github.com/microsoft/kiota-abstractions-go/serialization"
|
||||||
|
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SitePage provides operations to manage the minimal creation of a Site Page.
|
||||||
|
// Altered from original: github.com/microsoftgraph/msgraph-beta-sdk-go/models
|
||||||
|
// TODO: remove when Issue #2086 resolved
|
||||||
|
type SitePage struct {
|
||||||
|
models.BaseItem
|
||||||
|
// Indicates the layout of the content in a given SharePoint page, including horizontal sections and vertical section
|
||||||
|
// canvasLayout models.CanvasLayoutable
|
||||||
|
// Inherited from baseItem.
|
||||||
|
contentType models.ContentTypeInfoable
|
||||||
|
// The name of the page layout of the page.
|
||||||
|
// The possible values are: microsoftReserved, article, home, unknownFutureValue.
|
||||||
|
// pageLayout *models.PageLayoutType
|
||||||
|
// Indicates the promotion kind of the sitePage. The possible values are:
|
||||||
|
// microsoftReserved, page, newsPost, unknownFutureValue.
|
||||||
|
// promotionKind *models.PagePromotionType
|
||||||
|
// The publishing status and the MM.mm version of the page.
|
||||||
|
publishingState models.PublicationFacetable
|
||||||
|
// Reactions information for the page.
|
||||||
|
// reactions models.ReactionsFacetable
|
||||||
|
// Determines whether or not to show comments at the bottom of the page.
|
||||||
|
showComments *bool
|
||||||
|
// Determines whether or not to show recommended pages at the bottom of the page.
|
||||||
|
showRecommendedPages *bool
|
||||||
|
// Url of the sitePage's thumbnail image
|
||||||
|
//revive:disable:var-naming
|
||||||
|
thumbnailWebUrl *string
|
||||||
|
//revive:enable:var-naming
|
||||||
|
// Title of the sitePage.
|
||||||
|
title *string
|
||||||
|
}
|
||||||
|
|
||||||
|
// Title area on the SharePoint page.
|
||||||
|
// titleArea models.TitleAreaable
|
||||||
|
// Collection of webparts on the SharePoint page
|
||||||
|
// webParts []models.WebPartable
|
||||||
|
|
||||||
|
var _ SitePageable = &SitePage{}
|
||||||
|
|
||||||
|
// NewSitePage instantiates a new sitePage and sets the default values.
|
||||||
|
func NewSitePage() *SitePage {
|
||||||
|
m := &SitePage{
|
||||||
|
BaseItem: *models.NewBaseItem(),
|
||||||
|
}
|
||||||
|
odataTypeValue := "#microsoft.graph.sitePage"
|
||||||
|
m.SetOdataType(&odataTypeValue)
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateSitePageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
|
||||||
|
func CreateSitePageFromDiscriminatorValue(parseNode kioser.ParseNode) (kioser.Parsable, error) {
|
||||||
|
return NewSitePage(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetContentType gets the contentType property value. Inherited from baseItem.
|
||||||
|
func (m *SitePage) GetContentType() models.ContentTypeInfoable {
|
||||||
|
return m.contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFieldDeserializers the deserialization information for the current model
|
||||||
|
// Altered from original.
|
||||||
|
func (m *SitePage) GetFieldDeserializers() map[string]func(kioser.ParseNode) error {
|
||||||
|
res := m.BaseItem.GetFieldDeserializers()
|
||||||
|
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPublishingState gets the publishingState property value. The publishing status and the MM.mm version of the page.
|
||||||
|
func (m *SitePage) GetPublishingState() models.PublicationFacetable {
|
||||||
|
return m.publishingState
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetShowComments gets the showComments property value.
|
||||||
|
// Determines whether or not to show comments at the bottom of the page.
|
||||||
|
func (m *SitePage) GetShowComments() *bool {
|
||||||
|
return m.showComments
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetShowRecommendedPages gets the showRecommendedPages property value.
|
||||||
|
// Determines whether or not to show recommended pages at the bottom of the page.
|
||||||
|
func (m *SitePage) GetShowRecommendedPages() *bool {
|
||||||
|
return m.showRecommendedPages
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetThumbnailWebUrl gets the thumbnailWebUrl property value. Url of the sitePage's thumbnail image
|
||||||
|
//
|
||||||
|
//revive:disable:var-naming
|
||||||
|
func (m *SitePage) GetThumbnailWebUrl() *string {
|
||||||
|
return m.thumbnailWebUrl
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTitle gets the title property value. Title of the sitePage.
|
||||||
|
func (m *SitePage) GetTitle() *string {
|
||||||
|
return m.title
|
||||||
|
}
|
||||||
|
|
||||||
|
// Serialize serializes information the current object
|
||||||
|
func (m *SitePage) Serialize(writer kioser.SerializationWriter) error {
|
||||||
|
err := m.BaseItem.Serialize(writer)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.GetContentType() != nil {
|
||||||
|
err = writer.WriteObjectValue("contentType", m.GetContentType())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.GetPublishingState() != nil {
|
||||||
|
err = writer.WriteObjectValue("publishingState", m.GetPublishingState())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
err = writer.WriteBoolValue("showComments", m.GetShowComments())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
err = writer.WriteBoolValue("showRecommendedPages", m.GetShowRecommendedPages())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
err = writer.WriteStringValue("thumbnailWebUrl", m.GetThumbnailWebUrl())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
err = writer.WriteStringValue("title", m.GetTitle())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContentType sets the contentType property value. Inherited from baseItem.
|
||||||
|
func (m *SitePage) SetContentType(value models.ContentTypeInfoable) {
|
||||||
|
m.contentType = value
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPublishingState sets the publishingState property value. The publishing status and the MM.mm version of the page.
|
||||||
|
func (m *SitePage) SetPublishingState(value models.PublicationFacetable) {
|
||||||
|
m.publishingState = value
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetShowComments sets the showComments property value.
|
||||||
|
// Determines whether or not to show comments at the bottom of the page.
|
||||||
|
func (m *SitePage) SetShowComments(value *bool) {
|
||||||
|
m.showComments = value
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetShowRecommendedPages sets the showRecommendedPages property value.
|
||||||
|
// Determines whether or not to show recommended pages at the bottom of the page.
|
||||||
|
func (m *SitePage) SetShowRecommendedPages(value *bool) {
|
||||||
|
m.showRecommendedPages = value
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetThumbnailWebUrl sets the thumbnailWebUrl property value.
|
||||||
|
// Url of the sitePage's thumbnail image
|
||||||
|
//
|
||||||
|
//revive:disable:var-naming
|
||||||
|
func (m *SitePage) SetThumbnailWebUrl(value *string) {
|
||||||
|
m.thumbnailWebUrl = value
|
||||||
|
}
|
||||||
|
|
||||||
|
//revive:enable:var-naming
|
||||||
|
|
||||||
|
// SetTitle sets the title property value. Title of the sitePage.
|
||||||
|
func (m *SitePage) SetTitle(value *string) {
|
||||||
|
m.title = value
|
||||||
|
}
|
||||||
24
src/internal/connector/sharepoint/site_pageable.go
Normal file
24
src/internal/connector/sharepoint/site_pageable.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package sharepoint
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/microsoft/kiota-abstractions-go/serialization"
|
||||||
|
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SitePageable adjusted from msgraph-beta-sdk-go for temporary testing
|
||||||
|
type SitePageable interface {
|
||||||
|
models.BaseItemable
|
||||||
|
serialization.Parsable
|
||||||
|
GetContentType() models.ContentTypeInfoable
|
||||||
|
GetPublishingState() models.PublicationFacetable
|
||||||
|
GetShowComments() *bool
|
||||||
|
GetShowRecommendedPages() *bool
|
||||||
|
GetThumbnailWebUrl() *string
|
||||||
|
GetTitle() *string
|
||||||
|
SetContentType(value models.ContentTypeInfoable)
|
||||||
|
SetPublishingState(value models.PublicationFacetable)
|
||||||
|
SetShowComments(value *bool)
|
||||||
|
SetShowRecommendedPages(value *bool)
|
||||||
|
SetThumbnailWebUrl(value *string)
|
||||||
|
SetTitle(value *string)
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user