From 34f56dbacfc7d20a6166a48fdd9ce03931200bdb Mon Sep 17 00:00:00 2001 From: Keepers Date: Thu, 26 Jan 2023 17:03:26 -0700 Subject: [PATCH 01/36] wrap item get in lazy reader (#2268) ## Description Wraps the onedrive item download control into the lazy reader creation, so that items are not fetched from graph until kopia decides it wants the bytes. This should only occurr after other checks, like mod-time comparison, have passed, thus giving us kopia-assists for bakup. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :bug: Bugfix ## Issue(s) * closes #2262 ## Test Plan - [x] :zap: Unit test - [x] :green_heart: E2E --- src/internal/connector/onedrive/collection.go | 71 +++++++++++-------- .../connector/onedrive/collection_test.go | 55 ++++++++++---- 2 files changed, 84 insertions(+), 42 deletions(-) diff --git a/src/internal/connector/onedrive/collection.go b/src/internal/connector/onedrive/collection.go index ac0aa9fb3..c23d60422 100644 --- a/src/internal/connector/onedrive/collection.go +++ b/src/internal/connector/onedrive/collection.go @@ -223,52 +223,65 @@ func (oc *Collection) populateItems(ctx context.Context) { defer wg.Done() defer func() { <-semaphoreCh }() - // Read the item var ( + itemName = *item.GetName() + itemSize = *item.GetSize() itemInfo details.ItemInfo - itemData io.ReadCloser - err error - ) - - for i := 1; i <= maxRetries; i++ { - itemInfo, itemData, err = oc.itemReader(oc.itemClient, item) - if err == nil || graph.IsErrTimeout(err) == nil { - // retry on Timeout type errors, break otherwise. - break - } - - if i < maxRetries { - time.Sleep(1 * time.Second) - } - } - - if err != nil { - errUpdater(*item.GetId(), err) - return - } - - var ( - itemName string - itemSize int64 ) switch oc.source { case SharePointSource: + itemInfo.SharePoint = sharePointItemInfo(item, itemSize) itemInfo.SharePoint.ParentPath = parentPathString - itemName = itemInfo.SharePoint.ItemName - itemSize = itemInfo.SharePoint.Size default: + itemInfo.OneDrive = oneDriveItemInfo(item, itemSize) itemInfo.OneDrive.ParentPath = parentPathString - itemName = itemInfo.OneDrive.ItemName - itemSize = itemInfo.OneDrive.Size } + // Construct a new lazy readCloser to feed to the collection consumer. + // This ensures that downloads won't be attempted unless that consumer + // attempts to read bytes. Assumption is that kopia will check things + // like file modtimes before attempting to read. itemReader := lazy.NewLazyReadCloser(func() (io.ReadCloser, error) { + // Read the item + var ( + itemData io.ReadCloser + err error + ) + + for i := 1; i <= maxRetries; i++ { + _, itemData, err = oc.itemReader(oc.itemClient, item) + if err == nil || graph.IsErrTimeout(err) == nil { + break + } + + if i < maxRetries { + time.Sleep(1 * time.Second) + } + } + + // check for errors following retries + if err != nil { + errUpdater(*item.GetId(), err) + return nil, err + } + + // display/log the item download progReader, closer := observe.ItemProgress(ctx, itemData, observe.ItemBackupMsg, itemName, itemSize) go closer() + return progReader, nil }) + // This can cause inaccurate counts. Right now it counts all the items + // we intend to read. Errors within the lazy readCloser will create a + // conflict: an item is both successful and erroneous. But the async + // control to fix that is more error-prone than helpful. + // + // TODO: transform this into a stats bus so that async control of stats + // aggregation is handled at the backup level, not at the item iteration + // level. + // // Item read successfully, add to collection atomic.AddInt64(&itemsRead, 1) // byteCount iteration diff --git a/src/internal/connector/onedrive/collection_test.go b/src/internal/connector/onedrive/collection_test.go index a36db58c9..6267ff017 100644 --- a/src/internal/connector/onedrive/collection_test.go +++ b/src/internal/connector/onedrive/collection_test.go @@ -62,17 +62,25 @@ func (suite *CollectionUnitTestSuite) TestCollection() { now = time.Now() ) + type nst struct { + name string + size int64 + time time.Time + } + table := []struct { name string numInstances int source driveSource itemReader itemReaderFunc + itemDeets nst infoFrom func(*testing.T, details.ItemInfo) (string, string) }{ { name: "oneDrive, no duplicates", numInstances: 1, source: OneDriveSource, + itemDeets: nst{testItemName, 42, now}, itemReader: func(*http.Client, models.DriveItemable) (details.ItemInfo, io.ReadCloser, error) { return details.ItemInfo{OneDrive: &details.OneDriveInfo{ItemName: testItemName, Modified: now}}, io.NopCloser(bytes.NewReader(testItemData)), @@ -87,6 +95,7 @@ func (suite *CollectionUnitTestSuite) TestCollection() { name: "oneDrive, duplicates", numInstances: 3, source: OneDriveSource, + itemDeets: nst{testItemName, 42, now}, itemReader: func(*http.Client, models.DriveItemable) (details.ItemInfo, io.ReadCloser, error) { return details.ItemInfo{OneDrive: &details.OneDriveInfo{ItemName: testItemName, Modified: now}}, io.NopCloser(bytes.NewReader(testItemData)), @@ -101,6 +110,7 @@ func (suite *CollectionUnitTestSuite) TestCollection() { name: "sharePoint, no duplicates", numInstances: 1, source: SharePointSource, + itemDeets: nst{testItemName, 42, now}, itemReader: func(*http.Client, models.DriveItemable) (details.ItemInfo, io.ReadCloser, error) { return details.ItemInfo{SharePoint: &details.SharePointInfo{ItemName: testItemName, Modified: now}}, io.NopCloser(bytes.NewReader(testItemData)), @@ -115,6 +125,7 @@ func (suite *CollectionUnitTestSuite) TestCollection() { name: "sharePoint, duplicates", numInstances: 3, source: SharePointSource, + itemDeets: nst{testItemName, 42, now}, itemReader: func(*http.Client, models.DriveItemable) (details.ItemInfo, io.ReadCloser, error) { return details.ItemInfo{SharePoint: &details.SharePointInfo{ItemName: testItemName, Modified: now}}, io.NopCloser(bytes.NewReader(testItemData)), @@ -153,6 +164,10 @@ func (suite *CollectionUnitTestSuite) TestCollection() { // Set a item reader, add an item and validate we get the item back mockItem := models.NewDriveItem() mockItem.SetId(&testItemID) + mockItem.SetName(&test.itemDeets.name) + mockItem.SetSize(&test.itemDeets.size) + mockItem.SetCreatedDateTime(&test.itemDeets.time) + mockItem.SetLastModifiedDateTime(&test.itemDeets.time) for i := 0; i < test.numInstances; i++ { coll.Add(mockItem) @@ -169,27 +184,26 @@ func (suite *CollectionUnitTestSuite) TestCollection() { wg.Wait() - // Expect only 1 item - require.Len(t, readItems, 1) - require.Equal(t, 1, collStatus.ObjectCount) - require.Equal(t, 1, collStatus.Successful) - // Validate item info and data readItem := readItems[0] readItemInfo := readItem.(data.StreamInfo) + readData, err := io.ReadAll(readItem.ToReader()) + require.NoError(t, err) + assert.Equal(t, testItemData, readData) + + // Expect only 1 item + require.Len(t, readItems, 1) + require.Equal(t, 1, collStatus.ObjectCount, "items iterated") + require.Equal(t, 1, collStatus.Successful, "items successful") + assert.Equal(t, testItemName, readItem.UUID()) require.Implements(t, (*data.StreamModTime)(nil), readItem) mt := readItem.(data.StreamModTime) assert.Equal(t, now, mt.ModTime()) - readData, err := io.ReadAll(readItem.ToReader()) - require.NoError(t, err) - name, parentPath := test.infoFrom(t, readItemInfo.Info()) - - assert.Equal(t, testItemData, readData) assert.Equal(t, testItemName, name) assert.Equal(t, driveFolderPath, parentPath) }) @@ -197,6 +211,12 @@ func (suite *CollectionUnitTestSuite) TestCollection() { } func (suite *CollectionUnitTestSuite) TestCollectionReadError() { + var ( + name = "name" + size int64 = 42 + now = time.Now() + ) + table := []struct { name string source driveSource @@ -235,18 +255,27 @@ func (suite *CollectionUnitTestSuite) TestCollectionReadError() { mockItem := models.NewDriveItem() mockItem.SetId(&testItemID) + mockItem.SetName(&name) + mockItem.SetSize(&size) + mockItem.SetCreatedDateTime(&now) + mockItem.SetLastModifiedDateTime(&now) coll.Add(mockItem) coll.itemReader = func(*http.Client, models.DriveItemable) (details.ItemInfo, io.ReadCloser, error) { return details.ItemInfo{}, nil, assert.AnError } - coll.Items() + collItem, ok := <-coll.Items() + assert.True(t, ok) + + _, err = io.ReadAll(collItem.ToReader()) + assert.Error(t, err) + wg.Wait() // Expect no items - require.Equal(t, 1, collStatus.ObjectCount) - require.Equal(t, 0, collStatus.Successful) + require.Equal(t, 1, collStatus.ObjectCount, "only one object should be counted") + require.Equal(t, 1, collStatus.Successful, "TODO: should be 0, but allowing 1 to reduce async management") }) } } From d529d145cbc1f480c73edb2b3bc2292a774ae1f5 Mon Sep 17 00:00:00 2001 From: Keepers Date: Thu, 26 Jan 2023 17:31:57 -0700 Subject: [PATCH 02/36] scrub pii from observe logs (#2285) ## Description This is a quick hack to satisfy a primary case of PII scrubbing. We expect to revisit it in the future. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :sunflower: Feature ## Issue(s) * #2284 ## Test Plan - [x] :muscle: Manual - [x] :zap: Unit test --- .../connector/exchange/data_collections.go | 5 +- .../exchange/exchange_data_collection.go | 4 +- .../connector/exchange/service_restore.go | 6 +- src/internal/connector/onedrive/collection.go | 4 +- .../connector/onedrive/collections.go | 2 +- src/internal/connector/onedrive/restore.go | 2 +- .../connector/sharepoint/collection.go | 4 +- .../connector/sharepoint/data_collections.go | 3 +- src/internal/observe/observe.go | 114 +++++++++++++++--- src/internal/observe/observe_test.go | 24 ++-- src/internal/operations/backup.go | 4 +- src/internal/operations/operation.go | 2 +- src/internal/operations/restore.go | 6 +- src/pkg/repository/repository.go | 2 +- 14 files changed, 135 insertions(+), 47 deletions(-) diff --git a/src/internal/connector/exchange/data_collections.go b/src/internal/connector/exchange/data_collections.go index 719764d35..619d75cee 100644 --- a/src/internal/connector/exchange/data_collections.go +++ b/src/internal/connector/exchange/data_collections.go @@ -251,7 +251,10 @@ func createCollections( Credentials: creds, } - foldersComplete, closer := observe.MessageWithCompletion(ctx, observe.Bulletf("%s - %s", qp.Category, user)) + foldersComplete, closer := observe.MessageWithCompletion(ctx, observe.Bulletf( + "%s - %s", + observe.Safe(qp.Category.String()), + observe.PII(user))) defer closer() defer close(foldersComplete) diff --git a/src/internal/connector/exchange/exchange_data_collection.go b/src/internal/connector/exchange/exchange_data_collection.go index ce37beab6..1a628a28d 100644 --- a/src/internal/connector/exchange/exchange_data_collection.go +++ b/src/internal/connector/exchange/exchange_data_collection.go @@ -183,9 +183,9 @@ func (col *Collection) streamItems(ctx context.Context) { var closer func() colProgress, closer = observe.CollectionProgress( ctx, - user, col.fullPath.Category().String(), - col.fullPath.Folder()) + observe.PII(user), + observe.PII(col.fullPath.Folder())) go closer() diff --git a/src/internal/connector/exchange/service_restore.go b/src/internal/connector/exchange/service_restore.go index d385dab81..e1144249a 100644 --- a/src/internal/connector/exchange/service_restore.go +++ b/src/internal/connector/exchange/service_restore.go @@ -374,7 +374,11 @@ func restoreCollection( user = directory.ResourceOwner() ) - colProgress, closer := observe.CollectionProgress(ctx, user, category.String(), directory.Folder()) + colProgress, closer := observe.CollectionProgress( + ctx, + category.String(), + observe.PII(user), + observe.PII(directory.Folder())) defer closer() defer close(colProgress) diff --git a/src/internal/connector/onedrive/collection.go b/src/internal/connector/onedrive/collection.go index c23d60422..68ad71a89 100644 --- a/src/internal/connector/onedrive/collection.go +++ b/src/internal/connector/onedrive/collection.go @@ -191,7 +191,7 @@ func (oc *Collection) populateItems(ctx context.Context) { folderProgress, colCloser := observe.ProgressWithCount( ctx, observe.ItemQueueMsg, - "/"+parentPathString, + observe.PII("/"+parentPathString), int64(len(oc.driveItems))) defer colCloser() defer close(folderProgress) @@ -267,7 +267,7 @@ func (oc *Collection) populateItems(ctx context.Context) { } // display/log the item download - progReader, closer := observe.ItemProgress(ctx, itemData, observe.ItemBackupMsg, itemName, itemSize) + progReader, closer := observe.ItemProgress(ctx, itemData, observe.ItemBackupMsg, observe.PII(itemName), itemSize) go closer() return progReader, nil diff --git a/src/internal/connector/onedrive/collections.go b/src/internal/connector/onedrive/collections.go index f446aa246..8761a37ca 100644 --- a/src/internal/connector/onedrive/collections.go +++ b/src/internal/connector/onedrive/collections.go @@ -144,7 +144,7 @@ func (c *Collections) Get(ctx context.Context) ([]data.Collection, error) { maps.Copy(excludedItems, excluded) } - observe.Message(ctx, fmt.Sprintf("Discovered %d items to backup", c.NumItems)) + observe.Message(ctx, observe.Safe(fmt.Sprintf("Discovered %d items to backup", c.NumItems))) // Add an extra for the metadata collection. collections := make([]data.Collection, 0, len(c.CollectionMap)+1) diff --git a/src/internal/connector/onedrive/restore.go b/src/internal/connector/onedrive/restore.go index 31149c7aa..00ed855b7 100644 --- a/src/internal/connector/onedrive/restore.go +++ b/src/internal/connector/onedrive/restore.go @@ -243,7 +243,7 @@ func restoreItem( } iReader := itemData.ToReader() - progReader, closer := observe.ItemProgress(ctx, iReader, observe.ItemRestoreMsg, itemName, ss.Size()) + progReader, closer := observe.ItemProgress(ctx, iReader, observe.ItemRestoreMsg, observe.PII(itemName), ss.Size()) go closer() diff --git a/src/internal/connector/sharepoint/collection.go b/src/internal/connector/sharepoint/collection.go index ff6af4132..c34d2a2d1 100644 --- a/src/internal/connector/sharepoint/collection.go +++ b/src/internal/connector/sharepoint/collection.go @@ -158,9 +158,9 @@ func (sc *Collection) populate(ctx context.Context) { // TODO: Insert correct ID for CollectionProgress colProgress, closer := observe.CollectionProgress( ctx, - "name", sc.fullPath.Category().String(), - sc.fullPath.Folder()) + observe.Safe("name"), + observe.PII(sc.fullPath.Folder())) go closer() defer func() { diff --git a/src/internal/connector/sharepoint/data_collections.go b/src/internal/connector/sharepoint/data_collections.go index 5950daede..d64542271 100644 --- a/src/internal/connector/sharepoint/data_collections.go +++ b/src/internal/connector/sharepoint/data_collections.go @@ -46,7 +46,8 @@ func DataCollections( for _, scope := range b.Scopes() { foldersComplete, closer := observe.MessageWithCompletion(ctx, observe.Bulletf( "%s - %s", - scope.Category().PathType(), site)) + observe.Safe(scope.Category().PathType().String()), + observe.PII(site))) defer closer() defer close(foldersComplete) diff --git a/src/internal/observe/observe.go b/src/internal/observe/observe.go index 6d648be5f..d8492109d 100644 --- a/src/internal/observe/observe.go +++ b/src/internal/observe/observe.go @@ -138,8 +138,9 @@ const ( // Progress Updates // Message is used to display a progress message -func Message(ctx context.Context, message string) { - logger.Ctx(ctx).Info(message) +func Message(ctx context.Context, msg cleanable) { + logger.Ctx(ctx).Info(msg.clean()) + message := msg.String() if cfg.hidden() { return @@ -163,9 +164,15 @@ func Message(ctx context.Context, message string) { // MessageWithCompletion is used to display progress with a spinner // that switches to "done" when the completion channel is signalled -func MessageWithCompletion(ctx context.Context, message string) (chan<- struct{}, func()) { +func MessageWithCompletion( + ctx context.Context, + msg cleanable, +) (chan<- struct{}, func()) { + clean := msg.clean() + message := msg.String() + log := logger.Ctx(ctx) - log.Info(message) + log.Info(clean) completionCh := make(chan struct{}, 1) @@ -201,7 +208,7 @@ func MessageWithCompletion(ctx context.Context, message string) (chan<- struct{} }(completionCh) wacb := waitAndCloseBar(bar, func() { - log.Info("done - " + message) + log.Info("done - " + clean) }) return completionCh, wacb @@ -217,10 +224,11 @@ func MessageWithCompletion(ctx context.Context, message string) (chan<- struct{} func ItemProgress( ctx context.Context, rc io.ReadCloser, - header, iname string, + header string, + iname cleanable, totalBytes int64, ) (io.ReadCloser, func()) { - log := logger.Ctx(ctx).With("item", iname, "size", humanize.Bytes(uint64(totalBytes))) + log := logger.Ctx(ctx).With("item", iname.clean(), "size", humanize.Bytes(uint64(totalBytes))) log.Debug(header) if cfg.hidden() || rc == nil || totalBytes == 0 { @@ -232,7 +240,7 @@ func ItemProgress( barOpts := []mpb.BarOption{ mpb.PrependDecorators( decor.Name(header, decor.WCSyncSpaceR), - decor.Name(iname, decor.WCSyncSpaceR), + decor.Name(iname.String(), decor.WCSyncSpaceR), decor.CountersKibiByte(" %.1f/%.1f ", decor.WC{W: 8}), decor.NewPercentage("%d ", decor.WC{W: 4}), ), @@ -256,9 +264,14 @@ func ItemProgress( // of the specified count. // Each write to the provided channel counts as a single increment. // The caller is expected to close the channel. -func ProgressWithCount(ctx context.Context, header, message string, count int64) (chan<- struct{}, func()) { +func ProgressWithCount( + ctx context.Context, + header string, + message cleanable, + count int64, +) (chan<- struct{}, func()) { log := logger.Ctx(ctx) - lmsg := fmt.Sprintf("%s %s - %d", header, message, count) + lmsg := fmt.Sprintf("%s %s - %d", header, message.clean(), count) log.Info(lmsg) progressCh := make(chan struct{}) @@ -281,7 +294,7 @@ func ProgressWithCount(ctx context.Context, header, message string, count int64) barOpts := []mpb.BarOption{ mpb.PrependDecorators( decor.Name(header, decor.WCSyncSpaceR), - decor.Name(message), + decor.Name(message.String()), decor.Counters(0, " %d/%d "), ), } @@ -355,13 +368,17 @@ func makeSpinFrames(barWidth int) { // counts as a single increment. The caller is expected to close the channel. func CollectionProgress( ctx context.Context, - user, category, dirName string, + category string, + user, dirName cleanable, ) (chan<- struct{}, func()) { - log := logger.Ctx(ctx).With("user", user, "category", category, "dir", dirName) - message := "Collecting " + dirName + log := logger.Ctx(ctx).With( + "user", user.clean(), + "category", category, + "dir", dirName.clean()) + message := "Collecting Directory" log.Info(message) - if cfg.hidden() || len(user) == 0 || len(dirName) == 0 { + if cfg.hidden() || len(user.String()) == 0 || len(dirName.String()) == 0 { ch := make(chan struct{}) go func(ci <-chan struct{}) { @@ -379,7 +396,7 @@ func CollectionProgress( wg.Add(1) barOpts := []mpb.BarOption{ - mpb.PrependDecorators(decor.Name(category)), + mpb.PrependDecorators(decor.Name(string(category))), mpb.AppendDecorators( decor.CurrentNoUnit("%d - ", decor.WCSyncSpace), decor.Name(fmt.Sprintf("%s - %s", user, dirName)), @@ -439,8 +456,65 @@ func waitAndCloseBar(bar *mpb.Bar, log func()) func() { // other funcs // --------------------------------------------------------------------------- -// Bulletf prepends the message with "∙ ", and formats it. -// Ex: Bulletf("%s", "foo") => "∙ foo" -func Bulletf(template string, vs ...any) string { - return fmt.Sprintf("∙ "+template, vs...) +const Bullet = "∙" + +// --------------------------------------------------------------------------- +// PII redaction +// --------------------------------------------------------------------------- + +type cleanable interface { + clean() string + String() string +} + +type PII string + +func (p PII) clean() string { + return "***" +} + +func (p PII) String() string { + return string(p) +} + +type Safe string + +func (s Safe) clean() string { + return string(s) +} + +func (s Safe) String() string { + return string(s) +} + +type bulletPII struct { + tmpl string + vars []cleanable +} + +func Bulletf(template string, vs ...cleanable) bulletPII { + return bulletPII{ + tmpl: "∙ " + template, + vars: vs, + } +} + +func (b bulletPII) clean() string { + vs := make([]any, 0, len(b.vars)) + + for _, v := range b.vars { + vs = append(vs, v.clean()) + } + + return fmt.Sprintf(b.tmpl, vs...) +} + +func (b bulletPII) String() string { + vs := make([]any, 0, len(b.vars)) + + for _, v := range b.vars { + vs = append(vs, v.String()) + } + + return fmt.Sprintf(b.tmpl, vs...) } diff --git a/src/internal/observe/observe_test.go b/src/internal/observe/observe_test.go index 681cbeaf5..38a95bec3 100644 --- a/src/internal/observe/observe_test.go +++ b/src/internal/observe/observe_test.go @@ -26,6 +26,12 @@ func TestObserveProgressUnitSuite(t *testing.T) { suite.Run(t, new(ObserveProgressUnitSuite)) } +var ( + tst = observe.Safe("test") + testcat = observe.Safe("testcat") + testertons = observe.Safe("testertons") +) + func (suite *ObserveProgressUnitSuite) TestItemProgress() { ctx, flush := tester.NewContext() defer flush() @@ -47,7 +53,7 @@ func (suite *ObserveProgressUnitSuite) TestItemProgress() { ctx, io.NopCloser(bytes.NewReader(from)), "folder", - "test", + tst, 100) require.NotNil(t, prog) require.NotNil(t, closer) @@ -97,7 +103,7 @@ func (suite *ObserveProgressUnitSuite) TestCollectionProgress_unblockOnCtxCancel observe.SeedWriter(context.Background(), nil, nil) }() - progCh, closer := observe.CollectionProgress(ctx, "test", "testcat", "testertons") + progCh, closer := observe.CollectionProgress(ctx, "test", testcat, testertons) require.NotNil(t, progCh) require.NotNil(t, closer) @@ -132,7 +138,7 @@ func (suite *ObserveProgressUnitSuite) TestCollectionProgress_unblockOnChannelCl observe.SeedWriter(context.Background(), nil, nil) }() - progCh, closer := observe.CollectionProgress(ctx, "test", "testcat", "testertons") + progCh, closer := observe.CollectionProgress(ctx, "test", testcat, testertons) require.NotNil(t, progCh) require.NotNil(t, closer) @@ -164,7 +170,7 @@ func (suite *ObserveProgressUnitSuite) TestObserveProgress() { message := "Test Message" - observe.Message(ctx, message) + observe.Message(ctx, observe.Safe(message)) observe.Complete() require.NotEmpty(suite.T(), recorder.String()) require.Contains(suite.T(), recorder.String(), message) @@ -185,7 +191,7 @@ func (suite *ObserveProgressUnitSuite) TestObserveProgressWithCompletion() { message := "Test Message" - ch, closer := observe.MessageWithCompletion(ctx, message) + ch, closer := observe.MessageWithCompletion(ctx, observe.Safe(message)) // Trigger completion ch <- struct{}{} @@ -215,7 +221,7 @@ func (suite *ObserveProgressUnitSuite) TestObserveProgressWithChannelClosed() { message := "Test Message" - ch, closer := observe.MessageWithCompletion(ctx, message) + ch, closer := observe.MessageWithCompletion(ctx, observe.Safe(message)) // Close channel without completing close(ch) @@ -247,7 +253,7 @@ func (suite *ObserveProgressUnitSuite) TestObserveProgressWithContextCancelled() message := "Test Message" - _, closer := observe.MessageWithCompletion(ctx, message) + _, closer := observe.MessageWithCompletion(ctx, observe.Safe(message)) // cancel context cancel() @@ -278,7 +284,7 @@ func (suite *ObserveProgressUnitSuite) TestObserveProgressWithCount() { message := "Test Message" count := 3 - ch, closer := observe.ProgressWithCount(ctx, header, message, int64(count)) + ch, closer := observe.ProgressWithCount(ctx, header, observe.Safe(message), int64(count)) for i := 0; i < count; i++ { ch <- struct{}{} @@ -311,7 +317,7 @@ func (suite *ObserveProgressUnitSuite) TestObserveProgressWithCountChannelClosed message := "Test Message" count := 3 - ch, closer := observe.ProgressWithCount(ctx, header, message, int64(count)) + ch, closer := observe.ProgressWithCount(ctx, header, observe.Safe(message), int64(count)) close(ch) diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index a5a955150..6afad0f9a 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -256,7 +256,7 @@ func produceBackupDataCollections( metadata []data.Collection, ctrlOpts control.Options, ) ([]data.Collection, error) { - complete, closer := observe.MessageWithCompletion(ctx, "Discovering items to backup") + complete, closer := observe.MessageWithCompletion(ctx, observe.Safe("Discovering items to backup")) defer func() { complete <- struct{}{} close(complete) @@ -338,7 +338,7 @@ func consumeBackupDataCollections( backupID model.StableID, isIncremental bool, ) (*kopia.BackupStats, *details.Builder, map[string]path.Path, error) { - complete, closer := observe.MessageWithCompletion(ctx, "Backing up data") + complete, closer := observe.MessageWithCompletion(ctx, observe.Safe("Backing up data")) defer func() { complete <- struct{}{} close(complete) diff --git a/src/internal/operations/operation.go b/src/internal/operations/operation.go index e5382b022..c910712fb 100644 --- a/src/internal/operations/operation.go +++ b/src/internal/operations/operation.go @@ -95,7 +95,7 @@ func connectToM365( sel selectors.Selector, acct account.Account, ) (*connector.GraphConnector, error) { - complete, closer := observe.MessageWithCompletion(ctx, "Connecting to M365") + complete, closer := observe.MessageWithCompletion(ctx, observe.Safe("Connecting to M365")) defer func() { complete <- struct{}{} close(complete) diff --git a/src/internal/operations/restore.go b/src/internal/operations/restore.go index 03c203b05..3ed84c5f8 100644 --- a/src/internal/operations/restore.go +++ b/src/internal/operations/restore.go @@ -170,9 +170,9 @@ func (op *RestoreOperation) Run(ctx context.Context) (restoreDetails *details.De ctx = clues.Add(ctx, "details_paths", len(paths)) - observe.Message(ctx, fmt.Sprintf("Discovered %d items in backup %s to restore", len(paths), op.BackupID)) + observe.Message(ctx, observe.Safe(fmt.Sprintf("Discovered %d items in backup %s to restore", len(paths), op.BackupID))) - kopiaComplete, closer := observe.MessageWithCompletion(ctx, "Enumerating items in repository") + kopiaComplete, closer := observe.MessageWithCompletion(ctx, observe.Safe("Enumerating items in repository")) defer closer() defer close(kopiaComplete) @@ -196,7 +196,7 @@ func (op *RestoreOperation) Run(ctx context.Context) (restoreDetails *details.De return nil, opStats.readErr } - restoreComplete, closer := observe.MessageWithCompletion(ctx, "Restoring data") + restoreComplete, closer := observe.MessageWithCompletion(ctx, observe.Safe("Restoring data")) defer closer() defer close(restoreComplete) diff --git a/src/pkg/repository/repository.go b/src/pkg/repository/repository.go index c98a037c7..f8c8d3d49 100644 --- a/src/pkg/repository/repository.go +++ b/src/pkg/repository/repository.go @@ -154,7 +154,7 @@ func Connect( // their output getting clobbered (#1720) defer observe.Complete() - complete, closer := observe.MessageWithCompletion(ctx, "Connecting to repository") + complete, closer := observe.MessageWithCompletion(ctx, observe.Safe("Connecting to repository")) defer closer() defer close(complete) From 3cd82de23ada51bb16a405cb23eaaf33233bd8c7 Mon Sep 17 00:00:00 2001 From: Keepers Date: Thu, 26 Jan 2023 18:20:41 -0700 Subject: [PATCH 03/36] re-fetch file download url after expiration (#2283) ## Description If a drive item goes over its 1 hour jwt expiration to download the backing file, re-fetch the item and use the new download url to get the file. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :sunflower: Feature ## Issue(s) * #2267 ## Test Plan - [x] :muscle: Manual --- src/internal/connector/graph/errors.go | 109 +++++++++++++++--- .../connector/graph/service_helper.go | 41 +++++-- src/internal/connector/onedrive/collection.go | 30 ++++- src/internal/connector/onedrive/item.go | 77 +++++++++---- 4 files changed, 202 insertions(+), 55 deletions(-) diff --git a/src/internal/connector/graph/errors.go b/src/internal/connector/graph/errors.go index 86cec64bd..049660425 100644 --- a/src/internal/connector/graph/errors.go +++ b/src/internal/connector/graph/errors.go @@ -26,6 +26,15 @@ const ( errCodeMailboxNotEnabledForRESTAPI = "MailboxNotEnabledForRESTAPI" ) +var ( + Err401Unauthorized = errors.New("401 unauthorized") + // normally the graph client will catch this for us, but in case we + // run our own client Do(), we need to translate it to a timeout type + // failure locally. + Err429TooManyRequests = errors.New("429 too many requests") + Err503ServiceUnavailable = errors.New("503 Service Unavailable") +) + // The folder or item was deleted between the time we identified // it and when we tried to fetch data for it. type ErrDeletedInFlight struct { @@ -102,6 +111,89 @@ func asTimeout(err error) bool { return errors.As(err, &e) } +// isTimeoutErr is used to determine if the Graph error returned is +// because of Timeout. This is used to restrict retries to just +// timeouts as other errors are handled within a middleware in the +// client. +func isTimeoutErr(err error) bool { + if errors.Is(err, context.DeadlineExceeded) || os.IsTimeout(err) { + return true + } + + switch err := err.(type) { + case *url.Error: + return err.Timeout() + default: + return false + } +} + +type ErrThrottled struct { + common.Err +} + +func IsErrThrottled(err error) error { + if errors.Is(err, Err429TooManyRequests) { + return err + } + + if asThrottled(err) { + return err + } + + return nil +} + +func asThrottled(err error) bool { + e := ErrThrottled{} + return errors.As(err, &e) +} + +type ErrUnauthorized struct { + common.Err +} + +func IsErrUnauthorized(err error) error { + // TODO: refine this investigation. We don't currently know if + // a specific item download url expired, or if the full connection + // auth expired. + if errors.Is(err, Err401Unauthorized) { + return err + } + + if asUnauthorized(err) { + return err + } + + return nil +} + +func asUnauthorized(err error) bool { + e := ErrUnauthorized{} + return errors.As(err, &e) +} + +type ErrServiceUnavailable struct { + common.Err +} + +func IsSericeUnavailable(err error) error { + if errors.Is(err, Err503ServiceUnavailable) { + return err + } + + if asServiceUnavailable(err) { + return err + } + + return nil +} + +func asServiceUnavailable(err error) bool { + e := ErrUnauthorized{} + return errors.As(err, &e) +} + // --------------------------------------------------------------------------- // error parsers // --------------------------------------------------------------------------- @@ -122,20 +214,3 @@ func hasErrorCode(err error, codes ...string) bool { return slices.Contains(codes, *oDataError.GetError().GetCode()) } - -// isTimeoutErr is used to determine if the Graph error returned is -// because of Timeout. This is used to restrict retries to just -// timeouts as other errors are handled within a middleware in the -// client. -func isTimeoutErr(err error) bool { - if errors.Is(err, context.DeadlineExceeded) || os.IsTimeout(err) { - return true - } - - switch err := err.(type) { - case *url.Error: - return err.Timeout() - default: - return false - } -} diff --git a/src/internal/connector/graph/service_helper.go b/src/internal/connector/graph/service_helper.go index 900919406..bf39fe194 100644 --- a/src/internal/connector/graph/service_helper.go +++ b/src/internal/connector/graph/service_helper.go @@ -94,31 +94,48 @@ func (handler *LoggingMiddleware) Intercept( } if (resp.StatusCode / 100) == 2 { + if logger.DebugAPI || os.Getenv(logGraphRequestsEnvKey) != "" { + respDump, _ := httputil.DumpResponse(resp, false) + + metadata := []any{ + "idx", middlewareIndex, + "method", req.Method, + "status", resp.Status, + "statusCode", resp.StatusCode, + "requestLen", req.ContentLength, + "url", req.URL, + "response", respDump, + } + + logger.Ctx(ctx).Debugw("2xx graph api resp", metadata...) + } + return resp, err } - // special case for supportability: log all throttling cases. - if resp.StatusCode == http.StatusTooManyRequests { - logger.Ctx(ctx).Infow("graph api throttling", "method", req.Method, "url", req.URL) - } - - if resp.StatusCode != http.StatusTooManyRequests && (resp.StatusCode/100) != 2 { - logger.Ctx(ctx).Infow("graph api error", "method", req.Method, "url", req.URL) - } - if logger.DebugAPI || os.Getenv(logGraphRequestsEnvKey) != "" { respDump, _ := httputil.DumpResponse(resp, true) metadata := []any{ + "idx", middlewareIndex, "method", req.Method, - "url", req.URL, - "requestLen", req.ContentLength, "status", resp.Status, "statusCode", resp.StatusCode, - "request", string(respDump), + "requestLen", req.ContentLength, + "url", req.URL, + "response", string(respDump), } logger.Ctx(ctx).Errorw("non-2xx graph api response", metadata...) + } else { + // special case for supportability: log all throttling cases. + if resp.StatusCode == http.StatusTooManyRequests { + logger.Ctx(ctx).Infow("graph api throttling", "method", req.Method, "url", req.URL) + } + + if resp.StatusCode != http.StatusTooManyRequests && (resp.StatusCode/100) != 2 { + logger.Ctx(ctx).Infow("graph api error", "status", resp.Status, "method", req.Method, "url", req.URL) + } } return resp, err diff --git a/src/internal/connector/onedrive/collection.go b/src/internal/connector/onedrive/collection.go index 68ad71a89..77ac88c63 100644 --- a/src/internal/connector/onedrive/collection.go +++ b/src/internal/connector/onedrive/collection.go @@ -224,6 +224,7 @@ func (oc *Collection) populateItems(ctx context.Context) { defer func() { <-semaphoreCh }() var ( + itemID = *item.GetId() itemName = *item.GetName() itemSize = *item.GetSize() itemInfo details.ItemInfo @@ -251,7 +252,32 @@ func (oc *Collection) populateItems(ctx context.Context) { for i := 1; i <= maxRetries; i++ { _, itemData, err = oc.itemReader(oc.itemClient, item) - if err == nil || graph.IsErrTimeout(err) == nil { + if err == nil { + break + } + + if graph.IsErrUnauthorized(err) != nil { + // assume unauthorized requests are a sign of an expired + // jwt token, and that we've overrun the available window + // to download the actual file. Re-downloading the item + // will refresh that download url. + di, diErr := getDriveItem(ctx, oc.service, oc.driveID, itemID) + if diErr != nil { + err = errors.Wrap(diErr, "retrieving expired item") + break + } + + item = di + + continue + + } else if graph.IsErrTimeout(err) == nil && + graph.IsErrThrottled(err) == nil && + graph.IsSericeUnavailable(err) == nil { + // TODO: graphAPI will provides headers that state the duration to wait + // in order to succeed again. The one second sleep won't cut it here. + // + // for all non-timeout, non-unauth, non-throttling errors, do not retry break } @@ -262,7 +288,7 @@ func (oc *Collection) populateItems(ctx context.Context) { // check for errors following retries if err != nil { - errUpdater(*item.GetId(), err) + errUpdater(itemID, err) return nil, err } diff --git a/src/internal/connector/onedrive/item.go b/src/internal/connector/onedrive/item.go index 3e4e9e516..c4fd1b380 100644 --- a/src/internal/connector/onedrive/item.go +++ b/src/internal/connector/onedrive/item.go @@ -25,6 +25,15 @@ const ( downloadURLKey = "@microsoft.graph.downloadUrl" ) +// generic drive item getter +func getDriveItem( + ctx context.Context, + srv graph.Servicer, + driveID, itemID string, +) (models.DriveItemable, error) { + return srv.Client().DrivesById(driveID).ItemsById(itemID).Get(ctx, nil) +} + // sharePointItemReader will return a io.ReadCloser for the specified item // It crafts this by querying M365 for a download URL for the item // and using a http client to initialize a reader @@ -32,14 +41,9 @@ func sharePointItemReader( hc *http.Client, item models.DriveItemable, ) (details.ItemInfo, io.ReadCloser, error) { - url, ok := item.GetAdditionalData()[downloadURLKey].(*string) - if !ok { - return details.ItemInfo{}, nil, fmt.Errorf("failed to get url for %s", *item.GetName()) - } - - resp, err := hc.Get(*url) + resp, err := downloadItem(hc, item) if err != nil { - return details.ItemInfo{}, nil, err + return details.ItemInfo{}, nil, errors.Wrap(err, "downloading item") } dii := details.ItemInfo{ @@ -56,24 +60,9 @@ func oneDriveItemReader( hc *http.Client, item models.DriveItemable, ) (details.ItemInfo, io.ReadCloser, error) { - url, ok := item.GetAdditionalData()[downloadURLKey].(*string) - if !ok { - return details.ItemInfo{}, nil, fmt.Errorf("failed to get url for %s", *item.GetName()) - } - - req, err := http.NewRequest(http.MethodGet, *url, nil) + resp, err := downloadItem(hc, item) if err != nil { - return details.ItemInfo{}, nil, err - } - - // Decorate the traffic - //nolint:lll - // See https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#how-to-decorate-your-http-traffic - req.Header.Set("User-Agent", "ISV|Alcion|Corso/"+version.Version) - - resp, err := hc.Do(req) - if err != nil { - return details.ItemInfo{}, nil, err + return details.ItemInfo{}, nil, errors.Wrap(err, "downloading item") } dii := details.ItemInfo{ @@ -83,6 +72,46 @@ func oneDriveItemReader( return dii, resp.Body, nil } +func downloadItem(hc *http.Client, item models.DriveItemable) (*http.Response, error) { + url, ok := item.GetAdditionalData()[downloadURLKey].(*string) + if !ok { + return nil, fmt.Errorf("extracting file url: file %s", *item.GetId()) + } + + req, err := http.NewRequest(http.MethodGet, *url, nil) + if err != nil { + return nil, errors.Wrap(err, "new request") + } + + //nolint:lll + // Decorate the traffic + // See https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#how-to-decorate-your-http-traffic + req.Header.Set("User-Agent", "ISV|Alcion|Corso/"+version.Version) + + resp, err := hc.Do(req) + if err != nil { + return nil, err + } + + if (resp.StatusCode / 100) == 2 { + return resp, nil + } + + if resp.StatusCode == http.StatusTooManyRequests { + return resp, graph.Err429TooManyRequests + } + + if resp.StatusCode == http.StatusUnauthorized { + return resp, graph.Err401Unauthorized + } + + if resp.StatusCode == http.StatusServiceUnavailable { + return resp, graph.Err503ServiceUnavailable + } + + return resp, errors.New("non-2xx http response: " + resp.Status) +} + // oneDriveItemInfo will populate a details.OneDriveInfo struct // with properties from the drive item. ItemSize is specified // separately for restore processes because the local itemable From 06efad7028180a96c8384eebfbffb4c159829203 Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Thu, 26 Jan 2023 17:38:58 -0800 Subject: [PATCH 04/36] Bulk up kopia wrapper error checking in BackupOp (#2281) ## Description Expand error checking for kopia wrapper backup. Kopia may report a number of errors for a snapshot operation but may not give error structs for them. Handle this by checking if there were > 0 errors reported and making our own error struct for this if there are. This will keep the system from reporting a successful backup when kopia had problems reading or uploading data. Errored files in kopia do not become part of the snapshot ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [x] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Issue(s) * closes #2280 ## Test Plan - [ ] :muscle: Manual - [ x :zap: Unit test - [x] :green_heart: E2E --- src/internal/kopia/wrapper_test.go | 16 ++++++++++++++++ src/internal/operations/backup.go | 27 ++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/internal/kopia/wrapper_test.go b/src/internal/kopia/wrapper_test.go index 3654d8846..f30bef0c7 100644 --- a/src/internal/kopia/wrapper_test.go +++ b/src/internal/kopia/wrapper_test.go @@ -447,6 +447,22 @@ func (suite *KopiaIntegrationSuite) TestBackupCollections_ReaderError() { assert.False(t, stats.Incomplete) // 5 file and 6 folder entries. assert.Len(t, deets.Details().Entries, 5+6) + + failedPath, err := suite.testPath2.Append(testFileName4, true) + require.NoError(t, err) + + ic := i64counter{} + + _, err = suite.w.RestoreMultipleItems( + suite.ctx, + string(stats.SnapshotID), + []path.Path{failedPath}, + &ic, + ) + // Files that had an error shouldn't make a dir entry in kopia. If they do we + // may run into kopia-assisted incrementals issues because only mod time and + // not file size is checked for StreamingFiles. + assert.ErrorIs(t, err, ErrNotFound, "errored file is restorable") } type backedupFile struct { diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 6afad0f9a..aeddb86ed 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -400,7 +400,32 @@ func consumeBackupDataCollections( ) } - return bu.BackupCollections(ctx, bases, cs, tags, isIncremental) + kopiaStats, deets, itemsSourcedFromBase, err := bu.BackupCollections( + ctx, + bases, + cs, + tags, + isIncremental, + ) + + if kopiaStats.ErrorCount > 0 || kopiaStats.IgnoredErrorCount > 0 { + if err != nil { + err = errors.Wrapf( + err, + "kopia snapshot failed with %v catastrophic errors and %v ignored errors", + kopiaStats.ErrorCount, + kopiaStats.IgnoredErrorCount, + ) + } else { + err = errors.Errorf( + "kopia snapshot failed with %v catastrophic errors and %v ignored errors", + kopiaStats.ErrorCount, + kopiaStats.IgnoredErrorCount, + ) + } + } + + return kopiaStats, deets, itemsSourcedFromBase, err } func matchesReason(reasons []kopia.Reason, p path.Path) bool { From ce2c1ffbb39af943c0cbda8f8f8eeb515c68279e Mon Sep 17 00:00:00 2001 From: Keepers Date: Thu, 26 Jan 2023 21:24:06 -0700 Subject: [PATCH 05/36] clean up graph errors (#2286) ## Description The current interface makes no sense. This change refactors the funcs to standard boolean comparators. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :broom: Tech Debt/Cleanup --- .../connector/exchange/api/contacts.go | 2 +- src/internal/connector/exchange/api/events.go | 2 +- src/internal/connector/exchange/api/mail.go | 2 +- src/internal/connector/exchange/api/shared.go | 6 +- .../exchange/exchange_data_collection.go | 24 ++--- .../connector/exchange/service_iterators.go | 3 +- src/internal/connector/graph/errors.go | 100 +++++------------- src/internal/connector/onedrive/collection.go | 6 +- 8 files changed, 44 insertions(+), 101 deletions(-) diff --git a/src/internal/connector/exchange/api/contacts.go b/src/internal/connector/exchange/api/contacts.go index e12f4b795..85fea19fc 100644 --- a/src/internal/connector/exchange/api/contacts.go +++ b/src/internal/connector/exchange/api/contacts.go @@ -215,7 +215,7 @@ func (c Contacts) GetAddedAndRemovedItemIDs( } // only return on error if it is NOT a delta issue. // on bad deltas we retry the call with the regular builder - if graph.IsErrInvalidDelta(err) == nil { + if !graph.IsErrInvalidDelta(err) { return nil, nil, DeltaUpdate{}, err } diff --git a/src/internal/connector/exchange/api/events.go b/src/internal/connector/exchange/api/events.go index f78aef76b..cdb74ad19 100644 --- a/src/internal/connector/exchange/api/events.go +++ b/src/internal/connector/exchange/api/events.go @@ -216,7 +216,7 @@ func (c Events) GetAddedAndRemovedItemIDs( } // only return on error if it is NOT a delta issue. // on bad deltas we retry the call with the regular builder - if graph.IsErrInvalidDelta(err) == nil { + if !graph.IsErrInvalidDelta(err) { return nil, nil, DeltaUpdate{}, err } diff --git a/src/internal/connector/exchange/api/mail.go b/src/internal/connector/exchange/api/mail.go index 59085ba96..f29d64bd8 100644 --- a/src/internal/connector/exchange/api/mail.go +++ b/src/internal/connector/exchange/api/mail.go @@ -215,7 +215,7 @@ func (c Mail) GetAddedAndRemovedItemIDs( } // only return on error if it is NOT a delta issue. // on bad deltas we retry the call with the regular builder - if graph.IsErrInvalidDelta(err) == nil { + if !graph.IsErrInvalidDelta(err) { return nil, nil, DeltaUpdate{}, err } diff --git a/src/internal/connector/exchange/api/shared.go b/src/internal/connector/exchange/api/shared.go index c77e21fa8..dfe64d716 100644 --- a/src/internal/connector/exchange/api/shared.go +++ b/src/internal/connector/exchange/api/shared.go @@ -72,11 +72,7 @@ func getItemsAddedAndRemovedFromContainer( // get the next page of data, check for standard errors resp, err := pager.getPage(ctx) if err != nil { - if err := graph.IsErrDeletedInFlight(err); err != nil { - return nil, nil, deltaURL, err - } - - if err := graph.IsErrInvalidDelta(err); err != nil { + if graph.IsErrDeletedInFlight(err) || graph.IsErrInvalidDelta(err) { return nil, nil, deltaURL, err } diff --git a/src/internal/connector/exchange/exchange_data_collection.go b/src/internal/connector/exchange/exchange_data_collection.go index 1a628a28d..44418e9bd 100644 --- a/src/internal/connector/exchange/exchange_data_collection.go +++ b/src/internal/connector/exchange/exchange_data_collection.go @@ -260,17 +260,13 @@ func (col *Collection) streamItems(ctx context.Context) { // If the data is no longer available just return here and chalk it up // as a success. There's no reason to retry and no way we can backup up // enough information to restore the item anyway. - if e := graph.IsErrDeletedInFlight(err); e != nil { + if graph.IsErrDeletedInFlight(err) { atomic.AddInt64(&success, 1) logger.Ctx(ctx).Infow( "Graph reported item not found", - "error", - e, - "service", - path.ExchangeService.String(), - "category", - col.category.String, - ) + "error", err, + "service", path.ExchangeService.String(), + "category", col.category.String) return } @@ -286,17 +282,13 @@ func (col *Collection) streamItems(ctx context.Context) { // there's really nothing we can do and not reporting it will make the // status code upset cause we won't have the same number of results as // attempted items. - if e := graph.IsErrDeletedInFlight(err); e != nil { + if graph.IsErrDeletedInFlight(err) { atomic.AddInt64(&success, 1) logger.Ctx(ctx).Infow( "Graph reported item not found", - "error", - e, - "service", - path.ExchangeService.String(), - "category", - col.category.String, - ) + "error", err, + "service", path.ExchangeService.String(), + "category", col.category.String) return } diff --git a/src/internal/connector/exchange/service_iterators.go b/src/internal/connector/exchange/service_iterators.go index 0880ad233..b59f37877 100644 --- a/src/internal/connector/exchange/service_iterators.go +++ b/src/internal/connector/exchange/service_iterators.go @@ -93,8 +93,7 @@ func filterContainersAndFillCollections( added, removed, newDelta, err := getter.GetAddedAndRemovedItemIDs(ctx, qp.ResourceOwner, cID, prevDelta) if err != nil { - // note == nil check; only catches non-inFlight error cases. - if graph.IsErrDeletedInFlight(err) == nil { + if !graph.IsErrDeletedInFlight(err) { errs = support.WrapAndAppend(qp.ResourceOwner, err, errs) continue } diff --git a/src/internal/connector/graph/errors.go b/src/internal/connector/graph/errors.go index 049660425..c75e4a6cb 100644 --- a/src/internal/connector/graph/errors.go +++ b/src/internal/connector/graph/errors.go @@ -41,21 +41,17 @@ type ErrDeletedInFlight struct { common.Err } -func IsErrDeletedInFlight(err error) error { - if asDeletedInFlight(err) { - return err +func IsErrDeletedInFlight(err error) bool { + e := ErrDeletedInFlight{} + if errors.As(err, &e) { + return true } if hasErrorCode(err, errCodeItemNotFound, errCodeSyncFolderNotFound) { - return ErrDeletedInFlight{*common.EncapsulateError(err)} + return true } - return nil -} - -func asDeletedInFlight(err error) bool { - e := ErrDeletedInFlight{} - return errors.As(err, &e) + return false } // Delta tokens can be desycned or expired. In either case, the token @@ -65,21 +61,17 @@ type ErrInvalidDelta struct { common.Err } -func IsErrInvalidDelta(err error) error { - if asInvalidDelta(err) { - return err +func IsErrInvalidDelta(err error) bool { + e := ErrInvalidDelta{} + if errors.As(err, &e) { + return true } if hasErrorCode(err, errCodeSyncStateNotFound, errCodeResyncRequired) { - return ErrInvalidDelta{*common.EncapsulateError(err)} + return true } - return nil -} - -func asInvalidDelta(err error) bool { - e := ErrInvalidDelta{} - return errors.As(err, &e) + return false } func IsErrExchangeMailFolderNotFound(err error) bool { @@ -94,28 +86,12 @@ type ErrTimeout struct { common.Err } -func IsErrTimeout(err error) error { - if asTimeout(err) { - return err - } - - if isTimeoutErr(err) { - return ErrTimeout{*common.EncapsulateError(err)} - } - - return nil -} - -func asTimeout(err error) bool { +func IsErrTimeout(err error) bool { e := ErrTimeout{} - return errors.As(err, &e) -} + if errors.As(err, &e) { + return true + } -// isTimeoutErr is used to determine if the Graph error returned is -// because of Timeout. This is used to restrict retries to just -// timeouts as other errors are handled within a middleware in the -// client. -func isTimeoutErr(err error) bool { if errors.Is(err, context.DeadlineExceeded) || os.IsTimeout(err) { return true } @@ -132,20 +108,13 @@ type ErrThrottled struct { common.Err } -func IsErrThrottled(err error) error { +func IsErrThrottled(err error) bool { if errors.Is(err, Err429TooManyRequests) { - return err + return true } - if asThrottled(err) { - return err - } - - return nil -} - -func asThrottled(err error) bool { e := ErrThrottled{} + return errors.As(err, &e) } @@ -153,23 +122,16 @@ type ErrUnauthorized struct { common.Err } -func IsErrUnauthorized(err error) error { +func IsErrUnauthorized(err error) bool { // TODO: refine this investigation. We don't currently know if // a specific item download url expired, or if the full connection // auth expired. if errors.Is(err, Err401Unauthorized) { - return err + return true } - if asUnauthorized(err) { - return err - } - - return nil -} - -func asUnauthorized(err error) bool { e := ErrUnauthorized{} + return errors.As(err, &e) } @@ -177,21 +139,17 @@ type ErrServiceUnavailable struct { common.Err } -func IsSericeUnavailable(err error) error { +func IsSericeUnavailable(err error) bool { if errors.Is(err, Err503ServiceUnavailable) { - return err + return true } - if asServiceUnavailable(err) { - return err - } - - return nil -} - -func asServiceUnavailable(err error) bool { e := ErrUnauthorized{} - return errors.As(err, &e) + if errors.As(err, &e) { + return true + } + + return true } // --------------------------------------------------------------------------- diff --git a/src/internal/connector/onedrive/collection.go b/src/internal/connector/onedrive/collection.go index 77ac88c63..a786de0ab 100644 --- a/src/internal/connector/onedrive/collection.go +++ b/src/internal/connector/onedrive/collection.go @@ -256,7 +256,7 @@ func (oc *Collection) populateItems(ctx context.Context) { break } - if graph.IsErrUnauthorized(err) != nil { + if graph.IsErrUnauthorized(err) { // assume unauthorized requests are a sign of an expired // jwt token, and that we've overrun the available window // to download the actual file. Re-downloading the item @@ -271,9 +271,7 @@ func (oc *Collection) populateItems(ctx context.Context) { continue - } else if graph.IsErrTimeout(err) == nil && - graph.IsErrThrottled(err) == nil && - graph.IsSericeUnavailable(err) == nil { + } else if !graph.IsErrTimeout(err) && !graph.IsErrThrottled(err) && !graph.IsSericeUnavailable(err) { // TODO: graphAPI will provides headers that state the duration to wait // in order to succeed again. The one second sleep won't cut it here. // From 5783464846b602a4a816b90753303d08e2058247 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Jan 2023 06:06:31 +0000 Subject: [PATCH 06/36] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20github.com/aw?= =?UTF-8?q?s/aws-sdk-go=20from=201.44.187=20to=201.44.188=20in=20/src=20(#?= =?UTF-8?q?2293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.187 to 1.44.188.
Release notes

Sourced from github.com/aws/aws-sdk-go's releases.

Release v1.44.188 (2023-01-26)

Service Client Updates

  • service/eventbridge: Updates service documentation
  • service/iotfleetwise: Updates service API
  • service/s3: Updates service examples
    • Allow FIPS to be used with path-style URLs.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/aws/aws-sdk-go&package-manager=go_modules&previous-version=1.44.187&new-version=1.44.188)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- src/go.mod | 2 +- src/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/go.mod b/src/go.mod index 86a5df660..64ff5f1b8 100644 --- a/src/go.mod +++ b/src/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 github.com/alcionai/clues v0.0.0-20230120231953-1cf61dbafc40 - github.com/aws/aws-sdk-go v1.44.187 + github.com/aws/aws-sdk-go v1.44.188 github.com/aws/aws-xray-sdk-go v1.8.0 github.com/google/uuid v1.3.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/src/go.sum b/src/go.sum index ff6021e3c..9b63e27fe 100644 --- a/src/go.sum +++ b/src/go.sum @@ -62,8 +62,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/aws/aws-sdk-go v1.44.187 h1:D5CsRomPnlwDHJCanL2mtaLIcbhjiWxNh5j8zvaWdJA= -github.com/aws/aws-sdk-go v1.44.187/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.188 h1:NCN6wFDWKU72Ka+f7cCk3HRj1KxkEXhRdr7lO8oBRRQ= +github.com/aws/aws-sdk-go v1.44.188/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-xray-sdk-go v1.8.0 h1:0xncHZ588wB/geLjbM/esoW3FOEThWy2TJyb4VXfLFY= github.com/aws/aws-xray-sdk-go v1.8.0/go.mod h1:7LKe47H+j3evfvS1+q0wzpoaGXGrF3mUsfM+thqVO+A= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= From 137cf5038c9c57736c30f4749830a9893d203786 Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Fri, 27 Jan 2023 13:01:04 +0530 Subject: [PATCH 07/36] Reword docs about latest binary artifact downloads (#2289) ## Description Just some docs cleanup. ## Does this PR need a docs update or release note? - [x] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [ ] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [x] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Issue(s) * fixes https://github.com/alcionai/corso/issues/2278 ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- website/docs/developers/build.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/website/docs/developers/build.md b/website/docs/developers/build.md index baa3261ed..8d0dfa878 100644 --- a/website/docs/developers/build.md +++ b/website/docs/developers/build.md @@ -19,10 +19,12 @@ If you don't have Go available, you can find installation instructions [here](ht This will generate a binary named `corso` in the directory where you run the build. :::note -You can download binary artifacts of the latest commit from GitHub by -navigating to the "Summary" page of the `Build/Release Corso` CI job -that was run for that commit. -You will find the artifacts at the bottom of the page. +Prebuilt binary artifacts of the latest commit are available on GitHub. +You can access them by navigating to the "Summary" page of +the [`Build/Release Corso` CI job](https://github.com/alcionai/corso/actions/workflows/ci.yml?query=branch%3Amain) +that was run for the latest commit on the `main` branch. +The downloads will be available in the "Artifacts" section towards the +bottom of the page. ::: ### Building via Docker From f69dfc14e2ec8dc78081745aa54a47e4d8494184 Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Fri, 27 Jan 2023 09:09:40 -0800 Subject: [PATCH 08/36] Wire kopia exclude list up to BackupOp (#2244) ## Description Expose the global exclude list mechanism in kopia BackupCollections to other components. Add tests for BackupCollections testing new exclude list functionality Currently wired to always be passed nil ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No ## Type of change - [x] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Issue(s) * #2243 merge after: * #2143 ## Test Plan - [ ] :muscle: Manual - [x] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/kopia/wrapper.go | 5 +- src/internal/kopia/wrapper_test.go | 135 ++++++++++++++++++++++++ src/internal/operations/backup.go | 2 + src/internal/operations/backup_test.go | 1 + src/internal/streamstore/streamstore.go | 1 + 5 files changed, 140 insertions(+), 4 deletions(-) diff --git a/src/internal/kopia/wrapper.go b/src/internal/kopia/wrapper.go index 13db75ac4..8c1aaeec7 100644 --- a/src/internal/kopia/wrapper.go +++ b/src/internal/kopia/wrapper.go @@ -119,6 +119,7 @@ func (w Wrapper) BackupCollections( ctx context.Context, previousSnapshots []IncrementalBase, collections []data.Collection, + globalExcludeSet map[string]struct{}, tags map[string]string, buildTreeWithBase bool, ) (*BackupStats, *details.Builder, map[string]path.Path, error) { @@ -129,10 +130,6 @@ func (w Wrapper) BackupCollections( ctx, end := D.Span(ctx, "kopia:backupCollections") defer end() - // TODO(ashmrtn): Make this a parameter when actually enabling the global - // exclude set. - var globalExcludeSet map[string]struct{} - if len(collections) == 0 && len(globalExcludeSet) == 0 { return &BackupStats{}, &details.Builder{}, nil, nil } diff --git a/src/internal/kopia/wrapper_test.go b/src/internal/kopia/wrapper_test.go index f30bef0c7..54bbb4c8e 100644 --- a/src/internal/kopia/wrapper_test.go +++ b/src/internal/kopia/wrapper_test.go @@ -266,6 +266,7 @@ func (suite *KopiaIntegrationSuite) TestBackupCollections() { suite.ctx, prevSnaps, collections, + nil, tags, true, ) @@ -353,6 +354,7 @@ func (suite *KopiaIntegrationSuite) TestRestoreAfterCompressionChange() { ctx, nil, []data.Collection{dc1, dc2}, + nil, tags, true, ) @@ -435,6 +437,7 @@ func (suite *KopiaIntegrationSuite) TestBackupCollections_ReaderError() { suite.ctx, nil, collections, + nil, tags, true, ) @@ -496,6 +499,7 @@ func (suite *KopiaIntegrationSuite) TestBackupCollectionsHandlesNoCollections() nil, test.collections, nil, + nil, true, ) require.NoError(t, err) @@ -653,6 +657,7 @@ func (suite *KopiaSimpleRepoIntegrationSuite) SetupTest() { suite.ctx, nil, collections, + nil, tags, false, ) @@ -681,6 +686,136 @@ func (c *i64counter) Count(i int64) { c.i += i } +func (suite *KopiaSimpleRepoIntegrationSuite) TestBackupExcludeItem() { + reason := Reason{ + ResourceOwner: testUser, + Service: path.ExchangeService, + Category: path.EmailCategory, + } + + subtreePathTmp, err := path.Builder{}.Append("tmp").ToDataLayerExchangePathForCategory( + testTenant, + testUser, + path.EmailCategory, + false, + ) + require.NoError(suite.T(), err) + + subtreePath := subtreePathTmp.ToBuilder().Dir() + + manifests, err := suite.w.FetchPrevSnapshotManifests( + suite.ctx, + []Reason{reason}, + nil, + ) + require.NoError(suite.T(), err) + require.Len(suite.T(), manifests, 1) + require.Equal(suite.T(), suite.snapshotID, manifests[0].ID) + + tags := map[string]string{} + + for _, k := range reason.TagKeys() { + tags[k] = "" + } + + table := []struct { + name string + excludeItem bool + expectedCachedItems int + expectedUncachedItems int + cols func() []data.Collection + backupIDCheck require.ValueAssertionFunc + restoreCheck assert.ErrorAssertionFunc + }{ + { + name: "ExcludeItem", + excludeItem: true, + expectedCachedItems: len(suite.filesByPath) - 1, + expectedUncachedItems: 0, + cols: func() []data.Collection { + return nil + }, + backupIDCheck: require.NotEmpty, + restoreCheck: assert.Error, + }, + { + name: "NoExcludeItemNoChanges", + // No snapshot should be made since there were no changes. + expectedCachedItems: 0, + expectedUncachedItems: 0, + cols: func() []data.Collection { + return nil + }, + // Backup doesn't run. + backupIDCheck: require.Empty, + }, + { + name: "NoExcludeItemWithChanges", + expectedCachedItems: len(suite.filesByPath), + expectedUncachedItems: 1, + cols: func() []data.Collection { + c := mockconnector.NewMockExchangeCollection( + suite.testPath1, + 1, + ) + c.ColState = data.NotMovedState + + return []data.Collection{c} + }, + backupIDCheck: require.NotEmpty, + restoreCheck: assert.NoError, + }, + } + + for _, test := range table { + suite.T().Run(test.name, func(t *testing.T) { + var excluded map[string]struct{} + if test.excludeItem { + excluded = map[string]struct{}{ + suite.files[suite.testPath1.String()][0].itemPath.Item(): {}, + } + } + + stats, _, _, err := suite.w.BackupCollections( + suite.ctx, + []IncrementalBase{ + { + Manifest: manifests[0].Manifest, + SubtreePaths: []*path.Builder{ + subtreePath, + }, + }, + }, + test.cols(), + excluded, + tags, + true, + ) + require.NoError(t, err) + assert.Equal(t, test.expectedCachedItems, stats.CachedFileCount) + assert.Equal(t, test.expectedUncachedItems, stats.UncachedFileCount) + + test.backupIDCheck(t, stats.SnapshotID) + + if len(stats.SnapshotID) == 0 { + return + } + + ic := i64counter{} + + _, err = suite.w.RestoreMultipleItems( + suite.ctx, + string(stats.SnapshotID), + []path.Path{ + suite.files[suite.testPath1.String()][0].itemPath, + }, + &ic, + ) + test.restoreCheck(t, err) + }) + } +} + func (suite *KopiaSimpleRepoIntegrationSuite) TestRestoreMultipleItems() { doesntExist, err := path.Builder{}.Append("subdir", "foo").ToDataLayerExchangePathForCategory( testTenant, diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index aeddb86ed..026061b59 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -275,6 +275,7 @@ type backuper interface { ctx context.Context, bases []kopia.IncrementalBase, cs []data.Collection, + excluded map[string]struct{}, tags map[string]string, buildTreeWithBase bool, ) (*kopia.BackupStats, *details.Builder, map[string]path.Path, error) @@ -404,6 +405,7 @@ func consumeBackupDataCollections( ctx, bases, cs, + nil, tags, isIncremental, ) diff --git a/src/internal/operations/backup_test.go b/src/internal/operations/backup_test.go index 32a6d1a4e..795f341c6 100644 --- a/src/internal/operations/backup_test.go +++ b/src/internal/operations/backup_test.go @@ -95,6 +95,7 @@ func (mbu mockBackuper) BackupCollections( ctx context.Context, bases []kopia.IncrementalBase, cs []data.Collection, + excluded map[string]struct{}, tags map[string]string, buildTreeWithBase bool, ) (*kopia.BackupStats, *details.Builder, map[string]path.Path, error) { diff --git a/src/internal/streamstore/streamstore.go b/src/internal/streamstore/streamstore.go index 92123194e..fb5dfccd9 100644 --- a/src/internal/streamstore/streamstore.go +++ b/src/internal/streamstore/streamstore.go @@ -78,6 +78,7 @@ func (ss *streamStore) WriteBackupDetails( nil, []data.Collection{dc}, nil, + nil, false, ) if err != nil { From 2aaaa7a1cb7ee40ab3993dab7d8b1f94a6b3dcf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C4=8Dnica=20Mellifera?= Date: Fri, 27 Jan 2023 10:51:26 -0800 Subject: [PATCH 09/36] update from Google Analytics to Google Tag Manager (#2288) ## Description reconfigures to use google tag manager rather than direct to Google Analytics. ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [ ] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Issue(s) * # ## Test Plan - [ ] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- website/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 375df5a88..18382ab0e 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -59,7 +59,7 @@ const config = { filename: 'sitemap.xml', }, gtag: { - trackingID: 'G-YXBFPQZ05N', + trackingID: 'GTM-KM3XWPV', }, theme: { customCss: require.resolve('./src/css/custom.scss'), From 24911a358b88748b4ca4bddaacf5d3f07406e6e8 Mon Sep 17 00:00:00 2001 From: Keepers Date: Fri, 27 Jan 2023 12:34:00 -0700 Subject: [PATCH 10/36] quick graph client refactor (#2301) ## Description A couple minor refactors. First, combines the graph/service_helper.go and graph/service.go files into a single file (just lift'n'shift, no logic changes). Second, renames CreateHTTPClient to just HTTPClient. Third, replaces the new LargeItemClient constructor with extensible options for the http client, starting with a NoTimeout option. This will provide longer term maintenance over multiple constructors. This change sets up QoL for building multiple services and clients within api layer handlers, which will appear in an immediately following PR. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :broom: Tech Debt/Cleanup ## Issue(s) * #2299 ## Test Plan - [x] :zap: Unit test - [x] :green_heart: E2E --- src/cli/backup/sharepoint.go | 2 +- src/cmd/factory/impl/common.go | 2 +- src/cmd/getM365/getItem.go | 2 +- src/cmd/purge/purge.go | 2 +- .../connector/data_collections_test.go | 16 +- src/internal/connector/graph/service.go | 174 +++++++++++++++++- .../connector/graph/service_helper.go | 142 -------------- src/internal/connector/graph/service_test.go | 47 ++++- .../graph_connector_disconnected_test.go | 2 +- .../connector/graph_connector_test.go | 10 +- .../connector/onedrive/collection_test.go | 4 +- .../connector/onedrive/collections_test.go | 2 +- src/internal/connector/onedrive/drive_test.go | 2 +- src/internal/connector/onedrive/item_test.go | 2 +- .../sharepoint/data_collections_test.go | 2 +- .../operations/backup_integration_test.go | 2 +- src/internal/operations/operation.go | 2 +- src/pkg/services/m365/m365.go | 6 +- 18 files changed, 239 insertions(+), 182 deletions(-) delete mode 100644 src/internal/connector/graph/service_helper.go diff --git a/src/cli/backup/sharepoint.go b/src/cli/backup/sharepoint.go index fb4f7e766..9fa8afb6b 100644 --- a/src/cli/backup/sharepoint.go +++ b/src/cli/backup/sharepoint.go @@ -210,7 +210,7 @@ func createSharePointCmd(cmd *cobra.Command, args []string) error { defer utils.CloseRepo(ctx, r) - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), acct, connector.Sites) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), acct, connector.Sites) if err != nil { return Only(ctx, errors.Wrap(err, "Failed to connect to Microsoft APIs")) } diff --git a/src/cmd/factory/impl/common.go b/src/cmd/factory/impl/common.go index 585118442..0ea6835dd 100644 --- a/src/cmd/factory/impl/common.go +++ b/src/cmd/factory/impl/common.go @@ -112,7 +112,7 @@ func getGCAndVerifyUser(ctx context.Context, userID string) (*connector.GraphCon } // build a graph connector - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), acct, connector.Users) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), acct, connector.Users) if err != nil { return nil, account.Account{}, errors.Wrap(err, "connecting to graph api") } diff --git a/src/cmd/getM365/getItem.go b/src/cmd/getM365/getItem.go index 24ce81d9a..d24b27d38 100644 --- a/src/cmd/getM365/getItem.go +++ b/src/cmd/getM365/getItem.go @@ -178,7 +178,7 @@ func getGC(ctx context.Context) (*connector.GraphConnector, account.M365Config, return nil, m365Cfg, Only(ctx, errors.Wrap(err, "finding m365 account details")) } - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), acct, connector.Users) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), acct, connector.Users) if err != nil { return nil, m365Cfg, Only(ctx, errors.Wrap(err, "connecting to graph API")) } diff --git a/src/cmd/purge/purge.go b/src/cmd/purge/purge.go index 32100772d..3d7074835 100644 --- a/src/cmd/purge/purge.go +++ b/src/cmd/purge/purge.go @@ -255,7 +255,7 @@ func getGC(ctx context.Context) (*connector.GraphConnector, error) { } // build a graph connector - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), acct, connector.Users) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), acct, connector.Users) if err != nil { return nil, Only(ctx, errors.Wrap(err, "connecting to graph api")) } diff --git a/src/internal/connector/data_collections_test.go b/src/internal/connector/data_collections_test.go index 57332ce1a..877975bb5 100644 --- a/src/internal/connector/data_collections_test.go +++ b/src/internal/connector/data_collections_test.go @@ -44,7 +44,7 @@ func (suite *ConnectorDataCollectionIntegrationSuite) SetupSuite() { tester.MustGetEnvVars(suite.T(), tester.M365AcctCredEnvs...) - suite.connector = loadConnector(ctx, suite.T(), graph.LargeItemClient(), AllResources) + suite.connector = loadConnector(ctx, suite.T(), graph.HTTPClient(graph.NoTimeout()), AllResources) suite.user = tester.M365UserID(suite.T()) suite.site = tester.M365SiteID(suite.T()) @@ -63,7 +63,7 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestExchangeDataCollection selUsers := []string{suite.user} - connector := loadConnector(ctx, suite.T(), graph.LargeItemClient(), Users) + connector := loadConnector(ctx, suite.T(), graph.HTTPClient(graph.NoTimeout()), Users) tests := []struct { name string getSelector func(t *testing.T) selectors.Selector @@ -139,7 +139,7 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestDataCollections_invali owners := []string{"snuffleupagus"} - connector := loadConnector(ctx, suite.T(), graph.LargeItemClient(), Users) + connector := loadConnector(ctx, suite.T(), graph.HTTPClient(graph.NoTimeout()), Users) tests := []struct { name string getSelector func(t *testing.T) selectors.Selector @@ -215,7 +215,7 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestSharePointDataCollecti selSites := []string{suite.site} - connector := loadConnector(ctx, suite.T(), graph.LargeItemClient(), Sites) + connector := loadConnector(ctx, suite.T(), graph.HTTPClient(graph.NoTimeout()), Sites) tests := []struct { name string expected int @@ -244,7 +244,7 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestSharePointDataCollecti suite.T().Run(test.name, func(t *testing.T) { collections, err := sharepoint.DataCollections( ctx, - graph.LargeItemClient(), + graph.HTTPClient(graph.NoTimeout()), test.getSelector(), connector.credentials.AzureTenantID, connector.Service, @@ -300,7 +300,7 @@ func (suite *ConnectorCreateSharePointCollectionIntegrationSuite) SetupSuite() { tester.MustGetEnvSets(suite.T(), tester.M365AcctCredEnvs) - suite.connector = loadConnector(ctx, suite.T(), graph.LargeItemClient(), Sites) + suite.connector = loadConnector(ctx, suite.T(), graph.HTTPClient(graph.NoTimeout()), Sites) suite.user = tester.M365UserID(suite.T()) tester.LogTimeOfTest(suite.T()) @@ -313,7 +313,7 @@ func (suite *ConnectorCreateSharePointCollectionIntegrationSuite) TestCreateShar var ( t = suite.T() siteID = tester.M365SiteID(t) - gc = loadConnector(ctx, t, graph.LargeItemClient(), Sites) + gc = loadConnector(ctx, t, graph.HTTPClient(graph.NoTimeout()), Sites) siteIDs = []string{siteID} ) @@ -337,7 +337,7 @@ func (suite *ConnectorCreateSharePointCollectionIntegrationSuite) TestCreateShar var ( t = suite.T() siteID = tester.M365SiteID(t) - gc = loadConnector(ctx, t, graph.LargeItemClient(), Sites) + gc = loadConnector(ctx, t, graph.HTTPClient(graph.NoTimeout()), Sites) siteIDs = []string{siteID} ) diff --git a/src/internal/connector/graph/service.go b/src/internal/connector/graph/service.go index 7780e7941..fa4662014 100644 --- a/src/internal/connector/graph/service.go +++ b/src/internal/connector/graph/service.go @@ -2,15 +2,28 @@ package graph import ( "context" + "net/http" + "net/http/httputil" + "os" + "time" - absser "github.com/microsoft/kiota-abstractions-go/serialization" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/microsoft/kiota-abstractions-go/serialization" + ka "github.com/microsoft/kiota-authentication-azure-go" + khttp "github.com/microsoft/kiota-http-go" msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" + msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core" "github.com/pkg/errors" "github.com/alcionai/corso/src/pkg/account" + "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" ) +const ( + logGraphRequestsEnvKey = "LOG_GRAPH_REQUESTS" +) + // AllMetadataFileNames produces the standard set of filenames used to store graph // metadata such as delta tokens and folderID->path references. func AllMetadataFileNames() []string { @@ -23,6 +36,10 @@ type QueryParams struct { Credentials account.M365Config } +// --------------------------------------------------------------------------- +// Service Handler +// --------------------------------------------------------------------------- + var _ Servicer = &Service{} type Service struct { @@ -47,7 +64,7 @@ func (s Service) Client() *msgraphsdk.GraphServiceClient { // Seraialize writes an M365 parsable object into a byte array using the built-in // application/json writer within the adapter. -func (s Service) Serialize(object absser.Parsable) ([]byte, error) { +func (s Service) Serialize(object serialization.Parsable) ([]byte, error) { writer, err := s.adapter.GetSerializationWriterFactory().GetSerializationWriter("application/json") if err != nil || writer == nil { return nil, errors.Wrap(err, "creating json serialization writer") @@ -61,6 +78,90 @@ func (s Service) Serialize(object absser.Parsable) ([]byte, error) { return writer.GetSerializedContent() } +// --------------------------------------------------------------------------- +// Helpers +// --------------------------------------------------------------------------- + +type clientConfig struct { + noTimeout bool +} + +type option func(*clientConfig) + +// populate constructs a clientConfig according to the provided options. +func (c *clientConfig) populate(opts ...option) *clientConfig { + for _, opt := range opts { + opt(c) + } + + return c +} + +// apply updates the http.Client with the expected options. +func (c *clientConfig) apply(hc *http.Client) { + if c.noTimeout { + hc.Timeout = 0 + } +} + +// NoTimeout sets the httpClient.Timeout to 0 (unlimited). +// The resulting client isn't suitable for most queries, due to the +// capacity for a call to persist forever. This configuration should +// only be used when downloading very large files. +func NoTimeout() option { + return func(c *clientConfig) { + c.noTimeout = true + } +} + +// CreateAdapter uses provided credentials to log into M365 using Kiota Azure Library +// with Azure identity package. An adapter object is a necessary to component +// to create *msgraphsdk.GraphServiceClient +func CreateAdapter(tenant, client, secret string, opts ...option) (*msgraphsdk.GraphRequestAdapter, error) { + // Client Provider: Uses Secret for access to tenant-level data + cred, err := azidentity.NewClientSecretCredential(tenant, client, secret, nil) + if err != nil { + return nil, errors.Wrap(err, "creating m365 client secret credentials") + } + + auth, err := ka.NewAzureIdentityAuthenticationProviderWithScopes( + cred, + []string{"https://graph.microsoft.com/.default"}, + ) + if err != nil { + return nil, errors.Wrap(err, "creating new AzureIdentityAuthentication") + } + + httpClient := HTTPClient(opts...) + + return msgraphsdk.NewGraphRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient( + auth, nil, nil, httpClient) +} + +// HTTPClient creates the httpClient with middlewares and timeout configured +// +// Re-use of http clients is critical, or else we leak OS resources +// and consume relatively unbound socket connections. It is important +// to centralize this client to be passed downstream where api calls +// can utilize it on a per-download basis. +func HTTPClient(opts ...option) *http.Client { + clientOptions := msgraphsdk.GetDefaultClientOptions() + middlewares := msgraphgocore.GetDefaultMiddlewaresWithOptions(&clientOptions) + middlewares = append(middlewares, &LoggingMiddleware{}) + httpClient := msgraphgocore.GetDefaultClient(&clientOptions, middlewares...) + httpClient.Timeout = time.Second * 90 + + (&clientConfig{}). + populate(opts...). + apply(httpClient) + + return httpClient +} + +// --------------------------------------------------------------------------- +// Interfaces +// --------------------------------------------------------------------------- + type Servicer interface { // Client() returns msgraph Service client that can be used to process and execute // the majority of the queries to the M365 Backstore @@ -120,3 +221,72 @@ type ContainerResolver interface { // Items returns the containers in the cache. Items() []CachedContainer } + +// --------------------------------------------------------------------------- +// Client Middleware +// --------------------------------------------------------------------------- + +// LoggingMiddleware can be used to log the http request sent by the graph client +type LoggingMiddleware struct{} + +func (handler *LoggingMiddleware) Intercept( + pipeline khttp.Pipeline, + middlewareIndex int, + req *http.Request, +) (*http.Response, error) { + var ( + ctx = req.Context() + resp, err = pipeline.Next(req, middlewareIndex) + ) + + if resp == nil { + return resp, err + } + + if (resp.StatusCode / 100) == 2 { + if logger.DebugAPI || os.Getenv(logGraphRequestsEnvKey) != "" { + respDump, _ := httputil.DumpResponse(resp, false) + + metadata := []any{ + "idx", middlewareIndex, + "method", req.Method, + "status", resp.Status, + "statusCode", resp.StatusCode, + "requestLen", req.ContentLength, + "url", req.URL, + "response", respDump, + } + + logger.Ctx(ctx).Debugw("2xx graph api resp", metadata...) + } + + return resp, err + } + + if logger.DebugAPI || os.Getenv(logGraphRequestsEnvKey) != "" { + respDump, _ := httputil.DumpResponse(resp, true) + + metadata := []any{ + "idx", middlewareIndex, + "method", req.Method, + "status", resp.Status, + "statusCode", resp.StatusCode, + "requestLen", req.ContentLength, + "url", req.URL, + "response", string(respDump), + } + + logger.Ctx(ctx).Errorw("non-2xx graph api response", metadata...) + } else { + // special case for supportability: log all throttling cases. + if resp.StatusCode == http.StatusTooManyRequests { + logger.Ctx(ctx).Infow("graph api throttling", "method", req.Method, "url", req.URL) + } + + if resp.StatusCode != http.StatusTooManyRequests && (resp.StatusCode/100) != 2 { + logger.Ctx(ctx).Infow("graph api error", "status", resp.Status, "method", req.Method, "url", req.URL) + } + } + + return resp, err +} diff --git a/src/internal/connector/graph/service_helper.go b/src/internal/connector/graph/service_helper.go deleted file mode 100644 index bf39fe194..000000000 --- a/src/internal/connector/graph/service_helper.go +++ /dev/null @@ -1,142 +0,0 @@ -package graph - -import ( - "net/http" - "net/http/httputil" - "os" - "time" - - az "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - ka "github.com/microsoft/kiota-authentication-azure-go" - khttp "github.com/microsoft/kiota-http-go" - msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" - msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core" - "github.com/pkg/errors" - - "github.com/alcionai/corso/src/pkg/logger" -) - -const ( - logGraphRequestsEnvKey = "LOG_GRAPH_REQUESTS" -) - -// CreateAdapter uses provided credentials to log into M365 using Kiota Azure Library -// with Azure identity package. An adapter object is a necessary to component -// to create *msgraphsdk.GraphServiceClient -func CreateAdapter(tenant, client, secret string) (*msgraphsdk.GraphRequestAdapter, error) { - // Client Provider: Uses Secret for access to tenant-level data - cred, err := az.NewClientSecretCredential(tenant, client, secret, nil) - if err != nil { - return nil, errors.Wrap(err, "creating m365 client secret credentials") - } - - auth, err := ka.NewAzureIdentityAuthenticationProviderWithScopes( - cred, - []string{"https://graph.microsoft.com/.default"}, - ) - if err != nil { - return nil, errors.Wrap(err, "creating new AzureIdentityAuthentication") - } - - httpClient := CreateHTTPClient() - - return msgraphsdk.NewGraphRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient( - auth, nil, nil, httpClient) -} - -// CreateHTTPClient creates the httpClient with middlewares and timeout configured -func CreateHTTPClient() *http.Client { - clientOptions := msgraphsdk.GetDefaultClientOptions() - middlewares := msgraphgocore.GetDefaultMiddlewaresWithOptions(&clientOptions) - middlewares = append(middlewares, &LoggingMiddleware{}) - httpClient := msgraphgocore.GetDefaultClient(&clientOptions, middlewares...) - httpClient.Timeout = time.Second * 90 - - return httpClient -} - -// LargeItemClient generates a client that's configured to handle -// large file downloads. This client isn't suitable for other queries -// due to loose restrictions on timeouts and such. -// -// Re-use of http clients is critical, or else we leak os resources -// and consume relatively unbound socket connections. It is important -// to centralize this client to be passed downstream where api calls -// can utilize it on a per-download basis. -// -// TODO: this should get owned by an API client layer, not the GC itself. -func LargeItemClient() *http.Client { - httpClient := CreateHTTPClient() - httpClient.Timeout = 0 // infinite timeout for pulling large files - - return httpClient -} - -// --------------------------------------------------------------------------- -// Logging Middleware -// --------------------------------------------------------------------------- - -// LoggingMiddleware can be used to log the http request sent by the graph client -type LoggingMiddleware struct{} - -func (handler *LoggingMiddleware) Intercept( - pipeline khttp.Pipeline, - middlewareIndex int, - req *http.Request, -) (*http.Response, error) { - var ( - ctx = req.Context() - resp, err = pipeline.Next(req, middlewareIndex) - ) - - if resp == nil { - return resp, err - } - - if (resp.StatusCode / 100) == 2 { - if logger.DebugAPI || os.Getenv(logGraphRequestsEnvKey) != "" { - respDump, _ := httputil.DumpResponse(resp, false) - - metadata := []any{ - "idx", middlewareIndex, - "method", req.Method, - "status", resp.Status, - "statusCode", resp.StatusCode, - "requestLen", req.ContentLength, - "url", req.URL, - "response", respDump, - } - - logger.Ctx(ctx).Debugw("2xx graph api resp", metadata...) - } - - return resp, err - } - - if logger.DebugAPI || os.Getenv(logGraphRequestsEnvKey) != "" { - respDump, _ := httputil.DumpResponse(resp, true) - - metadata := []any{ - "idx", middlewareIndex, - "method", req.Method, - "status", resp.Status, - "statusCode", resp.StatusCode, - "requestLen", req.ContentLength, - "url", req.URL, - "response", string(respDump), - } - - logger.Ctx(ctx).Errorw("non-2xx graph api response", metadata...) - } else { - // special case for supportability: log all throttling cases. - if resp.StatusCode == http.StatusTooManyRequests { - logger.Ctx(ctx).Infow("graph api throttling", "method", req.Method, "url", req.URL) - } - - if resp.StatusCode != http.StatusTooManyRequests && (resp.StatusCode/100) != 2 { - logger.Ctx(ctx).Infow("graph api error", "status", resp.Status, "method", req.Method, "url", req.URL) - } - } - - return resp, err -} diff --git a/src/internal/connector/graph/service_test.go b/src/internal/connector/graph/service_test.go index ee8c6bc29..14bdc9c36 100644 --- a/src/internal/connector/graph/service_test.go +++ b/src/internal/connector/graph/service_test.go @@ -1,14 +1,15 @@ -package graph_test +package graph import ( + "net/http" "testing" + "time" "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/account" ) @@ -33,26 +34,54 @@ func (suite *GraphUnitSuite) SetupSuite() { func (suite *GraphUnitSuite) TestCreateAdapter() { t := suite.T() - adpt, err := graph.CreateAdapter( + adpt, err := CreateAdapter( suite.credentials.AzureTenantID, suite.credentials.AzureClientID, - suite.credentials.AzureClientSecret, - ) + suite.credentials.AzureClientSecret) assert.NoError(t, err) assert.NotNil(t, adpt) } +func (suite *GraphUnitSuite) TestHTTPClient() { + table := []struct { + name string + opts []option + check func(*testing.T, *http.Client) + }{ + { + name: "no options", + opts: []option{}, + check: func(t *testing.T, c *http.Client) { + assert.Equal(t, 90*time.Second, c.Timeout, "default timeout") + }, + }, + { + name: "no timeout", + opts: []option{NoTimeout()}, + check: func(t *testing.T, c *http.Client) { + assert.Equal(t, 0, int(c.Timeout), "unlimited timeout") + }, + }, + } + for _, test := range table { + suite.T().Run(test.name, func(t *testing.T) { + cli := HTTPClient(test.opts...) + assert.NotNil(t, cli) + test.check(t, cli) + }) + } +} + func (suite *GraphUnitSuite) TestSerializationEndPoint() { t := suite.T() - adpt, err := graph.CreateAdapter( + adpt, err := CreateAdapter( suite.credentials.AzureTenantID, suite.credentials.AzureClientID, - suite.credentials.AzureClientSecret, - ) + suite.credentials.AzureClientSecret) require.NoError(t, err) - serv := graph.NewService(adpt) + serv := NewService(adpt) email := models.NewMessage() subject := "TestSerializationEndPoint" email.SetSubject(&subject) diff --git a/src/internal/connector/graph_connector_disconnected_test.go b/src/internal/connector/graph_connector_disconnected_test.go index 711e55ff8..2f17ae026 100644 --- a/src/internal/connector/graph_connector_disconnected_test.go +++ b/src/internal/connector/graph_connector_disconnected_test.go @@ -66,7 +66,7 @@ func (suite *DisconnectedGraphConnectorSuite) TestBadConnection() { for _, test := range table { suite.T().Run(test.name, func(t *testing.T) { - gc, err := NewGraphConnector(ctx, graph.LargeItemClient(), test.acct(t), Users) + gc, err := NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), test.acct(t), Users) assert.Nil(t, gc, test.name+" failed") assert.NotNil(t, err, test.name+"failed") }) diff --git a/src/internal/connector/graph_connector_test.go b/src/internal/connector/graph_connector_test.go index 85ad3f45f..af4ae0824 100644 --- a/src/internal/connector/graph_connector_test.go +++ b/src/internal/connector/graph_connector_test.go @@ -156,7 +156,7 @@ func (suite *GraphConnectorIntegrationSuite) SetupSuite() { tester.MustGetEnvSets(suite.T(), tester.M365AcctCredEnvs) - suite.connector = loadConnector(ctx, suite.T(), graph.LargeItemClient(), Users) + suite.connector = loadConnector(ctx, suite.T(), graph.HTTPClient(graph.NoTimeout()), Users) suite.user = tester.M365UserID(suite.T()) suite.acct = tester.NewM365Account(suite.T()) @@ -380,7 +380,7 @@ func runRestoreBackupTest( start := time.Now() - restoreGC := loadConnector(ctx, t, graph.LargeItemClient(), test.resource) + restoreGC := loadConnector(ctx, t, graph.HTTPClient(graph.NoTimeout()), test.resource) restoreSel := getSelectorWith(t, test.service, resourceOwners, true) deets, err := restoreGC.RestoreDataCollections( ctx, @@ -419,7 +419,7 @@ func runRestoreBackupTest( }) } - backupGC := loadConnector(ctx, t, graph.LargeItemClient(), test.resource) + backupGC := loadConnector(ctx, t, graph.HTTPClient(graph.NoTimeout()), test.resource) backupSel := backupSelectorForExpected(t, test.service, expectedDests) t.Logf("Selective backup of %s\n", backupSel) @@ -870,7 +870,7 @@ func (suite *GraphConnectorIntegrationSuite) TestMultiFolderBackupDifferentNames dest.ContainerName, ) - restoreGC := loadConnector(ctx, t, graph.LargeItemClient(), test.resource) + restoreGC := loadConnector(ctx, t, graph.HTTPClient(graph.NoTimeout()), test.resource) deets, err := restoreGC.RestoreDataCollections(ctx, suite.acct, restoreSel, dest, collections) require.NoError(t, err) require.NotNil(t, deets) @@ -888,7 +888,7 @@ func (suite *GraphConnectorIntegrationSuite) TestMultiFolderBackupDifferentNames // Run a backup and compare its output with what we put in. - backupGC := loadConnector(ctx, t, graph.LargeItemClient(), test.resource) + backupGC := loadConnector(ctx, t, graph.HTTPClient(graph.NoTimeout()), test.resource) backupSel := backupSelectorForExpected(t, test.service, expectedDests) t.Log("Selective backup of", backupSel) diff --git a/src/internal/connector/onedrive/collection_test.go b/src/internal/connector/onedrive/collection_test.go index 6267ff017..b608e9068 100644 --- a/src/internal/connector/onedrive/collection_test.go +++ b/src/internal/connector/onedrive/collection_test.go @@ -151,7 +151,7 @@ func (suite *CollectionUnitTestSuite) TestCollection() { require.NoError(t, err) coll := NewCollection( - graph.LargeItemClient(), + graph.HTTPClient(graph.NoTimeout()), folderPath, "drive-id", suite, @@ -245,7 +245,7 @@ func (suite *CollectionUnitTestSuite) TestCollectionReadError() { require.NoError(t, err) coll := NewCollection( - graph.LargeItemClient(), + graph.HTTPClient(graph.NoTimeout()), folderPath, "fakeDriveID", suite, diff --git a/src/internal/connector/onedrive/collections_test.go b/src/internal/connector/onedrive/collections_test.go index 21ca061a9..b69253918 100644 --- a/src/internal/connector/onedrive/collections_test.go +++ b/src/internal/connector/onedrive/collections_test.go @@ -588,7 +588,7 @@ func (suite *OneDriveCollectionsSuite) TestUpdateCollections() { outputFolderMap := map[string]string{} maps.Copy(outputFolderMap, tt.inputFolderMap) c := NewCollections( - graph.LargeItemClient(), + graph.HTTPClient(graph.NoTimeout()), tenant, user, OneDriveSource, diff --git a/src/internal/connector/onedrive/drive_test.go b/src/internal/connector/onedrive/drive_test.go index 755b7293b..631381240 100644 --- a/src/internal/connector/onedrive/drive_test.go +++ b/src/internal/connector/onedrive/drive_test.go @@ -147,7 +147,7 @@ func (suite *OneDriveSuite) TestOneDriveNewCollections() { NewOneDriveBackup([]string{test.user}). AllData()[0] odcs, err := NewCollections( - graph.LargeItemClient(), + graph.HTTPClient(graph.NoTimeout()), creds.AzureTenantID, test.user, OneDriveSource, diff --git a/src/internal/connector/onedrive/item_test.go b/src/internal/connector/onedrive/item_test.go index 2b28f0910..5364d543c 100644 --- a/src/internal/connector/onedrive/item_test.go +++ b/src/internal/connector/onedrive/item_test.go @@ -126,7 +126,7 @@ func (suite *ItemIntegrationSuite) TestItemReader_oneDrive() { // Read data for the file - itemInfo, itemData, err := oneDriveItemReader(graph.LargeItemClient(), driveItem) + itemInfo, itemData, err := oneDriveItemReader(graph.HTTPClient(graph.NoTimeout()), driveItem) require.NoError(suite.T(), err) require.NotNil(suite.T(), itemInfo.OneDrive) require.NotEmpty(suite.T(), itemInfo.OneDrive.ItemName) diff --git a/src/internal/connector/sharepoint/data_collections_test.go b/src/internal/connector/sharepoint/data_collections_test.go index 4daca0877..87aaa5c84 100644 --- a/src/internal/connector/sharepoint/data_collections_test.go +++ b/src/internal/connector/sharepoint/data_collections_test.go @@ -92,7 +92,7 @@ func (suite *SharePointLibrariesSuite) TestUpdateCollections() { newPaths := map[string]string{} excluded := map[string]struct{}{} c := onedrive.NewCollections( - graph.LargeItemClient(), + graph.HTTPClient(graph.NoTimeout()), tenant, site, onedrive.SharePointSource, diff --git a/src/internal/operations/backup_integration_test.go b/src/internal/operations/backup_integration_test.go index 83748baa2..f6e63b022 100644 --- a/src/internal/operations/backup_integration_test.go +++ b/src/internal/operations/backup_integration_test.go @@ -655,7 +655,7 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchangeIncrementals() { m365, err := acct.M365Config() require.NoError(t, err) - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), acct, connector.Users) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), acct, connector.Users) require.NoError(t, err) ac, err := api.NewClient(m365) diff --git a/src/internal/operations/operation.go b/src/internal/operations/operation.go index c910712fb..24391997e 100644 --- a/src/internal/operations/operation.go +++ b/src/internal/operations/operation.go @@ -108,7 +108,7 @@ func connectToM365( resource = connector.Sites } - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), acct, resource) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), acct, resource) if err != nil { return nil, err } diff --git a/src/pkg/services/m365/m365.go b/src/pkg/services/m365/m365.go index e0dd75af9..984326b6d 100644 --- a/src/pkg/services/m365/m365.go +++ b/src/pkg/services/m365/m365.go @@ -21,7 +21,7 @@ type User struct { // Users returns a list of users in the specified M365 tenant // TODO: Implement paging support func Users(ctx context.Context, m365Account account.Account) ([]*User, error) { - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), m365Account, connector.Users) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), m365Account, connector.Users) if err != nil { return nil, errors.Wrap(err, "could not initialize M365 graph connection") } @@ -77,7 +77,7 @@ func UserPNs(ctx context.Context, m365Account account.Account) ([]string, error) // SiteURLs returns a list of SharePoint site WebURLs in the specified M365 tenant func SiteURLs(ctx context.Context, m365Account account.Account) ([]string, error) { - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), m365Account, connector.Sites) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), m365Account, connector.Sites) if err != nil { return nil, errors.Wrap(err, "could not initialize M365 graph connection") } @@ -87,7 +87,7 @@ func SiteURLs(ctx context.Context, m365Account account.Account) ([]string, error // SiteURLs returns a list of SharePoint sites IDs in the specified M365 tenant func SiteIDs(ctx context.Context, m365Account account.Account) ([]string, error) { - gc, err := connector.NewGraphConnector(ctx, graph.LargeItemClient(), m365Account, connector.Sites) + gc, err := connector.NewGraphConnector(ctx, graph.HTTPClient(graph.NoTimeout()), m365Account, connector.Sites) if err != nil { return nil, errors.Wrap(err, "could not initialize M365 graph connection") } From 09821f2f0d21cd382fa38af9c725b1ebc0954e01 Mon Sep 17 00:00:00 2001 From: Vaibhav Kamra Date: Fri, 27 Jan 2023 12:03:13 -0800 Subject: [PATCH 11/36] Hide sharepoint details command (#2304) ## Description Sharepoint support is still under active development and not ready for use. Hiding the command from usage details. ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [x] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/cli/backup/sharepoint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/backup/sharepoint.go b/src/cli/backup/sharepoint.go index 9fa8afb6b..26d819b27 100644 --- a/src/cli/backup/sharepoint.go +++ b/src/cli/backup/sharepoint.go @@ -108,7 +108,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command { "ID of the backup to retrieve.") case detailsCommand: - c, fs = utils.AddCommand(cmd, sharePointDetailsCmd()) + c, fs = utils.AddCommand(cmd, sharePointDetailsCmd(), utils.HideCommand()) c.Use = c.Use + " " + sharePointServiceCommandDetailsUseSuffix c.Example = sharePointServiceCommandDetailsExamples From 3e106dbac8d735fd031afdce8d3f9d6636a9752b Mon Sep 17 00:00:00 2001 From: Georgi Matev Date: Fri, 27 Jan 2023 12:47:15 -0800 Subject: [PATCH 12/36] Warning in the help messages for pre-release hidden commands (#2307) ## Description A basic mechanism to show a warning for the help output of pre-release commands ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No ## Type of change - [x] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Issue(s) ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/cli/backup/sharepoint.go | 8 ++++---- src/cli/restore/sharepoint.go | 2 +- src/cli/utils/utils.go | 18 +++++++++++++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/cli/backup/sharepoint.go b/src/cli/backup/sharepoint.go index 26d819b27..45d885b80 100644 --- a/src/cli/backup/sharepoint.go +++ b/src/cli/backup/sharepoint.go @@ -81,7 +81,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command { switch cmd.Use { case createCommand: - c, fs = utils.AddCommand(cmd, sharePointCreateCmd(), utils.HideCommand()) + c, fs = utils.AddCommand(cmd, sharePointCreateCmd(), utils.MarkPreReleaseCommand()) c.Use = c.Use + " " + sharePointServiceCommandCreateUseSuffix c.Example = sharePointServiceCommandCreateExamples @@ -101,14 +101,14 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command { options.AddOperationFlags(c) case listCommand: - c, fs = utils.AddCommand(cmd, sharePointListCmd(), utils.HideCommand()) + c, fs = utils.AddCommand(cmd, sharePointListCmd(), utils.MarkPreReleaseCommand()) fs.StringVar(&backupID, utils.BackupFN, "", "ID of the backup to retrieve.") case detailsCommand: - c, fs = utils.AddCommand(cmd, sharePointDetailsCmd(), utils.HideCommand()) + c, fs = utils.AddCommand(cmd, sharePointDetailsCmd(), utils.MarkPreReleaseCommand()) c.Use = c.Use + " " + sharePointServiceCommandDetailsUseSuffix c.Example = sharePointServiceCommandDetailsExamples @@ -157,7 +157,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command { // "Select backup details for items created after this datetime.") case deleteCommand: - c, fs = utils.AddCommand(cmd, sharePointDeleteCmd(), utils.HideCommand()) + c, fs = utils.AddCommand(cmd, sharePointDeleteCmd(), utils.MarkPreReleaseCommand()) c.Use = c.Use + " " + sharePointServiceCommandDeleteUseSuffix c.Example = sharePointServiceCommandDeleteExamples diff --git a/src/cli/restore/sharepoint.go b/src/cli/restore/sharepoint.go index 1c3a81e89..13414f6b6 100644 --- a/src/cli/restore/sharepoint.go +++ b/src/cli/restore/sharepoint.go @@ -33,7 +33,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command { switch cmd.Use { case restoreCommand: - c, fs = utils.AddCommand(cmd, sharePointRestoreCmd(), utils.HideCommand()) + c, fs = utils.AddCommand(cmd, sharePointRestoreCmd(), utils.MarkPreReleaseCommand()) c.Use = c.Use + " " + sharePointServiceCommandUseSuffix diff --git a/src/cli/utils/utils.go b/src/cli/utils/utils.go index 0dc43d079..029f9b2bf 100644 --- a/src/cli/utils/utils.go +++ b/src/cli/utils/utils.go @@ -59,7 +59,8 @@ func HasNoFlagsAndShownHelp(cmd *cobra.Command) bool { } type cmdCfg struct { - hidden bool + hidden bool + preRelese bool } type cmdOpt func(*cmdCfg) @@ -76,6 +77,13 @@ func HideCommand() cmdOpt { } } +func MarkPreReleaseCommand() cmdOpt { + return func(cc *cmdCfg) { + cc.hidden = true + cc.preRelese = true + } +} + // AddCommand adds a clone of the subCommand to the parent, // and returns both the clone and its pflags. func AddCommand(parent, c *cobra.Command, opts ...cmdOpt) (*cobra.Command, *pflag.FlagSet) { @@ -85,6 +93,14 @@ func AddCommand(parent, c *cobra.Command, opts ...cmdOpt) (*cobra.Command, *pfla parent.AddCommand(c) c.Hidden = cc.hidden + if cc.preRelese { + // There is a default deprecated message that always shows so we do some terminal magic to overwrite it + c.Deprecated = "\n\033[1F\033[K" + + "==================================================================================================\n" + + "\tWARNING!!! THIS IS A PRE-RELEASE COMMAND THAT MAY NOT FUNCTION PROPERLY, OR AT ALL\n" + + "==================================================================================================\n" + } + c.Flags().SortFlags = false return c, c.Flags() From 0d8eb8f4fa157f9037d6975d8ca9562a6b2ee161 Mon Sep 17 00:00:00 2001 From: Keepers Date: Fri, 27 Jan 2023 15:25:39 -0700 Subject: [PATCH 13/36] refactor exchange attachment downloads (#2302) ## Description Three changes: adds a LargeItem servicer to the exchange api client. Migrates attachment downloads in mail and events out of serialize and into the GetItem func. Finally, utilizes the largeItem servicer to download attachments, instead of the standard servicer. A follow-up PR will add mocked test cases for these changes. ## Does this PR need a docs update or release note? - [x] :white_check_mark: Yes, it's included ## Type of change - [x] :sunflower: Feature ## Issue(s) * #2299 ## Test Plan - [x] :green_heart: E2E --- CHANGELOG.md | 3 +- src/internal/connector/exchange/api/api.go | 48 ++++++++++++++-- .../connector/exchange/api/api_test.go | 57 +++++++++++++++++++ src/internal/connector/exchange/api/events.go | 57 +++++++++---------- src/internal/connector/exchange/api/mail.go | 56 +++++++++--------- src/internal/connector/graph/service.go | 6 ++ src/internal/connector/support/m365Support.go | 13 ----- .../connector/support/m365Support_test.go | 54 ------------------ 8 files changed, 163 insertions(+), 131 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d8cdfee0..8f1eb0fd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Inline attachments (e.g. copy/paste ) are discovered and backed up correctly ([#2163](https://github.com/alcionai/corso/issues/2163)) - Guest and External users (for cloud accounts) and non-on-premise users (for systems that use on-prem AD syncs) are now excluded from backup and restore operations. - Remove the M365 license guid check in OneDrive backup which wasn't reliable. - +- Reduced extra socket consumption while downloading multiple drive files. +- Extended timeout boundaries for exchange attachment downloads, reducing risk of cancellation on large files. ## [v0.1.0] (alpha) - 2023-01-13 diff --git a/src/internal/connector/exchange/api/api.go b/src/internal/connector/exchange/api/api.go index 6edd68f57..c4858c5c1 100644 --- a/src/internal/connector/exchange/api/api.go +++ b/src/internal/connector/exchange/api/api.go @@ -2,9 +2,11 @@ package api import ( "context" + "strings" "time" "github.com/microsoft/kiota-abstractions-go/serialization" + "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/pkg/errors" "github.com/alcionai/corso/src/internal/connector/graph" @@ -57,6 +59,11 @@ type Client struct { // The stable service is re-usable for any non-paged request. // This allows us to maintain performance across async requests. stable graph.Servicer + + // The largeItem graph servicer is configured specifically for + // downloading large items. Specifically for use when handling + // attachments, and for no other use. + largeItem graph.Servicer } // NewClient produces a new exchange api client. Must be used in @@ -67,27 +74,45 @@ func NewClient(creds account.M365Config) (Client, error) { return Client{}, err } - return Client{creds, s}, nil + li, err := newLargeItemService(creds) + if err != nil { + return Client{}, err + } + + return Client{creds, s, li}, nil } // service generates a new service. Used for paged and other long-running // requests instead of the client's stable service, so that in-flight state // within the adapter doesn't get clobbered func (c Client) service() (*graph.Service, error) { - return newService(c.Credentials) + s, err := newService(c.Credentials) + return s, err } func newService(creds account.M365Config) (*graph.Service, error) { - adapter, err := graph.CreateAdapter( + a, err := graph.CreateAdapter( + creds.AzureTenantID, + creds.AzureClientID, + creds.AzureClientSecret) + if err != nil { + return nil, errors.Wrap(err, "generating no-timeout graph adapter") + } + + return graph.NewService(a), nil +} + +func newLargeItemService(creds account.M365Config) (*graph.Service, error) { + a, err := graph.CreateAdapter( creds.AzureTenantID, creds.AzureClientID, creds.AzureClientSecret, - ) + graph.NoTimeout()) if err != nil { - return nil, errors.Wrap(err, "generating graph api service client") + return nil, errors.Wrap(err, "generating no-timeout graph adapter") } - return graph.NewService(adapter), nil + return graph.NewService(a), nil } // --------------------------------------------------------------------------- @@ -117,3 +142,14 @@ func orNow(t *time.Time) time.Time { return *t } + +func HasAttachments(body models.ItemBodyable) bool { + if body.GetContent() == nil || body.GetContentType() == nil || + *body.GetContentType() == models.TEXT_BODYTYPE || len(*body.GetContent()) == 0 { + return false + } + + content := *body.GetContent() + + return strings.Contains(content, "src=\"cid:") +} diff --git a/src/internal/connector/exchange/api/api_test.go b/src/internal/connector/exchange/api/api_test.go index d3fe51350..4fe842452 100644 --- a/src/internal/connector/exchange/api/api_test.go +++ b/src/internal/connector/exchange/api/api_test.go @@ -3,11 +3,14 @@ package api import ( "testing" + "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/mockconnector" + "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/account" ) @@ -190,3 +193,57 @@ func (suite *ExchangeServiceSuite) TestGraphQueryFunctions() { }) } } + +//nolint:lll +var stubHTMLContent = "\r\n
Happy New Year,

In accordance with TPS report guidelines, there have been questions about how to address our activities SharePoint Cover page. Do you believe this is the best picture? 



Let me know if this meets our culture requirements.

Warm Regards,

Dustin
" + +func (suite *ExchangeServiceSuite) TestHasAttachments() { + tests := []struct { + name string + hasAttachment assert.BoolAssertionFunc + getBodyable func(t *testing.T) models.ItemBodyable + }{ + { + name: "Mock w/out attachment", + hasAttachment: assert.False, + getBodyable: func(t *testing.T) models.ItemBodyable { + byteArray := mockconnector.GetMockMessageWithBodyBytes( + "Test", + "This is testing", + "This is testing", + ) + message, err := support.CreateMessageFromBytes(byteArray) + require.NoError(t, err) + return message.GetBody() + }, + }, + { + name: "Mock w/ inline attachment", + hasAttachment: assert.True, + getBodyable: func(t *testing.T) models.ItemBodyable { + byteArray := mockconnector.GetMessageWithOneDriveAttachment("Test legacy") + message, err := support.CreateMessageFromBytes(byteArray) + require.NoError(t, err) + return message.GetBody() + }, + }, + { + name: "Edge Case", + hasAttachment: assert.True, + getBodyable: func(t *testing.T) models.ItemBodyable { + body := models.NewItemBody() + body.SetContent(&stubHTMLContent) + cat := models.HTML_BODYTYPE + body.SetContentType(&cat) + return body + }, + }, + } + + for _, test := range tests { + suite.T().Run(test.name, func(t *testing.T) { + found := HasAttachments(test.getBodyable(t)) + test.hasAttachment(t, found) + }) + } +} diff --git a/src/internal/connector/exchange/api/events.go b/src/internal/connector/exchange/api/events.go index cdb74ad19..cd968056d 100644 --- a/src/internal/connector/exchange/api/events.go +++ b/src/internal/connector/exchange/api/events.go @@ -85,12 +85,37 @@ func (c Events) GetItem( ctx context.Context, user, itemID string, ) (serialization.Parsable, *details.ExchangeInfo, error) { - evt, err := c.stable.Client().UsersById(user).EventsById(itemID).Get(ctx, nil) + event, err := c.stable.Client().UsersById(user).EventsById(itemID).Get(ctx, nil) if err != nil { return nil, nil, err } - return evt, EventInfo(evt), nil + var errs *multierror.Error + + if *event.GetHasAttachments() || HasAttachments(event.GetBody()) { + for count := 0; count < numberOfRetries; count++ { + attached, err := c.largeItem. + Client(). + UsersById(user). + EventsById(itemID). + Attachments(). + Get(ctx, nil) + if err == nil { + event.SetAttachments(attached.GetValue()) + break + } + + logger.Ctx(ctx).Debugw("retrying event attachment download", "err", err) + errs = multierror.Append(errs, err) + } + + if err != nil { + logger.Ctx(ctx).Errorw("event attachment download exceeded maximum retries", "err", errs) + return nil, nil, support.WrapAndAppend(itemID, errors.Wrap(err, "download event attachment"), nil) + } + } + + return event, EventInfo(event), nil } func (c Client) GetAllCalendarNamesForUser( @@ -249,8 +274,7 @@ func (c Events) GetAddedAndRemovedItemIDs( // Serialization // --------------------------------------------------------------------------- -// Serialize retrieves attachment data identified by the event item, and then -// serializes it into a byte slice. +// Serialize transforms the event into a byte slice. func (c Events) Serialize( ctx context.Context, item serialization.Parsable, @@ -268,31 +292,6 @@ func (c Events) Serialize( defer writer.Close() - if *event.GetHasAttachments() || support.HasAttachments(event.GetBody()) { - // getting all the attachments might take a couple attempts due to filesize - var retriesErr error - - for count := 0; count < numberOfRetries; count++ { - attached, err := c.stable. - Client(). - UsersById(user). - EventsById(itemID). - Attachments(). - Get(ctx, nil) - retriesErr = err - - if err == nil { - event.SetAttachments(attached.GetValue()) - break - } - } - - if retriesErr != nil { - logger.Ctx(ctx).Debug("exceeded maximum retries") - return nil, support.WrapAndAppend(itemID, errors.Wrap(retriesErr, "attachment failed"), nil) - } - } - if err = writer.WriteObjectValue("", event); err != nil { return nil, support.SetNonRecoverableError(errors.Wrap(err, itemID)) } diff --git a/src/internal/connector/exchange/api/mail.go b/src/internal/connector/exchange/api/mail.go index f29d64bd8..f4d2d2e33 100644 --- a/src/internal/connector/exchange/api/mail.go +++ b/src/internal/connector/exchange/api/mail.go @@ -97,7 +97,8 @@ func (c Mail) GetContainerByID( return service.Client().UsersById(userID).MailFoldersById(dirID).Get(ctx, ofmf) } -// GetItem retrieves a Messageable item. +// GetItem retrieves a Messageable item. If the item contains an attachment, that +// attachment is also downloaded. func (c Mail) GetItem( ctx context.Context, user, itemID string, @@ -107,6 +108,31 @@ func (c Mail) GetItem( return nil, nil, err } + var errs *multierror.Error + + if *mail.GetHasAttachments() || HasAttachments(mail.GetBody()) { + for count := 0; count < numberOfRetries; count++ { + attached, err := c.largeItem. + Client(). + UsersById(user). + MessagesById(itemID). + Attachments(). + Get(ctx, nil) + if err == nil { + mail.SetAttachments(attached.GetValue()) + break + } + + logger.Ctx(ctx).Debugw("retrying mail attachment download", "err", err) + errs = multierror.Append(errs, err) + } + + if err != nil { + logger.Ctx(ctx).Errorw("mail attachment download exceeded maximum retries", "err", errs) + return nil, nil, support.WrapAndAppend(itemID, errors.Wrap(err, "downloading mail attachment"), nil) + } + } + return mail, MailInfo(mail), nil } @@ -238,8 +264,7 @@ func (c Mail) GetAddedAndRemovedItemIDs( // Serialization // --------------------------------------------------------------------------- -// Serialize retrieves attachment data identified by the mail item, and then -// serializes it into a byte slice. +// Serialize transforms the mail item into a byte slice. func (c Mail) Serialize( ctx context.Context, item serialization.Parsable, @@ -257,31 +282,6 @@ func (c Mail) Serialize( defer writer.Close() - if *msg.GetHasAttachments() || support.HasAttachments(msg.GetBody()) { - // getting all the attachments might take a couple attempts due to filesize - var retriesErr error - - for count := 0; count < numberOfRetries; count++ { - attached, err := c.stable. - Client(). - UsersById(user). - MessagesById(itemID). - Attachments(). - Get(ctx, nil) - retriesErr = err - - if err == nil { - msg.SetAttachments(attached.GetValue()) - break - } - } - - if retriesErr != nil { - logger.Ctx(ctx).Debug("exceeded maximum retries") - return nil, support.WrapAndAppend(itemID, errors.Wrap(retriesErr, "attachment failed"), nil) - } - } - if err = writer.WriteObjectValue("", msg); err != nil { return nil, support.SetNonRecoverableError(errors.Wrap(err, itemID)) } diff --git a/src/internal/connector/graph/service.go b/src/internal/connector/graph/service.go index fa4662014..6c0e6dbc1 100644 --- a/src/internal/connector/graph/service.go +++ b/src/internal/connector/graph/service.go @@ -243,6 +243,8 @@ func (handler *LoggingMiddleware) Intercept( return resp, err } + // Return immediately if the response is good (2xx). + // If api logging is toggled, log a body-less dump of the request/resp. if (resp.StatusCode / 100) == 2 { if logger.DebugAPI || os.Getenv(logGraphRequestsEnvKey) != "" { respDump, _ := httputil.DumpResponse(resp, false) @@ -263,6 +265,10 @@ func (handler *LoggingMiddleware) Intercept( return resp, err } + // Log errors according to api debugging configurations. + // When debugging is toggled, every non-2xx is recorded with a respose dump. + // Otherwise, throttling cases and other non-2xx responses are logged + // with a slimmer reference for telemetry/supportability purposes. if logger.DebugAPI || os.Getenv(logGraphRequestsEnvKey) != "" { respDump, _ := httputil.DumpResponse(resp, true) diff --git a/src/internal/connector/support/m365Support.go b/src/internal/connector/support/m365Support.go index 99cb95577..d7e51e513 100644 --- a/src/internal/connector/support/m365Support.go +++ b/src/internal/connector/support/m365Support.go @@ -1,8 +1,6 @@ package support import ( - "strings" - absser "github.com/microsoft/kiota-abstractions-go/serialization" js "github.com/microsoft/kiota-serialization-json-go" "github.com/microsoftgraph/msgraph-sdk-go/models" @@ -73,14 +71,3 @@ func CreateListFromBytes(bytes []byte) (models.Listable, error) { return list, nil } - -func HasAttachments(body models.ItemBodyable) bool { - if body.GetContent() == nil || body.GetContentType() == nil || - *body.GetContentType() == models.TEXT_BODYTYPE || len(*body.GetContent()) == 0 { - return false - } - - content := *body.GetContent() - - return strings.Contains(content, "src=\"cid:") -} diff --git a/src/internal/connector/support/m365Support_test.go b/src/internal/connector/support/m365Support_test.go index dedde3536..c04c74604 100644 --- a/src/internal/connector/support/m365Support_test.go +++ b/src/internal/connector/support/m365Support_test.go @@ -3,7 +3,6 @@ package support import ( "testing" - "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -160,56 +159,3 @@ func (suite *DataSupportSuite) TestCreateListFromBytes() { }) } } - -func (suite *DataSupportSuite) TestHasAttachments() { - tests := []struct { - name string - hasAttachment assert.BoolAssertionFunc - getBodyable func(t *testing.T) models.ItemBodyable - }{ - { - name: "Mock w/out attachment", - hasAttachment: assert.False, - getBodyable: func(t *testing.T) models.ItemBodyable { - byteArray := mockconnector.GetMockMessageWithBodyBytes( - "Test", - "This is testing", - "This is testing", - ) - message, err := CreateMessageFromBytes(byteArray) - require.NoError(t, err) - return message.GetBody() - }, - }, - { - name: "Mock w/ inline attachment", - hasAttachment: assert.True, - getBodyable: func(t *testing.T) models.ItemBodyable { - byteArray := mockconnector.GetMessageWithOneDriveAttachment("Test legacy") - message, err := CreateMessageFromBytes(byteArray) - require.NoError(t, err) - return message.GetBody() - }, - }, - { - name: "Edge Case", - hasAttachment: assert.True, - getBodyable: func(t *testing.T) models.ItemBodyable { - //nolint:lll - content := "\r\n
Happy New Year,

In accordance with TPS report guidelines, there have been questions about how to address our activities SharePoint Cover page. Do you believe this is the best picture? 



Let me know if this meets our culture requirements.

Warm Regards,

Dustin
" - body := models.NewItemBody() - body.SetContent(&content) - cat := models.HTML_BODYTYPE - body.SetContentType(&cat) - return body - }, - }, - } - - for _, test := range tests { - suite.T().Run(test.name, func(t *testing.T) { - found := HasAttachments(test.getBodyable(t)) - test.hasAttachment(t, found) - }) - } -} From 3703d3d9c702a4483b031bbbeb34711ce4e6cedc Mon Sep 17 00:00:00 2001 From: Niraj Tolia Date: Fri, 27 Jan 2023 14:30:06 -0800 Subject: [PATCH 14/36] Upgrade to Docusaurus 2.3.0 (#2303) ## Description Upgrade to Docusaurus 2.3.0 ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :world_map: Documentation ## Test Plan - [x] :muscle: Manual --- website/package-lock.json | 1371 +++++++++++++++++-------------------- website/package.json | 8 +- 2 files changed, 622 insertions(+), 757 deletions(-) diff --git a/website/package-lock.json b/website/package-lock.json index 0662eb756..15757ccf8 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -8,9 +8,9 @@ "name": "docs", "version": "0.1.0", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/plugin-google-gtag": "^2.2.0", - "@docusaurus/preset-classic": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/plugin-google-gtag": "^2.3.0", + "@docusaurus/preset-classic": "2.3.0", "@loadable/component": "^5.15.2", "@mdx-js/react": "^1.6.22", "animate.css": "^4.1.1", @@ -29,7 +29,7 @@ "wow.js": "^1.2.2" }, "devDependencies": { - "@docusaurus/module-type-aliases": "2.2.0", + "@docusaurus/module-type-aliases": "2.3.0", "@iconify/react": "^4.0.1", "autoprefixer": "^10.4.13", "postcss": "^8.4.21", @@ -37,21 +37,19 @@ } }, "node_modules/@algolia/autocomplete-core": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.7.2.tgz", - "integrity": "sha512-eclwUDC6qfApNnEfu1uWcL/rudQsn59tjEoUYZYE2JSXZrHLRjBUGMxiCoknobU2Pva8ejb0eRxpIYDtVVqdsw==", - "license": "MIT", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.7.4.tgz", + "integrity": "sha512-daoLpQ3ps/VTMRZDEBfU8ixXd+amZcNJ4QSP3IERGyzqnL5Ch8uSRFt/4G8pUvW9c3o6GA4vtVv4I4lmnkdXyg==", "dependencies": { - "@algolia/autocomplete-shared": "1.7.2" + "@algolia/autocomplete-shared": "1.7.4" } }, "node_modules/@algolia/autocomplete-preset-algolia": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.7.2.tgz", - "integrity": "sha512-+RYEG6B0QiGGfRb2G3MtPfyrl0dALF3cQNTWBzBX6p5o01vCCGTTinAm2UKG3tfc2CnOMAtnPLkzNZyJUpnVJw==", - "license": "MIT", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.7.4.tgz", + "integrity": "sha512-s37hrvLEIfcmKY8VU9LsAXgm2yfmkdHT3DnA3SgHaY93yjZ2qL57wzb5QweVkYuEBZkT2PIREvRoLXC2sxTbpQ==", "dependencies": { - "@algolia/autocomplete-shared": "1.7.2" + "@algolia/autocomplete-shared": "1.7.4" }, "peerDependencies": { "@algolia/client-search": ">= 4.9.1 < 6", @@ -59,144 +57,128 @@ } }, "node_modules/@algolia/autocomplete-shared": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.7.2.tgz", - "integrity": "sha512-QCckjiC7xXHIUaIL3ektBtjJ0w7tTA3iqKcAE/Hjn1lZ5omp7i3Y4e09rAr9ZybqirL7AbxCLLq0Ra5DDPKeug==", - "license": "MIT" + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.7.4.tgz", + "integrity": "sha512-2VGCk7I9tA9Ge73Km99+Qg87w0wzW4tgUruvWAn/gfey1ZXgmxZtyIRBebk35R1O8TbK77wujVtCnpsGpRy1kg==" }, "node_modules/@algolia/cache-browser-local-storage": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.14.2.tgz", - "integrity": "sha512-FRweBkK/ywO+GKYfAWbrepewQsPTIEirhi1BdykX9mxvBPtGNKccYAxvGdDCumU1jL4r3cayio4psfzKMejBlA==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.14.3.tgz", + "integrity": "sha512-hWH1yCxgG3+R/xZIscmUrWAIBnmBFHH5j30fY/+aPkEZWt90wYILfAHIOZ1/Wxhho5SkPfwFmT7ooX2d9JeQBw==", "dependencies": { - "@algolia/cache-common": "4.14.2" + "@algolia/cache-common": "4.14.3" } }, "node_modules/@algolia/cache-common": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.14.2.tgz", - "integrity": "sha512-SbvAlG9VqNanCErr44q6lEKD2qoK4XtFNx9Qn8FK26ePCI8I9yU7pYB+eM/cZdS9SzQCRJBbHUumVr4bsQ4uxg==", - "license": "MIT" + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.14.3.tgz", + "integrity": "sha512-oZJofOoD9FQOwiGTzyRnmzvh3ZP8WVTNPBLH5xU5JNF7drDbRT0ocVT0h/xB2rPHYzOeXRrLaQQBwRT/CKom0Q==" }, "node_modules/@algolia/cache-in-memory": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.14.2.tgz", - "integrity": "sha512-HrOukWoop9XB/VFojPv1R5SVXowgI56T9pmezd/djh2JnVN/vXswhXV51RKy4nCpqxyHt/aGFSq2qkDvj6KiuQ==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.14.3.tgz", + "integrity": "sha512-ES0hHQnzWjeioLQf5Nq+x1AWdZJ50znNPSH3puB/Y4Xsg4Av1bvLmTJe7SY2uqONaeMTvL0OaVcoVtQgJVw0vg==", "dependencies": { - "@algolia/cache-common": "4.14.2" + "@algolia/cache-common": "4.14.3" } }, "node_modules/@algolia/client-account": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.14.2.tgz", - "integrity": "sha512-WHtriQqGyibbb/Rx71YY43T0cXqyelEU0lB2QMBRXvD2X0iyeGl4qMxocgEIcbHyK7uqE7hKgjT8aBrHqhgc1w==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.14.3.tgz", + "integrity": "sha512-PBcPb0+f5Xbh5UfLZNx2Ow589OdP8WYjB4CnvupfYBrl9JyC1sdH4jcq/ri8osO/mCZYjZrQsKAPIqW/gQmizQ==", "dependencies": { - "@algolia/client-common": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "4.14.3", + "@algolia/client-search": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "node_modules/@algolia/client-analytics": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.14.2.tgz", - "integrity": "sha512-yBvBv2mw+HX5a+aeR0dkvUbFZsiC4FKSnfqk9rrfX+QrlNOKEhCG0tJzjiOggRW4EcNqRmaTULIYvIzQVL2KYQ==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.14.3.tgz", + "integrity": "sha512-eAwQq0Hb/aauv9NhCH5Dp3Nm29oFx28sayFN2fdOWemwSeJHIl7TmcsxVlRsO50fsD8CtPcDhtGeD3AIFLNvqw==", "dependencies": { - "@algolia/client-common": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "4.14.3", + "@algolia/client-search": "4.14.3", + "@algolia/requester-common": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "node_modules/@algolia/client-common": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.14.2.tgz", - "integrity": "sha512-43o4fslNLcktgtDMVaT5XwlzsDPzlqvqesRi4MjQz2x4/Sxm7zYg5LRYFol1BIhG6EwxKvSUq8HcC/KxJu3J0Q==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.14.3.tgz", + "integrity": "sha512-jkPPDZdi63IK64Yg4WccdCsAP4pHxSkr4usplkUZM5C1l1oEpZXsy2c579LQ0rvwCs5JFmwfNG4ahOszidfWPw==", "dependencies": { - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/requester-common": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "node_modules/@algolia/client-personalization": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.14.2.tgz", - "integrity": "sha512-ACCoLi0cL8CBZ1W/2juehSltrw2iqsQBnfiu/Rbl9W2yE6o2ZUb97+sqN/jBqYNQBS+o0ekTMKNkQjHHAcEXNw==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.14.3.tgz", + "integrity": "sha512-UCX1MtkVNgaOL9f0e22x6tC9e2H3unZQlSUdnVaSKpZ+hdSChXGaRjp2UIT7pxmPqNCyv51F597KEX5WT60jNg==", "dependencies": { - "@algolia/client-common": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "4.14.3", + "@algolia/requester-common": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "node_modules/@algolia/client-search": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.14.2.tgz", - "integrity": "sha512-L5zScdOmcZ6NGiVbLKTvP02UbxZ0njd5Vq9nJAmPFtjffUSOGEp11BmD2oMJ5QvARgx2XbX4KzTTNS5ECYIMWw==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.14.3.tgz", + "integrity": "sha512-I2U7xBx5OPFdPLA8AXKUPPxGY3HDxZ4r7+mlZ8ZpLbI8/ri6fnu6B4z3wcL7sgHhDYMwnAE8Xr0AB0h3Hnkp4A==", "dependencies": { - "@algolia/client-common": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "4.14.3", + "@algolia/requester-common": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "node_modules/@algolia/events": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@algolia/events/-/events-4.0.1.tgz", - "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==", - "license": "MIT" + "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==" }, "node_modules/@algolia/logger-common": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.14.2.tgz", - "integrity": "sha512-/JGlYvdV++IcMHBnVFsqEisTiOeEr6cUJtpjz8zc0A9c31JrtLm318Njc72p14Pnkw3A/5lHHh+QxpJ6WFTmsA==", - "license": "MIT" + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.14.3.tgz", + "integrity": "sha512-kUEAZaBt/J3RjYi8MEBT2QEexJR2kAE2mtLmezsmqMQZTV502TkHCxYzTwY2dE7OKcUTxi4OFlMuS4GId9CWPw==" }, "node_modules/@algolia/logger-console": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.14.2.tgz", - "integrity": "sha512-8S2PlpdshbkwlLCSAB5f8c91xyc84VM9Ar9EdfE9UmX+NrKNYnWR1maXXVDQQoto07G1Ol/tYFnFVhUZq0xV/g==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.14.3.tgz", + "integrity": "sha512-ZWqAlUITktiMN2EiFpQIFCJS10N96A++yrexqC2Z+3hgF/JcKrOxOdT4nSCQoEPvU4Ki9QKbpzbebRDemZt/hw==", "dependencies": { - "@algolia/logger-common": "4.14.2" + "@algolia/logger-common": "4.14.3" } }, "node_modules/@algolia/requester-browser-xhr": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.14.2.tgz", - "integrity": "sha512-CEh//xYz/WfxHFh7pcMjQNWgpl4wFB85lUMRyVwaDPibNzQRVcV33YS+63fShFWc2+42YEipFGH2iPzlpszmDw==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.14.3.tgz", + "integrity": "sha512-AZeg2T08WLUPvDncl2XLX2O67W5wIO8MNaT7z5ii5LgBTuk/rU4CikTjCe2xsUleIZeFl++QrPAi4Bdxws6r/Q==", "dependencies": { - "@algolia/requester-common": "4.14.2" + "@algolia/requester-common": "4.14.3" } }, "node_modules/@algolia/requester-common": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.14.2.tgz", - "integrity": "sha512-73YQsBOKa5fvVV3My7iZHu1sUqmjjfs9TteFWwPwDmnad7T0VTCopttcsM3OjLxZFtBnX61Xxl2T2gmG2O4ehg==", - "license": "MIT" + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.14.3.tgz", + "integrity": "sha512-RrRzqNyKFDP7IkTuV3XvYGF9cDPn9h6qEDl595lXva3YUk9YSS8+MGZnnkOMHvjkrSCKfoLeLbm/T4tmoIeclw==" }, "node_modules/@algolia/requester-node-http": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.14.2.tgz", - "integrity": "sha512-oDbb02kd1o5GTEld4pETlPZLY0e+gOSWjWMJHWTgDXbv9rm/o2cF7japO6Vj1ENnrqWvLBmW1OzV9g6FUFhFXg==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.14.3.tgz", + "integrity": "sha512-O5wnPxtDRPuW2U0EaOz9rMMWdlhwP0J0eSL1Z7TtXF8xnUeeUyNJrdhV5uy2CAp6RbhM1VuC3sOJcIR6Av+vbA==", "dependencies": { - "@algolia/requester-common": "4.14.2" + "@algolia/requester-common": "4.14.3" } }, "node_modules/@algolia/transporter": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.14.2.tgz", - "integrity": "sha512-t89dfQb2T9MFQHidjHcfhh6iGMNwvuKUvojAj+JsrHAGbuSy7yE4BylhLX6R0Q1xYRoC4Vvv+O5qIw/LdnQfsQ==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.14.3.tgz", + "integrity": "sha512-2qlKlKsnGJ008exFRb5RTeTOqhLZj0bkMCMVskxoqWejs2Q2QtWmsiH98hDfpw0fmnyhzHEt0Z7lqxBYp8bW2w==", "dependencies": { - "@algolia/cache-common": "4.14.2", - "@algolia/logger-common": "4.14.2", - "@algolia/requester-common": "4.14.2" + "@algolia/cache-common": "4.14.3", + "@algolia/logger-common": "4.14.3", + "@algolia/requester-common": "4.14.3" } }, "node_modules/@ampproject/remapping": { @@ -1974,20 +1956,18 @@ } }, "node_modules/@docsearch/css": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.3.0.tgz", - "integrity": "sha512-rODCdDtGyudLj+Va8b6w6Y85KE85bXRsps/R4Yjwt5vueXKXZQKYw0aA9knxLBT6a/bI/GMrAcmCR75KYOM6hg==", - "license": "MIT" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.3.2.tgz", + "integrity": "sha512-dctFYiwbvDZkksMlsmc7pj6W6By/EjnVXJq5TEPd05MwQe+dcdHJgaIn1c8wfsucxHpIsdrUcgSkACHCq6aIhw==" }, "node_modules/@docsearch/react": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.3.0.tgz", - "integrity": "sha512-fhS5adZkae2SSdMYEMVg6pxI5a/cE+tW16ki1V0/ur4Fdok3hBRkmN/H8VvlXnxzggkQIIRIVvYPn00JPjen3A==", - "license": "MIT", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.3.2.tgz", + "integrity": "sha512-ugILab2TYKSh6IEHf6Z9xZbOovsYbsdfo60PBj+Bw+oMJ1MHJ7pBt1TTcmPki1hSgg8mysgKy2hDiVdPm7XWSQ==", "dependencies": { - "@algolia/autocomplete-core": "1.7.2", - "@algolia/autocomplete-preset-algolia": "1.7.2", - "@docsearch/css": "3.3.0", + "@algolia/autocomplete-core": "1.7.4", + "@algolia/autocomplete-preset-algolia": "1.7.4", + "@docsearch/css": "3.3.2", "algoliasearch": "^4.0.0" }, "peerDependencies": { @@ -2008,10 +1988,9 @@ } }, "node_modules/@docusaurus/core": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-2.2.0.tgz", - "integrity": "sha512-Vd6XOluKQqzG12fEs9prJgDtyn6DPok9vmUWDR2E6/nV5Fl9SVkhEQOBxwObjk3kQh7OY7vguFaLh0jqdApWsA==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-2.3.0.tgz", + "integrity": "sha512-2AU5HfKyExO+/mi41SBnx5uY0aGZFXr3D93wntBY4lN1gsDKUpi7EE4lPBAXm9CoH4Pw6N24yDHy9CPR3sh/uA==", "dependencies": { "@babel/core": "^7.18.6", "@babel/generator": "^7.18.7", @@ -2023,13 +2002,13 @@ "@babel/runtime": "^7.18.6", "@babel/runtime-corejs3": "^7.18.6", "@babel/traverse": "^7.18.8", - "@docusaurus/cssnano-preset": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", + "@docusaurus/cssnano-preset": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", "@docusaurus/react-loadable": "5.5.2", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-common": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-common": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "@slorber/static-site-generator-webpack-plugin": "^4.0.7", "@svgr/webpack": "^6.2.1", "autoprefixer": "^10.4.7", @@ -2167,10 +2146,9 @@ } }, "node_modules/@docusaurus/cssnano-preset": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-2.2.0.tgz", - "integrity": "sha512-mAAwCo4n66TMWBH1kXnHVZsakW9VAXJzTO4yZukuL3ro4F+JtkMwKfh42EG75K/J/YIFQG5I/Bzy0UH/hFxaTg==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-2.3.0.tgz", + "integrity": "sha512-igmsXc1Q95lMeq07A1xua0/5wOPygDQ/ENSV7VVbiGhnvMv4gzkba8ZvbAtc7PmqK+kpYRfPzNCOk0GnQCvibg==", "dependencies": { "cssnano-preset-advanced": "^5.3.8", "postcss": "^8.4.14", @@ -2182,10 +2160,9 @@ } }, "node_modules/@docusaurus/logger": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-2.2.0.tgz", - "integrity": "sha512-DF3j1cA5y2nNsu/vk8AG7xwpZu6f5MKkPPMaaIbgXLnWGfm6+wkOeW7kNrxnM95YOhKUkJUophX69nGUnLsm0A==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-2.3.0.tgz", + "integrity": "sha512-GO8s+FJpNT0vwt6kr/BZ/B1iB8EgHH/CF590i55Epy3TP2baQHGEHcAnQWvz5067OXIEke7Sa8sUNi0V9FrcJw==", "dependencies": { "chalk": "^4.1.2", "tslib": "^2.4.0" @@ -2198,7 +2175,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -2213,7 +2189,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2229,7 +2204,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -2240,14 +2214,12 @@ "node_modules/@docusaurus/logger/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/@docusaurus/logger/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "license": "MIT", "engines": { "node": ">=8" } @@ -2256,7 +2228,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -2265,15 +2236,14 @@ } }, "node_modules/@docusaurus/mdx-loader": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-2.2.0.tgz", - "integrity": "sha512-X2bzo3T0jW0VhUU+XdQofcEeozXOTmKQMvc8tUnWRdTnCvj4XEcBVdC3g+/jftceluiwSTNRAX4VBOJdNt18jA==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-2.3.0.tgz", + "integrity": "sha512-uxownG7dlg/l19rTIfUP0KDsbI8lTCgziWsdubMcWpGvOgXgm1p4mKSmWPzAwkRENn+un4L8DBhl3j1toeJy1A==", "dependencies": { "@babel/parser": "^7.18.8", "@babel/traverse": "^7.18.8", - "@docusaurus/logger": "2.2.0", - "@docusaurus/utils": "2.2.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/utils": "2.3.0", "@mdx-js/mdx": "^1.6.22", "escape-html": "^1.0.3", "file-loader": "^6.2.0", @@ -2297,12 +2267,12 @@ } }, "node_modules/@docusaurus/module-type-aliases": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-2.2.0.tgz", - "integrity": "sha512-wDGW4IHKoOr9YuJgy7uYuKWrDrSpsUSDHLZnWQYM9fN7D5EpSmYHjFruUpKWVyxLpD/Wh0rW8hYZwdjJIQUQCQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-2.3.0.tgz", + "integrity": "sha512-DvJtVejgrgIgxSNZ0pRaVu4EndRVBgbtp1LKvIO4xBgKlrsq8o4qkj1HKwH6yok5NoMqGApu8/E0KPOdZBtDpQ==", "dependencies": { "@docusaurus/react-loadable": "5.5.2", - "@docusaurus/types": "2.2.0", + "@docusaurus/types": "2.3.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -2316,18 +2286,17 @@ } }, "node_modules/@docusaurus/plugin-content-blog": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.2.0.tgz", - "integrity": "sha512-0mWBinEh0a5J2+8ZJXJXbrCk1tSTNf7Nm4tYAl5h2/xx+PvH/Bnu0V+7mMljYm/1QlDYALNIIaT/JcoZQFUN3w==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.3.0.tgz", + "integrity": "sha512-/v+nWEaqRxH1U4I6uJIMdj8Iilrh0XwIG5vsmsi4AXbpArgqqyfMjbf70lzPOmSdYfdWYgb7tWcA6OhJqyKj0w==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-common": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-common": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "cheerio": "^1.0.0-rc.12", "feed": "^4.2.2", "fs-extra": "^10.1.0", @@ -2347,18 +2316,17 @@ } }, "node_modules/@docusaurus/plugin-content-docs": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.2.0.tgz", - "integrity": "sha512-BOazBR0XjzsHE+2K1wpNxz5QZmrJgmm3+0Re0EVPYFGW8qndCWGNtXW/0lGKhecVPML8yyFeAmnUCIs7xM2wPw==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.3.0.tgz", + "integrity": "sha512-P53gYvtPY/VJTMdV5pFnKv8d7qMBOPyu/4NPREQU5PWsXJOYedCwNBqdAR7A5P69l55TrzyUEUYLjIcwuoSPGg==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/module-type-aliases": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/module-type-aliases": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "@types/react-router-config": "^5.0.6", "combine-promises": "^1.1.0", "fs-extra": "^10.1.0", @@ -2378,16 +2346,15 @@ } }, "node_modules/@docusaurus/plugin-content-pages": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.2.0.tgz", - "integrity": "sha512-+OTK3FQHk5WMvdelz8v19PbEbx+CNT6VSpx7nVOvMNs5yJCKvmqBJBQ2ZSxROxhVDYn+CZOlmyrC56NSXzHf6g==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.3.0.tgz", + "integrity": "sha512-H21Ux3Ln+pXlcp0RGdD1fyes7H3tsyhFpeflkxnCoXfTQf/pQB9IMuddFnxuXzj+34rp6jAQmLSaPssuixJXRQ==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "fs-extra": "^10.1.0", "tslib": "^2.4.0", "webpack": "^5.73.0" @@ -2401,14 +2368,13 @@ } }, "node_modules/@docusaurus/plugin-debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-2.2.0.tgz", - "integrity": "sha512-p9vOep8+7OVl6r/NREEYxf4HMAjV8JMYJ7Bos5fCFO0Wyi9AZEo0sCTliRd7R8+dlJXZEgcngSdxAUo/Q+CJow==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-2.3.0.tgz", + "integrity": "sha512-TyeH3DMA9/8sIXyX8+zpdLtSixBnLJjW9KSvncKj/iXs1t20tpUZ1WFL7D+G1gxGGbLCBUGDluh738VvsRHC6Q==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", "fs-extra": "^10.1.0", "react-json-view": "^1.21.3", "tslib": "^2.4.0" @@ -2422,14 +2388,13 @@ } }, "node_modules/@docusaurus/plugin-google-analytics": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.2.0.tgz", - "integrity": "sha512-+eZVVxVeEnV5nVQJdey9ZsfyEVMls6VyWTIj8SmX0k5EbqGvnIfET+J2pYEuKQnDIHxy+syRMoRM6AHXdHYGIg==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.3.0.tgz", + "integrity": "sha512-Z9FqTQzeOC1R6i/x07VgkrTKpQ4OtMe3WBOKZKzgldWXJr6CDUWPSR8pfDEjA+RRAj8ajUh0E+BliKBmFILQvQ==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "tslib": "^2.4.0" }, "engines": { @@ -2441,14 +2406,31 @@ } }, "node_modules/@docusaurus/plugin-google-gtag": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.2.0.tgz", - "integrity": "sha512-6SOgczP/dYdkqUMGTRqgxAS1eTp6MnJDAQMy8VCF1QKbWZmlkx4agHDexihqmYyCujTYHqDAhm1hV26EET54NQ==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.3.0.tgz", + "integrity": "sha512-oZavqtfwQAGjz+Dyhsb45mVssTevCW1PJgLcmr3WKiID15GTolbBrrp/fueTrEh60DzOd81HbiCLs56JWBwDhQ==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + } + }, + "node_modules/@docusaurus/plugin-google-tag-manager": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-2.3.0.tgz", + "integrity": "sha512-toAhuMX1h+P2CfavwoDlz9s2/Zm7caiEznW/inxq3izywG2l9ujWI/o6u2g70O3ACQ19eHMGHDsyEUcRDPrxBw==", + "dependencies": { + "@docusaurus/core": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "tslib": "^2.4.0" }, "engines": { @@ -2460,17 +2442,16 @@ } }, "node_modules/@docusaurus/plugin-sitemap": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.2.0.tgz", - "integrity": "sha512-0jAmyRDN/aI265CbWZNZuQpFqiZuo+5otk2MylU9iVrz/4J7gSc+ZJ9cy4EHrEsW7PV8s1w18hIEsmcA1YgkKg==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.3.0.tgz", + "integrity": "sha512-kwIHLP6lyubWOnNO0ejwjqdxB9C6ySnATN61etd6iwxHri5+PBZCEOv1sVm5U1gfQiDR1sVsXnJq2zNwLwgEtQ==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-common": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-common": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "fs-extra": "^10.1.0", "sitemap": "^7.1.1", "tslib": "^2.4.0" @@ -2484,23 +2465,23 @@ } }, "node_modules/@docusaurus/preset-classic": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-2.2.0.tgz", - "integrity": "sha512-yKIWPGNx7BT8v2wjFIWvYrS+nvN04W+UameSFf8lEiJk6pss0kL6SG2MRvyULiI3BDxH+tj6qe02ncpSPGwumg==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-2.3.0.tgz", + "integrity": "sha512-mI37ieJe7cs5dHuvWz415U7hO209Q19Fp4iSHeFFgtQoK1PiRg7HJHkVbEsLZII2MivdzGFB5Hxoq2wUPWdNEA==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/plugin-content-blog": "2.2.0", - "@docusaurus/plugin-content-docs": "2.2.0", - "@docusaurus/plugin-content-pages": "2.2.0", - "@docusaurus/plugin-debug": "2.2.0", - "@docusaurus/plugin-google-analytics": "2.2.0", - "@docusaurus/plugin-google-gtag": "2.2.0", - "@docusaurus/plugin-sitemap": "2.2.0", - "@docusaurus/theme-classic": "2.2.0", - "@docusaurus/theme-common": "2.2.0", - "@docusaurus/theme-search-algolia": "2.2.0", - "@docusaurus/types": "2.2.0" + "@docusaurus/core": "2.3.0", + "@docusaurus/plugin-content-blog": "2.3.0", + "@docusaurus/plugin-content-docs": "2.3.0", + "@docusaurus/plugin-content-pages": "2.3.0", + "@docusaurus/plugin-debug": "2.3.0", + "@docusaurus/plugin-google-analytics": "2.3.0", + "@docusaurus/plugin-google-gtag": "2.3.0", + "@docusaurus/plugin-google-tag-manager": "2.3.0", + "@docusaurus/plugin-sitemap": "2.3.0", + "@docusaurus/theme-classic": "2.3.0", + "@docusaurus/theme-common": "2.3.0", + "@docusaurus/theme-search-algolia": "2.3.0", + "@docusaurus/types": "2.3.0" }, "engines": { "node": ">=16.14" @@ -2524,23 +2505,22 @@ } }, "node_modules/@docusaurus/theme-classic": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-2.2.0.tgz", - "integrity": "sha512-kjbg/qJPwZ6H1CU/i9d4l/LcFgnuzeiGgMQlt6yPqKo0SOJIBMPuz7Rnu3r/WWbZFPi//o8acclacOzmXdUUEg==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-2.3.0.tgz", + "integrity": "sha512-x2h9KZ4feo22b1aArsfqvK05aDCgTkLZGRgAPY/9TevFV5/Yy19cZtBOCbzaKa2dKq1ofBRK9Hm1DdLJdLB14A==", "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/module-type-aliases": "2.2.0", - "@docusaurus/plugin-content-blog": "2.2.0", - "@docusaurus/plugin-content-docs": "2.2.0", - "@docusaurus/plugin-content-pages": "2.2.0", - "@docusaurus/theme-common": "2.2.0", - "@docusaurus/theme-translations": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-common": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/module-type-aliases": "2.3.0", + "@docusaurus/plugin-content-blog": "2.3.0", + "@docusaurus/plugin-content-docs": "2.3.0", + "@docusaurus/plugin-content-pages": "2.3.0", + "@docusaurus/theme-common": "2.3.0", + "@docusaurus/theme-translations": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-common": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", "copy-text-to-clipboard": "^3.0.1", @@ -2564,17 +2544,16 @@ } }, "node_modules/@docusaurus/theme-common": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-2.2.0.tgz", - "integrity": "sha512-R8BnDjYoN90DCL75gP7qYQfSjyitXuP9TdzgsKDmSFPNyrdE3twtPNa2dIN+h+p/pr+PagfxwWbd6dn722A1Dw==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-2.3.0.tgz", + "integrity": "sha512-1eAvaULgu6ywHbjkdWOOHl1PdMylne/88i0kg25qimmkMgRHoIQ23JgRD/q5sFr+2YX7U7SggR1UNNsqu2zZPw==", "dependencies": { - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/module-type-aliases": "2.2.0", - "@docusaurus/plugin-content-blog": "2.2.0", - "@docusaurus/plugin-content-docs": "2.2.0", - "@docusaurus/plugin-content-pages": "2.2.0", - "@docusaurus/utils": "2.2.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/module-type-aliases": "2.3.0", + "@docusaurus/plugin-content-blog": "2.3.0", + "@docusaurus/plugin-content-docs": "2.3.0", + "@docusaurus/plugin-content-pages": "2.3.0", + "@docusaurus/utils": "2.3.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -2582,6 +2561,7 @@ "parse-numeric-range": "^1.3.0", "prism-react-renderer": "^1.3.5", "tslib": "^2.4.0", + "use-sync-external-store": "^1.2.0", "utility-types": "^3.10.0" }, "engines": { @@ -2593,19 +2573,18 @@ } }, "node_modules/@docusaurus/theme-search-algolia": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.2.0.tgz", - "integrity": "sha512-2h38B0tqlxgR2FZ9LpAkGrpDWVdXZ7vltfmTdX+4RsDs3A7khiNsmZB+x/x6sA4+G2V2CvrsPMlsYBy5X+cY1w==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.3.0.tgz", + "integrity": "sha512-/i5k1NAlbYvgnw69vJQA174+ipwdtTCCUvxRp7bVZ+8KmviEybAC/kuKe7WmiUbIGVYbAbwYaEsPuVnsd65DrA==", "dependencies": { "@docsearch/react": "^3.1.1", - "@docusaurus/core": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/plugin-content-docs": "2.2.0", - "@docusaurus/theme-common": "2.2.0", - "@docusaurus/theme-translations": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/plugin-content-docs": "2.3.0", + "@docusaurus/theme-common": "2.3.0", + "@docusaurus/theme-translations": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "algoliasearch": "^4.13.1", "algoliasearch-helper": "^3.10.0", "clsx": "^1.2.1", @@ -2624,10 +2603,9 @@ } }, "node_modules/@docusaurus/theme-translations": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-2.2.0.tgz", - "integrity": "sha512-3T140AG11OjJrtKlY4pMZ5BzbGRDjNs2co5hJ6uYJG1bVWlhcaFGqkaZ5lCgKflaNHD7UHBHU9Ec5f69jTdd6w==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-2.3.0.tgz", + "integrity": "sha512-YLVD6LrszBld1EvThTOa9PcblKAZs1jOmRjwtffdg1CGjQWFXEeWUL24n2M4ARByzuLry5D8ZRVmKyRt3LOwsw==", "dependencies": { "fs-extra": "^10.1.0", "tslib": "^2.4.0" @@ -2637,9 +2615,9 @@ } }, "node_modules/@docusaurus/types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-2.2.0.tgz", - "integrity": "sha512-b6xxyoexfbRNRI8gjblzVOnLr4peCJhGbYGPpJ3LFqpi5nsFfoK4mmDLvWdeah0B7gmJeXabN7nQkFoqeSdmOw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-2.3.0.tgz", + "integrity": "sha512-c5C0nROxVFsgMAm4vWDB1LDv3v4K18Y8eVxazL3dEr7w+7kNLc5koWrW7fWmCnrbItnuTna4nLS2PcSZrkYidg==", "dependencies": { "@types/history": "^4.7.11", "@types/react": "*", @@ -2656,13 +2634,13 @@ } }, "node_modules/@docusaurus/utils": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-2.2.0.tgz", - "integrity": "sha512-oNk3cjvx7Tt1Lgh/aeZAmFpGV2pDr5nHKrBVx6hTkzGhrnMuQqLt6UPlQjdYQ3QHXwyF/ZtZMO1D5Pfi0lu7SA==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-2.3.0.tgz", + "integrity": "sha512-6+GCurDsePHHbLM3ktcjv8N4zrjgrl1O7gOQNG4UMktcwHssFFVm+geVcB4M8siOmwUjV2VaNrp0hpGy8DOQHw==", "dependencies": { - "@docusaurus/logger": "2.2.0", + "@docusaurus/logger": "2.3.0", "@svgr/webpack": "^6.2.1", + "escape-string-regexp": "^4.0.0", "file-loader": "^6.2.0", "fs-extra": "^10.1.0", "github-slugger": "^1.4.0", @@ -2690,10 +2668,9 @@ } }, "node_modules/@docusaurus/utils-common": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-2.2.0.tgz", - "integrity": "sha512-qebnerHp+cyovdUseDQyYFvMW1n1nv61zGe5JJfoNQUnjKuApch3IVsz+/lZ9a38pId8kqehC1Ao2bW/s0ntDA==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-2.3.0.tgz", + "integrity": "sha512-nu5An+26FS7SQTwvyFR4g9lw3NU1u2RLcxJPZF+NCOG8Ne96ciuQosa7+N1kllm/heEJqfTaAUD0sFxpTZrDtw==", "dependencies": { "tslib": "^2.4.0" }, @@ -2710,13 +2687,12 @@ } }, "node_modules/@docusaurus/utils-validation": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-2.2.0.tgz", - "integrity": "sha512-I1hcsG3yoCkasOL5qQAYAfnmVoLei7apugT6m4crQjmDGxq+UkiRrq55UqmDDyZlac/6ax/JC0p+usZ6W4nVyg==", - "license": "MIT", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-2.3.0.tgz", + "integrity": "sha512-TBJCLqwAoiQQJ6dbgBpuLvzsn/XiTgbZkd6eJFUIQYLb1d473Zv58QrHXVmVQDLWiCgmJpHW2LpMfumTpCDgJw==", "dependencies": { - "@docusaurus/logger": "2.2.0", - "@docusaurus/utils": "2.2.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/utils": "2.3.0", "joi": "^17.6.0", "js-yaml": "^4.1.0", "tslib": "^2.4.0" @@ -2725,6 +2701,17 @@ "node": ">=16.14" } }, + "node_modules/@docusaurus/utils/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -2854,7 +2841,6 @@ "version": "1.6.22", "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-1.6.22.tgz", "integrity": "sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA==", - "license": "MIT", "dependencies": { "@babel/core": "7.12.9", "@babel/plugin-syntax-jsx": "7.12.1", @@ -2885,7 +2871,6 @@ "version": "7.12.9", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz", "integrity": "sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==", - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/generator": "^7.12.5", @@ -2916,7 +2901,6 @@ "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz", "integrity": "sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg==", - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -2928,7 +2912,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "license": "ISC", "bin": { "semver": "bin/semver" } @@ -2937,7 +2920,6 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -2946,7 +2928,6 @@ "version": "9.2.0", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", "integrity": "sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==", - "license": "MIT", "dependencies": { "bail": "^1.0.0", "extend": "^3.0.0", @@ -2977,7 +2958,6 @@ "version": "1.6.22", "resolved": "https://registry.npmjs.org/@mdx-js/util/-/util-1.6.22.tgz", "integrity": "sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -3408,7 +3388,6 @@ "version": "2.3.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.4.tgz", "integrity": "sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==", - "license": "MIT", "dependencies": { "@types/unist": "*" } @@ -3444,7 +3423,6 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.10.tgz", "integrity": "sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==", - "license": "MIT", "dependencies": { "@types/unist": "*" } @@ -3468,8 +3446,7 @@ "node_modules/@types/parse5": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-5.0.3.tgz", - "integrity": "sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==", - "license": "MIT" + "integrity": "sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==" }, "node_modules/@types/prop-types": { "version": "15.7.5", @@ -3538,7 +3515,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.4.tgz", "integrity": "sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw==", - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -3924,32 +3900,30 @@ } }, "node_modules/algoliasearch": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.14.2.tgz", - "integrity": "sha512-ngbEQonGEmf8dyEh5f+uOIihv4176dgbuOZspiuhmTTBRBuzWu3KCGHre6uHj5YyuC7pNvQGzB6ZNJyZi0z+Sg==", - "license": "MIT", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.14.3.tgz", + "integrity": "sha512-GZTEuxzfWbP/vr7ZJfGzIl8fOsoxN916Z6FY2Egc9q2TmZ6hvq5KfAxY89pPW01oW/2HDEKA8d30f9iAH9eXYg==", "dependencies": { - "@algolia/cache-browser-local-storage": "4.14.2", - "@algolia/cache-common": "4.14.2", - "@algolia/cache-in-memory": "4.14.2", - "@algolia/client-account": "4.14.2", - "@algolia/client-analytics": "4.14.2", - "@algolia/client-common": "4.14.2", - "@algolia/client-personalization": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/logger-common": "4.14.2", - "@algolia/logger-console": "4.14.2", - "@algolia/requester-browser-xhr": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/requester-node-http": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/cache-browser-local-storage": "4.14.3", + "@algolia/cache-common": "4.14.3", + "@algolia/cache-in-memory": "4.14.3", + "@algolia/client-account": "4.14.3", + "@algolia/client-analytics": "4.14.3", + "@algolia/client-common": "4.14.3", + "@algolia/client-personalization": "4.14.3", + "@algolia/client-search": "4.14.3", + "@algolia/logger-common": "4.14.3", + "@algolia/logger-console": "4.14.3", + "@algolia/requester-browser-xhr": "4.14.3", + "@algolia/requester-common": "4.14.3", + "@algolia/requester-node-http": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "node_modules/algoliasearch-helper": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.11.1.tgz", - "integrity": "sha512-mvsPN3eK4E0bZG0/WlWJjeqe/bUD2KOEVOl0GyL/TGXn6wcpZU8NOuztGHCUKXkyg5gq6YzUakVTmnmSSO5Yiw==", - "license": "MIT", + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.11.3.tgz", + "integrity": "sha512-TbaEvLwiuGygHQIB8y+OsJKQQ40+JKUua5B91X66tMUHyyhbNHvqyr0lqd3wCoyKx7WybyQrC0WJvzoIeh24Aw==", "dependencies": { "@algolia/events": "^4.0.1" }, @@ -4046,8 +4020,7 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "license": "Python-2.0" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/array-flatten": { "version": "2.1.2", @@ -4067,8 +4040,7 @@ "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", - "license": "MIT" + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" }, "node_modules/at-least-node": { "version": "1.0.0", @@ -4142,7 +4114,6 @@ "version": "1.6.22", "resolved": "https://registry.npmjs.org/babel-plugin-apply-mdx-type-prop/-/babel-plugin-apply-mdx-type-prop-1.6.22.tgz", "integrity": "sha512-VefL+8o+F/DfK24lPZMtJctrCVOfgbqLAGZSkxwhazQv4VxPg3Za/i40fu22KR2m8eEda+IfSOlPLUSIiLcnCQ==", - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "7.10.4", "@mdx-js/util": "1.6.22" @@ -4158,8 +4129,7 @@ "node_modules/babel-plugin-apply-mdx-type-prop/node_modules/@babel/helper-plugin-utils": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", - "license": "MIT" + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==" }, "node_modules/babel-plugin-dynamic-import-node": { "version": "2.3.3", @@ -4174,7 +4144,6 @@ "version": "1.6.22", "resolved": "https://registry.npmjs.org/babel-plugin-extract-import-names/-/babel-plugin-extract-import-names-1.6.22.tgz", "integrity": "sha512-yJ9BsJaISua7d8zNT7oRG1ZLBJCIdZ4PZqmH8qa9N5AK01ifk3fnkc98AXhtzE7UkfCsEumvoQWgoYLhOnJ7jQ==", - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "7.10.4" }, @@ -4186,8 +4155,7 @@ "node_modules/babel-plugin-extract-import-names/node_modules/@babel/helper-plugin-utils": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", - "license": "MIT" + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==" }, "node_modules/babel-plugin-polyfill-corejs2": { "version": "0.3.2", @@ -4235,7 +4203,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4250,8 +4217,7 @@ "node_modules/base16": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/base16/-/base16-1.0.0.tgz", - "integrity": "sha512-pNdYkNPiJUnEhnfXV56+sQy8+AaPcG3POZAUnwr4EeqCUZFz4u2PePbo3e5Gj4ziYPCWGUZT9RHisvJKnwFuBQ==", - "license": "MIT" + "integrity": "sha512-pNdYkNPiJUnEhnfXV56+sQy8+AaPcG3POZAUnwr4EeqCUZFz4u2PePbo3e5Gj4ziYPCWGUZT9RHisvJKnwFuBQ==" }, "node_modules/batch": { "version": "0.6.1", @@ -4630,7 +4596,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.1.0.tgz", "integrity": "sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4654,7 +4619,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4664,7 +4628,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4674,7 +4637,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4718,7 +4680,6 @@ "version": "1.0.0-rc.12", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "license": "MIT", "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -4739,7 +4700,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -4756,7 +4716,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -4772,7 +4731,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -4786,7 +4744,6 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" }, @@ -4801,7 +4758,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", - "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -4815,7 +4771,6 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", - "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -4827,7 +4782,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -4841,7 +4795,6 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" }, @@ -4856,7 +4809,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", - "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -4870,7 +4822,6 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", - "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -4889,7 +4840,6 @@ "url": "https://github.com/sponsors/fb55" } ], - "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -5042,7 +4992,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz", "integrity": "sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -5088,7 +5037,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz", "integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -5245,7 +5193,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.0.1.tgz", "integrity": "sha512-rvVsHrpFcL4F2P8ihsoLdFHmd404+CMg71S756oRSeQgqk51U3kicGdnvfkrxva0xXH92SjGS62B0XIJsbh+9Q==", - "license": "MIT", "engines": { "node": ">=12" }, @@ -5432,7 +5379,6 @@ "version": "3.1.5", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", - "license": "MIT", "dependencies": { "node-fetch": "2.6.7" } @@ -5659,7 +5605,6 @@ "version": "5.3.9", "resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-5.3.9.tgz", "integrity": "sha512-njnh4pp1xCsibJcEHnWZb4EEzni0ePMqPuPNyuWT4Z+YeXmsgqNuTPIljXFEXhxGsWs9183JkXgHxc1TcsahIg==", - "license": "MIT", "dependencies": { "autoprefixer": "^10.4.12", "cssnano-preset-default": "^5.2.13", @@ -6300,7 +6245,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/detab/-/detab-2.0.4.tgz", "integrity": "sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g==", - "license": "MIT", "dependencies": { "repeat-string": "^1.5.4" }, @@ -6616,7 +6560,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/emoticon/-/emoticon-3.2.0.tgz", "integrity": "sha512-SNujglcLTTg+lDAcApPNgEdudaqQFiAbJCqzjNxJkvN9vAwCGi0uu8IUVvx+f16h+V44KCY6Y2yboroc9pilHg==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -6728,7 +6671,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -6970,14 +6912,12 @@ "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "license": "MIT" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -7046,7 +6986,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/fbemitter/-/fbemitter-3.0.0.tgz", "integrity": "sha512-KWKaceCwKQU0+HPoop6gn4eOHk50bBv/VxjJtGMfwmJt3D29JpN4H4eisCtIPA+a8GVBam+ldMMpMjJUvpDyHw==", - "license": "BSD-3-Clause", "dependencies": { "fbjs": "^3.0.0" } @@ -7055,7 +6994,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-3.0.4.tgz", "integrity": "sha512-ucV0tDODnGV3JCnnkmoszb5lf4bNpzjv80K41wd4k798Etq+UYD0y0TIfalLjZoKgjive6/adkRnszwapiDgBQ==", - "license": "MIT", "dependencies": { "cross-fetch": "^3.1.5", "fbjs-css-vars": "^1.0.0", @@ -7069,8 +7007,7 @@ "node_modules/fbjs-css-vars": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz", - "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==", - "license": "MIT" + "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==" }, "node_modules/feather-icons": { "version": "4.29.0", @@ -7085,7 +7022,6 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/feed/-/feed-4.2.2.tgz", "integrity": "sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==", - "license": "MIT", "dependencies": { "xml-js": "^1.6.11" }, @@ -7219,7 +7155,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/flux/-/flux-4.0.3.tgz", "integrity": "sha512-yKAbrp7JhZhj6uiT1FTuVMlIAT1J4jqEyBpFApi1kxpGZCvacMVc/t1pMQyotqHhAgvoE3bNvAykhCo2CLjnYw==", - "license": "BSD-3-Clause", "dependencies": { "fbemitter": "^3.0.0", "fbjs": "^3.0.1" @@ -7500,8 +7435,7 @@ "node_modules/get-own-enumerable-property-symbols": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", - "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", - "license": "ISC" + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==" }, "node_modules/get-stream": { "version": "4.1.0", @@ -7516,8 +7450,9 @@ } }, "node_modules/github-slugger": { - "version": "1.4.0", - "license": "ISC" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.5.0.tgz", + "integrity": "sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==" }, "node_modules/glob": { "version": "7.2.2", @@ -7676,7 +7611,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", - "license": "MIT", "dependencies": { "js-yaml": "^3.13.1", "kind-of": "^6.0.2", @@ -7691,7 +7625,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" } @@ -7700,7 +7633,6 @@ "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -7786,7 +7718,6 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz", "integrity": "sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA==", - "license": "MIT", "dependencies": { "@types/unist": "^2.0.3", "comma-separated-tokens": "^1.0.0", @@ -7805,7 +7736,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz", "integrity": "sha512-jeJUWiN5pSxW12Rh01smtVkZgZr33wBokLzKLwinYOUfSzm1Nl/c3GUGebDyOKjdsRgMvoVbV0VpAcpjF4NrJA==", - "license": "MIT", "dependencies": { "@types/parse5": "^5.0.0", "hastscript": "^6.0.0", @@ -7823,7 +7753,6 @@ "version": "2.2.5", "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz", "integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -7833,7 +7762,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-6.0.1.tgz", "integrity": "sha512-ZMuiYA+UF7BXBtsTBNcLBF5HzXzkyE6MLzJnL605LKE8GJylNjGc4jjxazAHUtcwT5/CEt6afRKViYB4X66dig==", - "license": "MIT", "dependencies": { "@types/hast": "^2.0.0", "hast-util-from-parse5": "^6.0.0", @@ -7854,14 +7782,12 @@ "node_modules/hast-util-raw/node_modules/parse5": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "license": "MIT" + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" }, "node_modules/hast-util-to-parse5": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz", "integrity": "sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ==", - "license": "MIT", "dependencies": { "hast-to-hyperscript": "^9.0.0", "property-information": "^5.0.0", @@ -7878,7 +7804,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz", "integrity": "sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==", - "license": "MIT", "dependencies": { "@types/hast": "^2.0.0", "comma-separated-tokens": "^1.0.0", @@ -8017,7 +7942,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.5.tgz", "integrity": "sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -8204,7 +8128,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.2.tgz", "integrity": "sha512-xfOoWjceHntRb3qFCrh5ZFORYH8XCdYpASltMhZ/Q0KZiOwjdE/Yl2QCiWdwD+lygV5bMCvauzgu5PxBX/Yerg==", - "license": "MIT", "dependencies": { "queue": "6.0.2" }, @@ -8276,7 +8199,6 @@ "version": "0.2.0-alpha.42", "resolved": "https://registry.npmjs.org/infima/-/infima-0.2.0-alpha.42.tgz", "integrity": "sha512-ift8OXNbQQwtbIt6z16KnSWP7uJ/SysSMFI4F87MNRTicypfl4Pv3E2OGVv6N3nSZFJvA8imYulCBS64iyHYww==", - "license": "MIT", "engines": { "node": ">=12" } @@ -8306,8 +8228,7 @@ "node_modules/inline-style-parser": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", - "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==", - "license": "MIT" + "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" }, "node_modules/internmap": { "version": "2.0.3", @@ -8348,7 +8269,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -8358,7 +8278,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", - "license": "MIT", "dependencies": { "is-alphabetical": "^1.0.0", "is-decimal": "^1.0.0" @@ -8404,7 +8323,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "engines": { "node": ">=4" } @@ -8435,7 +8353,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -8460,7 +8377,6 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -8499,7 +8415,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -8546,7 +8461,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -8573,7 +8487,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "license": "MIT", "engines": { "node": ">=8" } @@ -8594,7 +8507,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -8630,7 +8542,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz", "integrity": "sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -8640,7 +8551,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", "integrity": "sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -8752,7 +8662,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -8938,8 +8847,7 @@ "node_modules/lodash.curry": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.curry/-/lodash.curry-4.1.1.tgz", - "integrity": "sha512-/u14pXGviLaweY5JI0IUzgzF2J6Ne8INyzAZjImcryjgkZ+ebruBxy2/JaOOkTqScddcYtakjhSaeemV8lR0tA==", - "license": "MIT" + "integrity": "sha512-/u14pXGviLaweY5JI0IUzgzF2J6Ne8INyzAZjImcryjgkZ+ebruBxy2/JaOOkTqScddcYtakjhSaeemV8lR0tA==" }, "node_modules/lodash.debounce": { "version": "4.0.8", @@ -8950,8 +8858,7 @@ "node_modules/lodash.flow": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", - "integrity": "sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw==", - "license": "MIT" + "integrity": "sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw==" }, "node_modules/lodash.memoize": { "version": "4.1.2", @@ -9035,7 +8942,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz", "integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9045,7 +8951,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz", "integrity": "sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ==", - "license": "MIT", "dependencies": { "unist-util-remove": "^2.0.0" }, @@ -9058,7 +8963,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz", "integrity": "sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ==", - "license": "MIT", "dependencies": { "unist-util-visit": "^2.0.0" }, @@ -9071,7 +8975,6 @@ "version": "10.0.1", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz", "integrity": "sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA==", - "license": "MIT", "dependencies": { "@types/mdast": "^3.0.0", "@types/unist": "^2.0.0", @@ -9091,7 +8994,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -9106,8 +9008,7 @@ "node_modules/mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "license": "MIT" + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" }, "node_modules/mdx-mermaid": { "version": "1.3.2", @@ -9443,7 +9344,6 @@ "version": "1.11.0", "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", - "license": "MIT", "dependencies": { "lodash": "^4.17.21" } @@ -9452,7 +9352,6 @@ "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -9533,8 +9432,7 @@ "node_modules/nprogress": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz", - "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==", - "license": "MIT" + "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==" }, "node_modules/nth-check": { "version": "2.0.1", @@ -9797,7 +9695,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", - "license": "MIT", "dependencies": { "character-entities": "^1.0.0", "character-entities-legacy": "^1.0.0", @@ -9832,14 +9729,12 @@ "node_modules/parse-numeric-range": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz", - "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==", - "license": "ISC" + "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==" }, "node_modules/parse5": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz", - "integrity": "sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==", - "license": "MIT", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dependencies": { "entities": "^4.4.0" }, @@ -9851,7 +9746,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", - "license": "MIT", "dependencies": { "domhandler": "^5.0.2", "parse5": "^7.0.0" @@ -9864,7 +9758,6 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" }, @@ -9879,7 +9772,6 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", - "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -10197,7 +10089,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-5.1.0.tgz", "integrity": "sha512-KwLWymI9hbwXmJa0dkrzpRbSJEh0vVUd7r8t0yOGPcfKzyJJxFM8kLyC5Ev9avji6nY95pOp1W6HqIrfT+0VGw==", - "license": "MIT", "dependencies": { "postcss-selector-parser": "^6.0.5" }, @@ -10297,7 +10188,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-5.1.1.tgz", "integrity": "sha512-pCijL1TREiCoog5nQp7wUe+TUonA2tC2sQ54UGeMmryK3UFGIYKqDyjnqd6RcuI4znFn9hWSLNN8xKE/vWcUQw==", - "license": "MIT", "dependencies": { "cssnano-utils": "^3.1.0", "postcss-value-parser": "^4.2.0" @@ -10639,7 +10529,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-5.2.0.tgz", "integrity": "sha512-BTrLjICoSB6gxbc58D5mdBK8OhXRDqud/zodYfdSi52qvDHdMwk+9kB9xsM8yJThH/sZU5A6QVSmMmaN001gIg==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -10698,7 +10587,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/postcss-sort-media-queries/-/postcss-sort-media-queries-4.3.0.tgz", "integrity": "sha512-jAl8gJM2DvuIJiI9sL1CuiHtKM4s5aEIomkU8G3LFvbP+p8i7Sz8VV63uieTgoewGqKbi+hxBTiOKJlB35upCg==", - "license": "MIT", "dependencies": { "sort-css-media-queries": "2.1.0" }, @@ -10750,7 +10638,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-5.1.0.tgz", "integrity": "sha512-fgFMf0OtVSBR1va1JNHYgMxYk73yhn/qb4uQDq1DLGYolz8gHCyr/sesEuGUaYs58E3ZJRcpoGuPVoB7Meiq9A==", - "license": "MIT", "engines": { "node": "^10 || ^12 || >=14.0" }, @@ -10799,7 +10686,6 @@ "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", - "license": "MIT", "engines": { "node": ">=6" } @@ -10814,7 +10700,6 @@ "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", - "license": "MIT", "dependencies": { "asap": "~2.0.3" } @@ -10847,7 +10732,6 @@ "version": "5.6.0", "resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz", "integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==", - "license": "MIT", "dependencies": { "xtend": "^4.0.0" }, @@ -10909,8 +10793,7 @@ "node_modules/pure-color": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/pure-color/-/pure-color-1.3.0.tgz", - "integrity": "sha512-QFADYnsVoBMw1srW7OVKEYjG+MbIa49s54w1MA1EDY6r2r/sTcKKYqRX1f4GYvnXP7eN/Pe9HFcX+hwzmrXRHA==", - "license": "MIT" + "integrity": "sha512-QFADYnsVoBMw1srW7OVKEYjG+MbIa49s54w1MA1EDY6r2r/sTcKKYqRX1f4GYvnXP7eN/Pe9HFcX+hwzmrXRHA==" }, "node_modules/qs": { "version": "6.10.3", @@ -10929,7 +10812,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", - "license": "MIT", "dependencies": { "inherits": "~2.0.3" } @@ -11048,7 +10930,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/react-base16-styling/-/react-base16-styling-0.6.0.tgz", "integrity": "sha512-yvh/7CArceR/jNATXOKDlvTnPKPmGZz7zsenQ3jUwLzHkNUR0CvY3yGYJbWJ/nnxsL8Sgmt5cO3/SILVuPO6TQ==", - "license": "MIT", "dependencies": { "base16": "^1.0.0", "lodash.curry": "^4.0.1", @@ -11295,7 +11176,6 @@ "version": "1.21.3", "resolved": "https://registry.npmjs.org/react-json-view/-/react-json-view-1.21.3.tgz", "integrity": "sha512-13p8IREj9/x/Ye4WI/JpjhoIwuzEgUAtgJZNBJckfzJt1qyh24BdTm6UQNGnyTq9dapQdrqvquZTo3dz1X6Cjw==", - "license": "MIT", "dependencies": { "flux": "^4.0.1", "react-base16-styling": "^0.6.0", @@ -11310,8 +11190,7 @@ "node_modules/react-lifecycles-compat": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", - "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", - "license": "MIT" + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" }, "node_modules/react-loadable": { "name": "@docusaurus/react-loadable", @@ -11392,8 +11271,9 @@ } }, "node_modules/react-textarea-autosize": { - "version": "8.3.4", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.4.0.tgz", + "integrity": "sha512-YrTFaEHLgJsi8sJVYHBzYn+mkP3prGkmP2DKb/tm0t7CLJY5t1Rxix8070LAKb0wby7bl/lf2EeHkuMihMZMwQ==", "dependencies": { "@babel/runtime": "^7.10.2", "use-composed-ref": "^1.3.0", @@ -11444,8 +11324,7 @@ "node_modules/reading-time": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/reading-time/-/reading-time-1.5.0.tgz", - "integrity": "sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==", - "license": "MIT" + "integrity": "sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==" }, "node_modules/rechoir": { "version": "0.6.2", @@ -11568,7 +11447,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/remark-emoji/-/remark-emoji-2.2.0.tgz", "integrity": "sha512-P3cj9s5ggsUvWw5fS2uzCHJMGuXYRb0NnZqYlNecewXt8QBU9n5vW3DUUKOhepS8F9CwdMx9B8a3i7pqFWAI5w==", - "license": "MIT", "dependencies": { "emoticon": "^3.2.0", "node-emoji": "^1.10.0", @@ -11579,7 +11457,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/remark-footnotes/-/remark-footnotes-2.0.0.tgz", "integrity": "sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -11589,7 +11466,6 @@ "version": "1.6.22", "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-1.6.22.tgz", "integrity": "sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ==", - "license": "MIT", "dependencies": { "@babel/core": "7.12.9", "@babel/helper-plugin-utils": "7.10.4", @@ -11609,7 +11485,6 @@ "version": "7.12.9", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz", "integrity": "sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==", - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/generator": "^7.12.5", @@ -11639,14 +11514,12 @@ "node_modules/remark-mdx/node_modules/@babel/helper-plugin-utils": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", - "license": "MIT" + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==" }, "node_modules/remark-mdx/node_modules/@babel/plugin-proposal-object-rest-spread": { "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz", "integrity": "sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==", - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.0", @@ -11660,7 +11533,6 @@ "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz", "integrity": "sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg==", - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -11672,7 +11544,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "license": "ISC", "bin": { "semver": "bin/semver" } @@ -11681,7 +11552,6 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -11690,7 +11560,6 @@ "version": "9.2.0", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", "integrity": "sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==", - "license": "MIT", "dependencies": { "bail": "^1.0.0", "extend": "^3.0.0", @@ -11708,7 +11577,6 @@ "version": "8.0.3", "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz", "integrity": "sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q==", - "license": "MIT", "dependencies": { "ccount": "^1.0.0", "collapse-white-space": "^1.0.2", @@ -11736,7 +11604,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz", "integrity": "sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw==", - "license": "MIT", "dependencies": { "mdast-squeeze-paragraphs": "^4.0.0" }, @@ -11762,7 +11629,6 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "license": "MIT", "engines": { "node": ">=0.10" } @@ -11880,7 +11746,6 @@ "version": "3.5.0", "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-3.5.0.tgz", "integrity": "sha512-wzgMaMFHQTnyi9YOwsx9LjOxYXJPzS8sYnFaKm6R5ysvTkwzHiB0vxnbHwchHQT65PTdBjDG21/kQBWI7q9O7A==", - "license": "MIT", "dependencies": { "find-up": "^5.0.0", "picocolors": "^1.0.0", @@ -11895,7 +11760,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -11911,7 +11775,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -11926,7 +11789,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -11941,7 +11803,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -12071,8 +11932,7 @@ "node_modules/sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "license": "ISC" + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "node_modules/scheduler": { "version": "0.20.2", @@ -12106,7 +11966,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", - "license": "MIT", "dependencies": { "extend-shallow": "^2.0.1", "kind-of": "^6.0.0" @@ -12345,8 +12204,7 @@ "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "license": "MIT" + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" }, "node_modules/setprototypeof": { "version": "1.2.0", @@ -12458,7 +12316,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-7.1.1.tgz", "integrity": "sha512-mK3aFtjz4VdJN0igpIJrinf3EO8U8mxOPsTBzSsy06UtjZQJ3YY3o3Xa7zSc5nMqcMrRwlChHZ18Kxg0caiPBg==", - "license": "MIT", "dependencies": { "@types/node": "^17.0.5", "@types/sax": "^1.2.1", @@ -12497,7 +12354,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/sort-css-media-queries/-/sort-css-media-queries-2.1.0.tgz", "integrity": "sha512-IeWvo8NkNiY2vVYdPa27MCQiR0MN0M80johAYFVxWWXQ44KU84WNxjslwBHmc/7ZL2ccwkM7/e6S5aiKZXm7jA==", - "license": "MIT", "engines": { "node": ">= 6.3.0" } @@ -12534,7 +12390,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz", "integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -12573,8 +12428,7 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "license": "BSD-3-Clause" + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "node_modules/stable": { "version": "0.1.8", @@ -12586,7 +12440,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz", "integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -12682,7 +12535,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", - "license": "BSD-2-Clause", "dependencies": { "get-own-enumerable-property-symbols": "^3.0.0", "is-obj": "^1.0.1", @@ -12708,7 +12560,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -12726,7 +12577,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "license": "MIT", "engines": { "node": ">=8" }, @@ -12738,7 +12588,6 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz", "integrity": "sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==", - "license": "MIT", "dependencies": { "inline-style-parser": "0.1.1" } @@ -13035,8 +12884,7 @@ "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/trim": { "version": "0.0.1", @@ -13047,7 +12895,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz", "integrity": "sha512-rjUWSqnfTNrjbB9NQWfPMH/xRK1deHeGsHoVfpxJ++XeYXE0d6B1En37AHfw3jtfTU7dzMzZL2jjpe8Qb5gLIQ==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -13057,7 +12904,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -13241,7 +13087,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", "integrity": "sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==", - "license": "MIT", "dependencies": { "inherits": "^2.0.0", "xtend": "^4.0.0" @@ -13291,7 +13136,6 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==", - "license": "MIT", "dependencies": { "bail": "^1.0.0", "extend": "^3.0.0", @@ -13321,7 +13165,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/unist-builder/-/unist-builder-2.0.3.tgz", "integrity": "sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -13331,7 +13174,6 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.6.tgz", "integrity": "sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -13351,7 +13193,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz", "integrity": "sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -13361,7 +13202,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/unist-util-remove/-/unist-util-remove-2.1.0.tgz", "integrity": "sha512-J8NYPyBm4baYLdCbjmf1bhPu45Cr1MWTm77qd9istEkzWpnN6O9tMsEbB2JhNnBCqGENRqEWomQ+He6au0B27Q==", - "license": "MIT", "dependencies": { "unist-util-is": "^4.0.0" }, @@ -13374,7 +13214,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz", "integrity": "sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA==", - "license": "MIT", "dependencies": { "unist-util-visit": "^2.0.0" }, @@ -13387,7 +13226,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "license": "MIT", "dependencies": { "@types/unist": "^2.0.2" }, @@ -13760,7 +13598,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.3.0.tgz", "integrity": "sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ==", - "license": "MIT", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } @@ -13769,7 +13606,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz", "integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==", - "license": "MIT", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" }, @@ -13783,7 +13619,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/use-latest/-/use-latest-1.2.1.tgz", "integrity": "sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw==", - "license": "MIT", "dependencies": { "use-isomorphic-layout-effect": "^1.1.1" }, @@ -13796,6 +13631,14 @@ } } }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -13812,7 +13655,6 @@ "version": "3.10.0", "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz", "integrity": "sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==", - "license": "MIT", "engines": { "node": ">= 4" } @@ -13854,7 +13696,6 @@ "version": "4.2.1", "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", "integrity": "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==", - "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -13870,7 +13711,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz", "integrity": "sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==", - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -13880,7 +13720,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", - "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^2.0.0" @@ -13940,7 +13779,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.4.tgz", "integrity": "sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -13949,8 +13787,7 @@ "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/webpack": { "version": "5.74.0", @@ -14500,7 +14337,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -14652,7 +14488,6 @@ "version": "1.6.11", "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", - "license": "MIT", "dependencies": { "sax": "^1.2.4" }, @@ -14700,7 +14535,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", "integrity": "sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -14709,95 +14543,95 @@ }, "dependencies": { "@algolia/autocomplete-core": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.7.2.tgz", - "integrity": "sha512-eclwUDC6qfApNnEfu1uWcL/rudQsn59tjEoUYZYE2JSXZrHLRjBUGMxiCoknobU2Pva8ejb0eRxpIYDtVVqdsw==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.7.4.tgz", + "integrity": "sha512-daoLpQ3ps/VTMRZDEBfU8ixXd+amZcNJ4QSP3IERGyzqnL5Ch8uSRFt/4G8pUvW9c3o6GA4vtVv4I4lmnkdXyg==", "requires": { - "@algolia/autocomplete-shared": "1.7.2" + "@algolia/autocomplete-shared": "1.7.4" } }, "@algolia/autocomplete-preset-algolia": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.7.2.tgz", - "integrity": "sha512-+RYEG6B0QiGGfRb2G3MtPfyrl0dALF3cQNTWBzBX6p5o01vCCGTTinAm2UKG3tfc2CnOMAtnPLkzNZyJUpnVJw==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.7.4.tgz", + "integrity": "sha512-s37hrvLEIfcmKY8VU9LsAXgm2yfmkdHT3DnA3SgHaY93yjZ2qL57wzb5QweVkYuEBZkT2PIREvRoLXC2sxTbpQ==", "requires": { - "@algolia/autocomplete-shared": "1.7.2" + "@algolia/autocomplete-shared": "1.7.4" } }, "@algolia/autocomplete-shared": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.7.2.tgz", - "integrity": "sha512-QCckjiC7xXHIUaIL3ektBtjJ0w7tTA3iqKcAE/Hjn1lZ5omp7i3Y4e09rAr9ZybqirL7AbxCLLq0Ra5DDPKeug==" + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.7.4.tgz", + "integrity": "sha512-2VGCk7I9tA9Ge73Km99+Qg87w0wzW4tgUruvWAn/gfey1ZXgmxZtyIRBebk35R1O8TbK77wujVtCnpsGpRy1kg==" }, "@algolia/cache-browser-local-storage": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.14.2.tgz", - "integrity": "sha512-FRweBkK/ywO+GKYfAWbrepewQsPTIEirhi1BdykX9mxvBPtGNKccYAxvGdDCumU1jL4r3cayio4psfzKMejBlA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.14.3.tgz", + "integrity": "sha512-hWH1yCxgG3+R/xZIscmUrWAIBnmBFHH5j30fY/+aPkEZWt90wYILfAHIOZ1/Wxhho5SkPfwFmT7ooX2d9JeQBw==", "requires": { - "@algolia/cache-common": "4.14.2" + "@algolia/cache-common": "4.14.3" } }, "@algolia/cache-common": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.14.2.tgz", - "integrity": "sha512-SbvAlG9VqNanCErr44q6lEKD2qoK4XtFNx9Qn8FK26ePCI8I9yU7pYB+eM/cZdS9SzQCRJBbHUumVr4bsQ4uxg==" + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.14.3.tgz", + "integrity": "sha512-oZJofOoD9FQOwiGTzyRnmzvh3ZP8WVTNPBLH5xU5JNF7drDbRT0ocVT0h/xB2rPHYzOeXRrLaQQBwRT/CKom0Q==" }, "@algolia/cache-in-memory": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.14.2.tgz", - "integrity": "sha512-HrOukWoop9XB/VFojPv1R5SVXowgI56T9pmezd/djh2JnVN/vXswhXV51RKy4nCpqxyHt/aGFSq2qkDvj6KiuQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.14.3.tgz", + "integrity": "sha512-ES0hHQnzWjeioLQf5Nq+x1AWdZJ50znNPSH3puB/Y4Xsg4Av1bvLmTJe7SY2uqONaeMTvL0OaVcoVtQgJVw0vg==", "requires": { - "@algolia/cache-common": "4.14.2" + "@algolia/cache-common": "4.14.3" } }, "@algolia/client-account": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.14.2.tgz", - "integrity": "sha512-WHtriQqGyibbb/Rx71YY43T0cXqyelEU0lB2QMBRXvD2X0iyeGl4qMxocgEIcbHyK7uqE7hKgjT8aBrHqhgc1w==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.14.3.tgz", + "integrity": "sha512-PBcPb0+f5Xbh5UfLZNx2Ow589OdP8WYjB4CnvupfYBrl9JyC1sdH4jcq/ri8osO/mCZYjZrQsKAPIqW/gQmizQ==", "requires": { - "@algolia/client-common": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "4.14.3", + "@algolia/client-search": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "@algolia/client-analytics": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.14.2.tgz", - "integrity": "sha512-yBvBv2mw+HX5a+aeR0dkvUbFZsiC4FKSnfqk9rrfX+QrlNOKEhCG0tJzjiOggRW4EcNqRmaTULIYvIzQVL2KYQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.14.3.tgz", + "integrity": "sha512-eAwQq0Hb/aauv9NhCH5Dp3Nm29oFx28sayFN2fdOWemwSeJHIl7TmcsxVlRsO50fsD8CtPcDhtGeD3AIFLNvqw==", "requires": { - "@algolia/client-common": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "4.14.3", + "@algolia/client-search": "4.14.3", + "@algolia/requester-common": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "@algolia/client-common": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.14.2.tgz", - "integrity": "sha512-43o4fslNLcktgtDMVaT5XwlzsDPzlqvqesRi4MjQz2x4/Sxm7zYg5LRYFol1BIhG6EwxKvSUq8HcC/KxJu3J0Q==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.14.3.tgz", + "integrity": "sha512-jkPPDZdi63IK64Yg4WccdCsAP4pHxSkr4usplkUZM5C1l1oEpZXsy2c579LQ0rvwCs5JFmwfNG4ahOszidfWPw==", "requires": { - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/requester-common": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "@algolia/client-personalization": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.14.2.tgz", - "integrity": "sha512-ACCoLi0cL8CBZ1W/2juehSltrw2iqsQBnfiu/Rbl9W2yE6o2ZUb97+sqN/jBqYNQBS+o0ekTMKNkQjHHAcEXNw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.14.3.tgz", + "integrity": "sha512-UCX1MtkVNgaOL9f0e22x6tC9e2H3unZQlSUdnVaSKpZ+hdSChXGaRjp2UIT7pxmPqNCyv51F597KEX5WT60jNg==", "requires": { - "@algolia/client-common": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "4.14.3", + "@algolia/requester-common": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "@algolia/client-search": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.14.2.tgz", - "integrity": "sha512-L5zScdOmcZ6NGiVbLKTvP02UbxZ0njd5Vq9nJAmPFtjffUSOGEp11BmD2oMJ5QvARgx2XbX4KzTTNS5ECYIMWw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.14.3.tgz", + "integrity": "sha512-I2U7xBx5OPFdPLA8AXKUPPxGY3HDxZ4r7+mlZ8ZpLbI8/ri6fnu6B4z3wcL7sgHhDYMwnAE8Xr0AB0h3Hnkp4A==", "requires": { - "@algolia/client-common": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "4.14.3", + "@algolia/requester-common": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "@algolia/events": { @@ -14806,47 +14640,47 @@ "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==" }, "@algolia/logger-common": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.14.2.tgz", - "integrity": "sha512-/JGlYvdV++IcMHBnVFsqEisTiOeEr6cUJtpjz8zc0A9c31JrtLm318Njc72p14Pnkw3A/5lHHh+QxpJ6WFTmsA==" + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.14.3.tgz", + "integrity": "sha512-kUEAZaBt/J3RjYi8MEBT2QEexJR2kAE2mtLmezsmqMQZTV502TkHCxYzTwY2dE7OKcUTxi4OFlMuS4GId9CWPw==" }, "@algolia/logger-console": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.14.2.tgz", - "integrity": "sha512-8S2PlpdshbkwlLCSAB5f8c91xyc84VM9Ar9EdfE9UmX+NrKNYnWR1maXXVDQQoto07G1Ol/tYFnFVhUZq0xV/g==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.14.3.tgz", + "integrity": "sha512-ZWqAlUITktiMN2EiFpQIFCJS10N96A++yrexqC2Z+3hgF/JcKrOxOdT4nSCQoEPvU4Ki9QKbpzbebRDemZt/hw==", "requires": { - "@algolia/logger-common": "4.14.2" + "@algolia/logger-common": "4.14.3" } }, "@algolia/requester-browser-xhr": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.14.2.tgz", - "integrity": "sha512-CEh//xYz/WfxHFh7pcMjQNWgpl4wFB85lUMRyVwaDPibNzQRVcV33YS+63fShFWc2+42YEipFGH2iPzlpszmDw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.14.3.tgz", + "integrity": "sha512-AZeg2T08WLUPvDncl2XLX2O67W5wIO8MNaT7z5ii5LgBTuk/rU4CikTjCe2xsUleIZeFl++QrPAi4Bdxws6r/Q==", "requires": { - "@algolia/requester-common": "4.14.2" + "@algolia/requester-common": "4.14.3" } }, "@algolia/requester-common": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.14.2.tgz", - "integrity": "sha512-73YQsBOKa5fvVV3My7iZHu1sUqmjjfs9TteFWwPwDmnad7T0VTCopttcsM3OjLxZFtBnX61Xxl2T2gmG2O4ehg==" + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.14.3.tgz", + "integrity": "sha512-RrRzqNyKFDP7IkTuV3XvYGF9cDPn9h6qEDl595lXva3YUk9YSS8+MGZnnkOMHvjkrSCKfoLeLbm/T4tmoIeclw==" }, "@algolia/requester-node-http": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.14.2.tgz", - "integrity": "sha512-oDbb02kd1o5GTEld4pETlPZLY0e+gOSWjWMJHWTgDXbv9rm/o2cF7japO6Vj1ENnrqWvLBmW1OzV9g6FUFhFXg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.14.3.tgz", + "integrity": "sha512-O5wnPxtDRPuW2U0EaOz9rMMWdlhwP0J0eSL1Z7TtXF8xnUeeUyNJrdhV5uy2CAp6RbhM1VuC3sOJcIR6Av+vbA==", "requires": { - "@algolia/requester-common": "4.14.2" + "@algolia/requester-common": "4.14.3" } }, "@algolia/transporter": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.14.2.tgz", - "integrity": "sha512-t89dfQb2T9MFQHidjHcfhh6iGMNwvuKUvojAj+JsrHAGbuSy7yE4BylhLX6R0Q1xYRoC4Vvv+O5qIw/LdnQfsQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.14.3.tgz", + "integrity": "sha512-2qlKlKsnGJ008exFRb5RTeTOqhLZj0bkMCMVskxoqWejs2Q2QtWmsiH98hDfpw0fmnyhzHEt0Z7lqxBYp8bW2w==", "requires": { - "@algolia/cache-common": "4.14.2", - "@algolia/logger-common": "4.14.2", - "@algolia/requester-common": "4.14.2" + "@algolia/cache-common": "4.14.3", + "@algolia/logger-common": "4.14.3", + "@algolia/requester-common": "4.14.3" } }, "@ampproject/remapping": { @@ -15937,25 +15771,25 @@ "optional": true }, "@docsearch/css": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.3.0.tgz", - "integrity": "sha512-rODCdDtGyudLj+Va8b6w6Y85KE85bXRsps/R4Yjwt5vueXKXZQKYw0aA9knxLBT6a/bI/GMrAcmCR75KYOM6hg==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.3.2.tgz", + "integrity": "sha512-dctFYiwbvDZkksMlsmc7pj6W6By/EjnVXJq5TEPd05MwQe+dcdHJgaIn1c8wfsucxHpIsdrUcgSkACHCq6aIhw==" }, "@docsearch/react": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.3.0.tgz", - "integrity": "sha512-fhS5adZkae2SSdMYEMVg6pxI5a/cE+tW16ki1V0/ur4Fdok3hBRkmN/H8VvlXnxzggkQIIRIVvYPn00JPjen3A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.3.2.tgz", + "integrity": "sha512-ugILab2TYKSh6IEHf6Z9xZbOovsYbsdfo60PBj+Bw+oMJ1MHJ7pBt1TTcmPki1hSgg8mysgKy2hDiVdPm7XWSQ==", "requires": { - "@algolia/autocomplete-core": "1.7.2", - "@algolia/autocomplete-preset-algolia": "1.7.2", - "@docsearch/css": "3.3.0", + "@algolia/autocomplete-core": "1.7.4", + "@algolia/autocomplete-preset-algolia": "1.7.4", + "@docsearch/css": "3.3.2", "algoliasearch": "^4.0.0" } }, "@docusaurus/core": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-2.2.0.tgz", - "integrity": "sha512-Vd6XOluKQqzG12fEs9prJgDtyn6DPok9vmUWDR2E6/nV5Fl9SVkhEQOBxwObjk3kQh7OY7vguFaLh0jqdApWsA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-2.3.0.tgz", + "integrity": "sha512-2AU5HfKyExO+/mi41SBnx5uY0aGZFXr3D93wntBY4lN1gsDKUpi7EE4lPBAXm9CoH4Pw6N24yDHy9CPR3sh/uA==", "requires": { "@babel/core": "^7.18.6", "@babel/generator": "^7.18.7", @@ -15967,13 +15801,13 @@ "@babel/runtime": "^7.18.6", "@babel/runtime-corejs3": "^7.18.6", "@babel/traverse": "^7.18.8", - "@docusaurus/cssnano-preset": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", + "@docusaurus/cssnano-preset": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", "@docusaurus/react-loadable": "5.5.2", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-common": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-common": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "@slorber/static-site-generator-webpack-plugin": "^4.0.7", "@svgr/webpack": "^6.2.1", "autoprefixer": "^10.4.7", @@ -16076,9 +15910,9 @@ } }, "@docusaurus/cssnano-preset": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-2.2.0.tgz", - "integrity": "sha512-mAAwCo4n66TMWBH1kXnHVZsakW9VAXJzTO4yZukuL3ro4F+JtkMwKfh42EG75K/J/YIFQG5I/Bzy0UH/hFxaTg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-2.3.0.tgz", + "integrity": "sha512-igmsXc1Q95lMeq07A1xua0/5wOPygDQ/ENSV7VVbiGhnvMv4gzkba8ZvbAtc7PmqK+kpYRfPzNCOk0GnQCvibg==", "requires": { "cssnano-preset-advanced": "^5.3.8", "postcss": "^8.4.14", @@ -16087,9 +15921,9 @@ } }, "@docusaurus/logger": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-2.2.0.tgz", - "integrity": "sha512-DF3j1cA5y2nNsu/vk8AG7xwpZu6f5MKkPPMaaIbgXLnWGfm6+wkOeW7kNrxnM95YOhKUkJUophX69nGUnLsm0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-2.3.0.tgz", + "integrity": "sha512-GO8s+FJpNT0vwt6kr/BZ/B1iB8EgHH/CF590i55Epy3TP2baQHGEHcAnQWvz5067OXIEke7Sa8sUNi0V9FrcJw==", "requires": { "chalk": "^4.1.2", "tslib": "^2.4.0" @@ -16141,14 +15975,14 @@ } }, "@docusaurus/mdx-loader": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-2.2.0.tgz", - "integrity": "sha512-X2bzo3T0jW0VhUU+XdQofcEeozXOTmKQMvc8tUnWRdTnCvj4XEcBVdC3g+/jftceluiwSTNRAX4VBOJdNt18jA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-2.3.0.tgz", + "integrity": "sha512-uxownG7dlg/l19rTIfUP0KDsbI8lTCgziWsdubMcWpGvOgXgm1p4mKSmWPzAwkRENn+un4L8DBhl3j1toeJy1A==", "requires": { "@babel/parser": "^7.18.8", "@babel/traverse": "^7.18.8", - "@docusaurus/logger": "2.2.0", - "@docusaurus/utils": "2.2.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/utils": "2.3.0", "@mdx-js/mdx": "^1.6.22", "escape-html": "^1.0.3", "file-loader": "^6.2.0", @@ -16165,12 +15999,12 @@ } }, "@docusaurus/module-type-aliases": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-2.2.0.tgz", - "integrity": "sha512-wDGW4IHKoOr9YuJgy7uYuKWrDrSpsUSDHLZnWQYM9fN7D5EpSmYHjFruUpKWVyxLpD/Wh0rW8hYZwdjJIQUQCQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-2.3.0.tgz", + "integrity": "sha512-DvJtVejgrgIgxSNZ0pRaVu4EndRVBgbtp1LKvIO4xBgKlrsq8o4qkj1HKwH6yok5NoMqGApu8/E0KPOdZBtDpQ==", "requires": { "@docusaurus/react-loadable": "5.5.2", - "@docusaurus/types": "2.2.0", + "@docusaurus/types": "2.3.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -16180,17 +16014,17 @@ } }, "@docusaurus/plugin-content-blog": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.2.0.tgz", - "integrity": "sha512-0mWBinEh0a5J2+8ZJXJXbrCk1tSTNf7Nm4tYAl5h2/xx+PvH/Bnu0V+7mMljYm/1QlDYALNIIaT/JcoZQFUN3w==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.3.0.tgz", + "integrity": "sha512-/v+nWEaqRxH1U4I6uJIMdj8Iilrh0XwIG5vsmsi4AXbpArgqqyfMjbf70lzPOmSdYfdWYgb7tWcA6OhJqyKj0w==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-common": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-common": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "cheerio": "^1.0.0-rc.12", "feed": "^4.2.2", "fs-extra": "^10.1.0", @@ -16203,17 +16037,17 @@ } }, "@docusaurus/plugin-content-docs": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.2.0.tgz", - "integrity": "sha512-BOazBR0XjzsHE+2K1wpNxz5QZmrJgmm3+0Re0EVPYFGW8qndCWGNtXW/0lGKhecVPML8yyFeAmnUCIs7xM2wPw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.3.0.tgz", + "integrity": "sha512-P53gYvtPY/VJTMdV5pFnKv8d7qMBOPyu/4NPREQU5PWsXJOYedCwNBqdAR7A5P69l55TrzyUEUYLjIcwuoSPGg==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/module-type-aliases": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/module-type-aliases": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "@types/react-router-config": "^5.0.6", "combine-promises": "^1.1.0", "fs-extra": "^10.1.0", @@ -16226,88 +16060,100 @@ } }, "@docusaurus/plugin-content-pages": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.2.0.tgz", - "integrity": "sha512-+OTK3FQHk5WMvdelz8v19PbEbx+CNT6VSpx7nVOvMNs5yJCKvmqBJBQ2ZSxROxhVDYn+CZOlmyrC56NSXzHf6g==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.3.0.tgz", + "integrity": "sha512-H21Ux3Ln+pXlcp0RGdD1fyes7H3tsyhFpeflkxnCoXfTQf/pQB9IMuddFnxuXzj+34rp6jAQmLSaPssuixJXRQ==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "fs-extra": "^10.1.0", "tslib": "^2.4.0", "webpack": "^5.73.0" } }, "@docusaurus/plugin-debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-2.2.0.tgz", - "integrity": "sha512-p9vOep8+7OVl6r/NREEYxf4HMAjV8JMYJ7Bos5fCFO0Wyi9AZEo0sCTliRd7R8+dlJXZEgcngSdxAUo/Q+CJow==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-2.3.0.tgz", + "integrity": "sha512-TyeH3DMA9/8sIXyX8+zpdLtSixBnLJjW9KSvncKj/iXs1t20tpUZ1WFL7D+G1gxGGbLCBUGDluh738VvsRHC6Q==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", "fs-extra": "^10.1.0", "react-json-view": "^1.21.3", "tslib": "^2.4.0" } }, "@docusaurus/plugin-google-analytics": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.2.0.tgz", - "integrity": "sha512-+eZVVxVeEnV5nVQJdey9ZsfyEVMls6VyWTIj8SmX0k5EbqGvnIfET+J2pYEuKQnDIHxy+syRMoRM6AHXdHYGIg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.3.0.tgz", + "integrity": "sha512-Z9FqTQzeOC1R6i/x07VgkrTKpQ4OtMe3WBOKZKzgldWXJr6CDUWPSR8pfDEjA+RRAj8ajUh0E+BliKBmFILQvQ==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "tslib": "^2.4.0" } }, "@docusaurus/plugin-google-gtag": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.2.0.tgz", - "integrity": "sha512-6SOgczP/dYdkqUMGTRqgxAS1eTp6MnJDAQMy8VCF1QKbWZmlkx4agHDexihqmYyCujTYHqDAhm1hV26EET54NQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.3.0.tgz", + "integrity": "sha512-oZavqtfwQAGjz+Dyhsb45mVssTevCW1PJgLcmr3WKiID15GTolbBrrp/fueTrEh60DzOd81HbiCLs56JWBwDhQ==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", + "tslib": "^2.4.0" + } + }, + "@docusaurus/plugin-google-tag-manager": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-2.3.0.tgz", + "integrity": "sha512-toAhuMX1h+P2CfavwoDlz9s2/Zm7caiEznW/inxq3izywG2l9ujWI/o6u2g70O3ACQ19eHMGHDsyEUcRDPrxBw==", + "requires": { + "@docusaurus/core": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "tslib": "^2.4.0" } }, "@docusaurus/plugin-sitemap": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.2.0.tgz", - "integrity": "sha512-0jAmyRDN/aI265CbWZNZuQpFqiZuo+5otk2MylU9iVrz/4J7gSc+ZJ9cy4EHrEsW7PV8s1w18hIEsmcA1YgkKg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.3.0.tgz", + "integrity": "sha512-kwIHLP6lyubWOnNO0ejwjqdxB9C6ySnATN61etd6iwxHri5+PBZCEOv1sVm5U1gfQiDR1sVsXnJq2zNwLwgEtQ==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-common": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-common": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "fs-extra": "^10.1.0", "sitemap": "^7.1.1", "tslib": "^2.4.0" } }, "@docusaurus/preset-classic": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-2.2.0.tgz", - "integrity": "sha512-yKIWPGNx7BT8v2wjFIWvYrS+nvN04W+UameSFf8lEiJk6pss0kL6SG2MRvyULiI3BDxH+tj6qe02ncpSPGwumg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-2.3.0.tgz", + "integrity": "sha512-mI37ieJe7cs5dHuvWz415U7hO209Q19Fp4iSHeFFgtQoK1PiRg7HJHkVbEsLZII2MivdzGFB5Hxoq2wUPWdNEA==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/plugin-content-blog": "2.2.0", - "@docusaurus/plugin-content-docs": "2.2.0", - "@docusaurus/plugin-content-pages": "2.2.0", - "@docusaurus/plugin-debug": "2.2.0", - "@docusaurus/plugin-google-analytics": "2.2.0", - "@docusaurus/plugin-google-gtag": "2.2.0", - "@docusaurus/plugin-sitemap": "2.2.0", - "@docusaurus/theme-classic": "2.2.0", - "@docusaurus/theme-common": "2.2.0", - "@docusaurus/theme-search-algolia": "2.2.0", - "@docusaurus/types": "2.2.0" + "@docusaurus/core": "2.3.0", + "@docusaurus/plugin-content-blog": "2.3.0", + "@docusaurus/plugin-content-docs": "2.3.0", + "@docusaurus/plugin-content-pages": "2.3.0", + "@docusaurus/plugin-debug": "2.3.0", + "@docusaurus/plugin-google-analytics": "2.3.0", + "@docusaurus/plugin-google-gtag": "2.3.0", + "@docusaurus/plugin-google-tag-manager": "2.3.0", + "@docusaurus/plugin-sitemap": "2.3.0", + "@docusaurus/theme-classic": "2.3.0", + "@docusaurus/theme-common": "2.3.0", + "@docusaurus/theme-search-algolia": "2.3.0", + "@docusaurus/types": "2.3.0" } }, "@docusaurus/react-loadable": { @@ -16320,22 +16166,22 @@ } }, "@docusaurus/theme-classic": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-2.2.0.tgz", - "integrity": "sha512-kjbg/qJPwZ6H1CU/i9d4l/LcFgnuzeiGgMQlt6yPqKo0SOJIBMPuz7Rnu3r/WWbZFPi//o8acclacOzmXdUUEg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-2.3.0.tgz", + "integrity": "sha512-x2h9KZ4feo22b1aArsfqvK05aDCgTkLZGRgAPY/9TevFV5/Yy19cZtBOCbzaKa2dKq1ofBRK9Hm1DdLJdLB14A==", "requires": { - "@docusaurus/core": "2.2.0", - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/module-type-aliases": "2.2.0", - "@docusaurus/plugin-content-blog": "2.2.0", - "@docusaurus/plugin-content-docs": "2.2.0", - "@docusaurus/plugin-content-pages": "2.2.0", - "@docusaurus/theme-common": "2.2.0", - "@docusaurus/theme-translations": "2.2.0", - "@docusaurus/types": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-common": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/module-type-aliases": "2.3.0", + "@docusaurus/plugin-content-blog": "2.3.0", + "@docusaurus/plugin-content-docs": "2.3.0", + "@docusaurus/plugin-content-pages": "2.3.0", + "@docusaurus/theme-common": "2.3.0", + "@docusaurus/theme-translations": "2.3.0", + "@docusaurus/types": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-common": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", "copy-text-to-clipboard": "^3.0.1", @@ -16352,16 +16198,16 @@ } }, "@docusaurus/theme-common": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-2.2.0.tgz", - "integrity": "sha512-R8BnDjYoN90DCL75gP7qYQfSjyitXuP9TdzgsKDmSFPNyrdE3twtPNa2dIN+h+p/pr+PagfxwWbd6dn722A1Dw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-2.3.0.tgz", + "integrity": "sha512-1eAvaULgu6ywHbjkdWOOHl1PdMylne/88i0kg25qimmkMgRHoIQ23JgRD/q5sFr+2YX7U7SggR1UNNsqu2zZPw==", "requires": { - "@docusaurus/mdx-loader": "2.2.0", - "@docusaurus/module-type-aliases": "2.2.0", - "@docusaurus/plugin-content-blog": "2.2.0", - "@docusaurus/plugin-content-docs": "2.2.0", - "@docusaurus/plugin-content-pages": "2.2.0", - "@docusaurus/utils": "2.2.0", + "@docusaurus/mdx-loader": "2.3.0", + "@docusaurus/module-type-aliases": "2.3.0", + "@docusaurus/plugin-content-blog": "2.3.0", + "@docusaurus/plugin-content-docs": "2.3.0", + "@docusaurus/plugin-content-pages": "2.3.0", + "@docusaurus/utils": "2.3.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -16369,22 +16215,23 @@ "parse-numeric-range": "^1.3.0", "prism-react-renderer": "^1.3.5", "tslib": "^2.4.0", + "use-sync-external-store": "^1.2.0", "utility-types": "^3.10.0" } }, "@docusaurus/theme-search-algolia": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.2.0.tgz", - "integrity": "sha512-2h38B0tqlxgR2FZ9LpAkGrpDWVdXZ7vltfmTdX+4RsDs3A7khiNsmZB+x/x6sA4+G2V2CvrsPMlsYBy5X+cY1w==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.3.0.tgz", + "integrity": "sha512-/i5k1NAlbYvgnw69vJQA174+ipwdtTCCUvxRp7bVZ+8KmviEybAC/kuKe7WmiUbIGVYbAbwYaEsPuVnsd65DrA==", "requires": { "@docsearch/react": "^3.1.1", - "@docusaurus/core": "2.2.0", - "@docusaurus/logger": "2.2.0", - "@docusaurus/plugin-content-docs": "2.2.0", - "@docusaurus/theme-common": "2.2.0", - "@docusaurus/theme-translations": "2.2.0", - "@docusaurus/utils": "2.2.0", - "@docusaurus/utils-validation": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/plugin-content-docs": "2.3.0", + "@docusaurus/theme-common": "2.3.0", + "@docusaurus/theme-translations": "2.3.0", + "@docusaurus/utils": "2.3.0", + "@docusaurus/utils-validation": "2.3.0", "algoliasearch": "^4.13.1", "algoliasearch-helper": "^3.10.0", "clsx": "^1.2.1", @@ -16396,18 +16243,18 @@ } }, "@docusaurus/theme-translations": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-2.2.0.tgz", - "integrity": "sha512-3T140AG11OjJrtKlY4pMZ5BzbGRDjNs2co5hJ6uYJG1bVWlhcaFGqkaZ5lCgKflaNHD7UHBHU9Ec5f69jTdd6w==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-2.3.0.tgz", + "integrity": "sha512-YLVD6LrszBld1EvThTOa9PcblKAZs1jOmRjwtffdg1CGjQWFXEeWUL24n2M4ARByzuLry5D8ZRVmKyRt3LOwsw==", "requires": { "fs-extra": "^10.1.0", "tslib": "^2.4.0" } }, "@docusaurus/types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-2.2.0.tgz", - "integrity": "sha512-b6xxyoexfbRNRI8gjblzVOnLr4peCJhGbYGPpJ3LFqpi5nsFfoK4mmDLvWdeah0B7gmJeXabN7nQkFoqeSdmOw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-2.3.0.tgz", + "integrity": "sha512-c5C0nROxVFsgMAm4vWDB1LDv3v4K18Y8eVxazL3dEr7w+7kNLc5koWrW7fWmCnrbItnuTna4nLS2PcSZrkYidg==", "requires": { "@types/history": "^4.7.11", "@types/react": "*", @@ -16420,12 +16267,13 @@ } }, "@docusaurus/utils": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-2.2.0.tgz", - "integrity": "sha512-oNk3cjvx7Tt1Lgh/aeZAmFpGV2pDr5nHKrBVx6hTkzGhrnMuQqLt6UPlQjdYQ3QHXwyF/ZtZMO1D5Pfi0lu7SA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-2.3.0.tgz", + "integrity": "sha512-6+GCurDsePHHbLM3ktcjv8N4zrjgrl1O7gOQNG4UMktcwHssFFVm+geVcB4M8siOmwUjV2VaNrp0hpGy8DOQHw==", "requires": { - "@docusaurus/logger": "2.2.0", + "@docusaurus/logger": "2.3.0", "@svgr/webpack": "^6.2.1", + "escape-string-regexp": "^4.0.0", "file-loader": "^6.2.0", "fs-extra": "^10.1.0", "github-slugger": "^1.4.0", @@ -16439,23 +16287,30 @@ "tslib": "^2.4.0", "url-loader": "^4.1.1", "webpack": "^5.73.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + } } }, "@docusaurus/utils-common": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-2.2.0.tgz", - "integrity": "sha512-qebnerHp+cyovdUseDQyYFvMW1n1nv61zGe5JJfoNQUnjKuApch3IVsz+/lZ9a38pId8kqehC1Ao2bW/s0ntDA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-2.3.0.tgz", + "integrity": "sha512-nu5An+26FS7SQTwvyFR4g9lw3NU1u2RLcxJPZF+NCOG8Ne96ciuQosa7+N1kllm/heEJqfTaAUD0sFxpTZrDtw==", "requires": { "tslib": "^2.4.0" } }, "@docusaurus/utils-validation": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-2.2.0.tgz", - "integrity": "sha512-I1hcsG3yoCkasOL5qQAYAfnmVoLei7apugT6m4crQjmDGxq+UkiRrq55UqmDDyZlac/6ax/JC0p+usZ6W4nVyg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-2.3.0.tgz", + "integrity": "sha512-TBJCLqwAoiQQJ6dbgBpuLvzsn/XiTgbZkd6eJFUIQYLb1d473Zv58QrHXVmVQDLWiCgmJpHW2LpMfumTpCDgJw==", "requires": { - "@docusaurus/logger": "2.2.0", - "@docusaurus/utils": "2.2.0", + "@docusaurus/logger": "2.3.0", + "@docusaurus/utils": "2.3.0", "joi": "^17.6.0", "js-yaml": "^4.1.0", "tslib": "^2.4.0" @@ -17300,30 +17155,30 @@ "requires": {} }, "algoliasearch": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.14.2.tgz", - "integrity": "sha512-ngbEQonGEmf8dyEh5f+uOIihv4176dgbuOZspiuhmTTBRBuzWu3KCGHre6uHj5YyuC7pNvQGzB6ZNJyZi0z+Sg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.14.3.tgz", + "integrity": "sha512-GZTEuxzfWbP/vr7ZJfGzIl8fOsoxN916Z6FY2Egc9q2TmZ6hvq5KfAxY89pPW01oW/2HDEKA8d30f9iAH9eXYg==", "requires": { - "@algolia/cache-browser-local-storage": "4.14.2", - "@algolia/cache-common": "4.14.2", - "@algolia/cache-in-memory": "4.14.2", - "@algolia/client-account": "4.14.2", - "@algolia/client-analytics": "4.14.2", - "@algolia/client-common": "4.14.2", - "@algolia/client-personalization": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/logger-common": "4.14.2", - "@algolia/logger-console": "4.14.2", - "@algolia/requester-browser-xhr": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/requester-node-http": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/cache-browser-local-storage": "4.14.3", + "@algolia/cache-common": "4.14.3", + "@algolia/cache-in-memory": "4.14.3", + "@algolia/client-account": "4.14.3", + "@algolia/client-analytics": "4.14.3", + "@algolia/client-common": "4.14.3", + "@algolia/client-personalization": "4.14.3", + "@algolia/client-search": "4.14.3", + "@algolia/logger-common": "4.14.3", + "@algolia/logger-console": "4.14.3", + "@algolia/requester-browser-xhr": "4.14.3", + "@algolia/requester-common": "4.14.3", + "@algolia/requester-node-http": "4.14.3", + "@algolia/transporter": "4.14.3" } }, "algoliasearch-helper": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.11.1.tgz", - "integrity": "sha512-mvsPN3eK4E0bZG0/WlWJjeqe/bUD2KOEVOl0GyL/TGXn6wcpZU8NOuztGHCUKXkyg5gq6YzUakVTmnmSSO5Yiw==", + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.11.3.tgz", + "integrity": "sha512-TbaEvLwiuGygHQIB8y+OsJKQQ40+JKUua5B91X66tMUHyyhbNHvqyr0lqd3wCoyKx7WybyQrC0WJvzoIeh24Aw==", "requires": { "@algolia/events": "^4.0.1" } @@ -19708,7 +19563,9 @@ } }, "github-slugger": { - "version": "1.4.0" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.5.0.tgz", + "integrity": "sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==" }, "glob": { "version": "7.2.2", @@ -21220,9 +21077,9 @@ "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==" }, "parse5": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz", - "integrity": "sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "requires": { "entities": "^4.4.0" }, @@ -22176,7 +22033,9 @@ } }, "react-textarea-autosize": { - "version": "8.3.4", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.4.0.tgz", + "integrity": "sha512-YrTFaEHLgJsi8sJVYHBzYn+mkP3prGkmP2DKb/tm0t7CLJY5t1Rxix8070LAKb0wby7bl/lf2EeHkuMihMZMwQ==", "requires": { "@babel/runtime": "^7.10.2", "use-composed-ref": "^1.3.0", @@ -23753,6 +23612,12 @@ "use-isomorphic-layout-effect": "^1.1.1" } }, + "use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "requires": {} + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/website/package.json b/website/package.json index 0cb897b46..4f64d0b6f 100644 --- a/website/package.json +++ b/website/package.json @@ -14,9 +14,9 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@docusaurus/core": "2.2.0", - "@docusaurus/plugin-google-gtag": "^2.2.0", - "@docusaurus/preset-classic": "2.2.0", + "@docusaurus/core": "2.3.0", + "@docusaurus/plugin-google-gtag": "^2.3.0", + "@docusaurus/preset-classic": "2.3.0", "@loadable/component": "^5.15.2", "@mdx-js/react": "^1.6.22", "animate.css": "^4.1.1", @@ -35,7 +35,7 @@ "wow.js": "^1.2.2" }, "devDependencies": { - "@docusaurus/module-type-aliases": "2.2.0", + "@docusaurus/module-type-aliases": "2.3.0", "@iconify/react": "^4.0.1", "autoprefixer": "^10.4.13", "postcss": "^8.4.21", From 57accfc9c4879c03398c43ca09e9a72d00cb4cae Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Fri, 27 Jan 2023 14:48:30 -0800 Subject: [PATCH 15/36] Use mocks to test getting drive info from Graph API (#2306) ## Description Make a separate interface for fetching drive information from Graph API. Interface allows for better testing via mocks Merges SharePoint and OneDrive code for getting drives. Also fixes potential bug where not all drives would be fetched. This could have occurred because the previous implementation for both SharePoint and OneDrive were not checking for paginated results Viewing by commit is recommended ## Does this PR need a docs update or release note? - [x] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [ ] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [x] :robot: Test - [ ] :computer: CI/Deployment - [x] :broom: Tech Debt/Cleanup ## Issue(s) * #2264 ## Test Plan - [ ] :muscle: Manual - [x] :zap: Unit test - [ ] :green_heart: E2E --- CHANGELOG.md | 1 + src/cmd/purge/purge.go | 7 +- src/internal/connector/onedrive/api/drive.go | 108 ++++++ .../connector/onedrive/collections.go | 9 +- src/internal/connector/onedrive/drive.go | 146 ++++---- src/internal/connector/onedrive/drive_test.go | 312 +++++++++++++++++- src/internal/connector/onedrive/item_test.go | 5 +- 7 files changed, 520 insertions(+), 68 deletions(-) create mode 100644 src/internal/connector/onedrive/api/drive.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f1eb0fd2..696b33e9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Remove the M365 license guid check in OneDrive backup which wasn't reliable. - Reduced extra socket consumption while downloading multiple drive files. - Extended timeout boundaries for exchange attachment downloads, reducing risk of cancellation on large files. +- Identify all drives associated with a user or SharePoint site instead of just the results on the first page returned by Graph API. ## [v0.1.0] (alpha) - 2023-01-13 diff --git a/src/cmd/purge/purge.go b/src/cmd/purge/purge.go index 3d7074835..cb9c9976f 100644 --- a/src/cmd/purge/purge.go +++ b/src/cmd/purge/purge.go @@ -151,7 +151,12 @@ func purgeOneDriveFolders( uid string, ) error { getter := func(gs graph.Servicer, uid, prefix string) ([]purgable, error) { - cfs, err := onedrive.GetAllFolders(ctx, gs, uid, prefix) + pager, err := onedrive.PagerForSource(onedrive.OneDriveSource, gs, uid, nil) + if err != nil { + return nil, err + } + + cfs, err := onedrive.GetAllFolders(ctx, gs, pager, prefix) if err != nil { return nil, err } diff --git a/src/internal/connector/onedrive/api/drive.go b/src/internal/connector/onedrive/api/drive.go new file mode 100644 index 000000000..7e5cfcaac --- /dev/null +++ b/src/internal/connector/onedrive/api/drive.go @@ -0,0 +1,108 @@ +package api + +import ( + "context" + + "github.com/microsoftgraph/msgraph-sdk-go/models" + mssites "github.com/microsoftgraph/msgraph-sdk-go/sites" + msusers "github.com/microsoftgraph/msgraph-sdk-go/users" + "github.com/pkg/errors" + + "github.com/alcionai/corso/src/internal/connector/graph" +) + +type PageLinker interface { + GetOdataNextLink() *string +} + +type userDrivePager struct { + gs graph.Servicer + builder *msusers.ItemDrivesRequestBuilder + options *msusers.ItemDrivesRequestBuilderGetRequestConfiguration +} + +func NewUserDrivePager( + gs graph.Servicer, + userID string, + fields []string, +) *userDrivePager { + requestConfig := &msusers.ItemDrivesRequestBuilderGetRequestConfiguration{ + QueryParameters: &msusers.ItemDrivesRequestBuilderGetQueryParameters{ + Select: fields, + }, + } + + res := &userDrivePager{ + gs: gs, + options: requestConfig, + builder: gs.Client().UsersById(userID).Drives(), + } + + return res +} + +func (p *userDrivePager) GetPage(ctx context.Context) (PageLinker, error) { + return p.builder.Get(ctx, p.options) +} + +func (p *userDrivePager) SetNext(link string) { + p.builder = msusers.NewItemDrivesRequestBuilder(link, p.gs.Adapter()) +} + +func (p *userDrivePager) ValuesIn(l PageLinker) ([]models.Driveable, error) { + page, ok := l.(interface{ GetValue() []models.Driveable }) + if !ok { + return nil, errors.Errorf( + "response of type [%T] does not comply with GetValue() interface", + l, + ) + } + + return page.GetValue(), nil +} + +type siteDrivePager struct { + gs graph.Servicer + builder *mssites.ItemDrivesRequestBuilder + options *mssites.ItemDrivesRequestBuilderGetRequestConfiguration +} + +func NewSiteDrivePager( + gs graph.Servicer, + siteID string, + fields []string, +) *siteDrivePager { + requestConfig := &mssites.ItemDrivesRequestBuilderGetRequestConfiguration{ + QueryParameters: &mssites.ItemDrivesRequestBuilderGetQueryParameters{ + Select: fields, + }, + } + + res := &siteDrivePager{ + gs: gs, + options: requestConfig, + builder: gs.Client().SitesById(siteID).Drives(), + } + + return res +} + +func (p *siteDrivePager) GetPage(ctx context.Context) (PageLinker, error) { + return p.builder.Get(ctx, p.options) +} + +func (p *siteDrivePager) SetNext(link string) { + p.builder = mssites.NewItemDrivesRequestBuilder(link, p.gs.Adapter()) +} + +func (p *siteDrivePager) ValuesIn(l PageLinker) ([]models.Driveable, error) { + page, ok := l.(interface{ GetValue() []models.Driveable }) + if !ok { + return nil, errors.Errorf( + "response of type [%T] does not comply with GetValue() interface", + l, + ) + } + + return page.GetValue(), nil +} diff --git a/src/internal/connector/onedrive/collections.go b/src/internal/connector/onedrive/collections.go index 8761a37ca..0813c13ed 100644 --- a/src/internal/connector/onedrive/collections.go +++ b/src/internal/connector/onedrive/collections.go @@ -95,7 +95,14 @@ func NewCollections( // Retrieves drive data as set of `data.Collections` func (c *Collections) Get(ctx context.Context) ([]data.Collection, error) { // Enumerate drives for the specified resourceOwner - drives, err := drives(ctx, c.service, c.resourceOwner, c.source) + pager, err := PagerForSource(c.source, c.service, c.resourceOwner, nil) + if err != nil { + return nil, err + } + + retry := c.source == OneDriveSource + + drives, err := drives(ctx, pager, retry) if err != nil { return nil, err } diff --git a/src/internal/connector/onedrive/drive.go b/src/internal/connector/onedrive/drive.go index c765e3719..4bc56aec0 100644 --- a/src/internal/connector/onedrive/drive.go +++ b/src/internal/connector/onedrive/drive.go @@ -10,11 +10,11 @@ import ( msdrives "github.com/microsoftgraph/msgraph-sdk-go/drives" "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" - "github.com/microsoftgraph/msgraph-sdk-go/sites" "github.com/pkg/errors" "golang.org/x/exp/maps" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/onedrive/api" "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/pkg/logger" ) @@ -22,86 +22,106 @@ import ( var errFolderNotFound = errors.New("folder not found") const ( + getDrivesRetries = 3 + // nextLinkKey is used to find the next link in a paged // graph response - nextLinkKey = "@odata.nextLink" - itemChildrenRawURLFmt = "https://graph.microsoft.com/v1.0/drives/%s/items/%s/children" - itemByPathRawURLFmt = "https://graph.microsoft.com/v1.0/drives/%s/items/%s:/%s" - itemNotFoundErrorCode = "itemNotFound" - userMysiteURLNotFound = "BadRequest Unable to retrieve user's mysite URL" - userMysiteNotFound = "ResourceNotFound User's mysite not found" + nextLinkKey = "@odata.nextLink" + itemChildrenRawURLFmt = "https://graph.microsoft.com/v1.0/drives/%s/items/%s/children" + itemByPathRawURLFmt = "https://graph.microsoft.com/v1.0/drives/%s/items/%s:/%s" + itemNotFoundErrorCode = "itemNotFound" + userMysiteURLNotFound = "BadRequest Unable to retrieve user's mysite URL" + userMysiteNotFound = "ResourceNotFound User's mysite not found" + contextDeadlineExceeded = "context deadline exceeded" ) -// Enumerates the drives for the specified user -func drives( - ctx context.Context, - service graph.Servicer, - resourceOwner string, +type drivePager interface { + GetPage(context.Context) (api.PageLinker, error) + SetNext(nextLink string) + ValuesIn(api.PageLinker) ([]models.Driveable, error) +} + +func PagerForSource( source driveSource, -) ([]models.Driveable, error) { + servicer graph.Servicer, + resourceOwner string, + fields []string, +) (drivePager, error) { switch source { case OneDriveSource: - return userDrives(ctx, service, resourceOwner) + return api.NewUserDrivePager(servicer, resourceOwner, fields), nil case SharePointSource: - return siteDrives(ctx, service, resourceOwner) + return api.NewSiteDrivePager(servicer, resourceOwner, fields), nil default: return nil, errors.Errorf("unrecognized drive data source") } } -func siteDrives(ctx context.Context, service graph.Servicer, site string) ([]models.Driveable, error) { - options := &sites.ItemDrivesRequestBuilderGetRequestConfiguration{ - QueryParameters: &sites.ItemDrivesRequestBuilderGetQueryParameters{ - Select: []string{"id", "name", "weburl", "system"}, - }, - } - - r, err := service.Client().SitesById(site).Drives().Get(ctx, options) - if err != nil { - return nil, errors.Wrapf(err, "failed to retrieve site drives. site: %s, details: %s", - site, support.ConnectorStackErrorTrace(err)) - } - - return r.GetValue(), nil -} - -func userDrives(ctx context.Context, service graph.Servicer, user string) ([]models.Driveable, error) { +func drives( + ctx context.Context, + pager drivePager, + retry bool, +) ([]models.Driveable, error) { var ( - numberOfRetries = 3 - r models.DriveCollectionResponseable err error + page api.PageLinker + numberOfRetries = getDrivesRetries + drives = []models.Driveable{} ) - // Retry Loop for Drive retrieval. Request can timeout - for i := 0; i <= numberOfRetries; i++ { - r, err = service.Client().UsersById(user).Drives().Get(ctx, nil) - if err != nil { - detailedError := support.ConnectorStackErrorTrace(err) - if strings.Contains(detailedError, userMysiteURLNotFound) || - strings.Contains(detailedError, userMysiteNotFound) { - logger.Ctx(ctx).Infof("User %s does not have a drive", user) - return make([]models.Driveable, 0), nil // no license - } - - if strings.Contains(detailedError, "context deadline exceeded") && i < numberOfRetries { - time.Sleep(time.Duration(3*(i+1)) * time.Second) - continue - } - - return nil, errors.Wrapf( - err, - "failed to retrieve user drives. user: %s, details: %s", - user, - detailedError, - ) - } - - break + if !retry { + numberOfRetries = 0 } - logger.Ctx(ctx).Debugf("Found %d drives for user %s", len(r.GetValue()), user) + // Loop through all pages returned by Graph API. + for { + // Retry Loop for Drive retrieval. Request can timeout + for i := 0; i <= numberOfRetries; i++ { + page, err = pager.GetPage(ctx) + if err != nil { + // Various error handling. May return an error or perform a retry. + detailedError := support.ConnectorStackErrorTrace(err) + if strings.Contains(detailedError, userMysiteURLNotFound) || + strings.Contains(detailedError, userMysiteNotFound) { + logger.Ctx(ctx).Infof("resource owner does not have a drive") + return make([]models.Driveable, 0), nil // no license or drives. + } - return r.GetValue(), nil + if strings.Contains(detailedError, contextDeadlineExceeded) && i < numberOfRetries { + time.Sleep(time.Duration(3*(i+1)) * time.Second) + continue + } + + return nil, errors.Wrapf( + err, + "failed to retrieve drives. details: %s", + detailedError, + ) + } + + // No error encountered, break the retry loop so we can extract results + // and see if there's another page to fetch. + break + } + + tmp, err := pager.ValuesIn(page) + if err != nil { + return nil, errors.Wrap(err, "extracting drives from response") + } + + drives = append(drives, tmp...) + + nextLink := page.GetOdataNextLink() + if nextLink == nil || len(*nextLink) == 0 { + break + } + + pager.SetNext(*nextLink) + } + + logger.Ctx(ctx).Debugf("Found %d drives", len(drives)) + + return drives, nil } // itemCollector functions collect the items found in a drive @@ -284,10 +304,10 @@ func (op *Displayable) GetDisplayName() *string { func GetAllFolders( ctx context.Context, gs graph.Servicer, - userID string, + pager drivePager, prefix string, ) ([]*Displayable, error) { - drives, err := drives(ctx, gs, userID, OneDriveSource) + drives, err := drives(ctx, pager, true) if err != nil { return nil, errors.Wrap(err, "getting OneDrive folders") } diff --git a/src/internal/connector/onedrive/drive_test.go b/src/internal/connector/onedrive/drive_test.go index 631381240..6ace0c3c2 100644 --- a/src/internal/connector/onedrive/drive_test.go +++ b/src/internal/connector/onedrive/drive_test.go @@ -1,21 +1,323 @@ package onedrive import ( + "context" "strings" "testing" + "github.com/google/uuid" + "github.com/microsoftgraph/msgraph-sdk-go/models" + "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/internal/common" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/onedrive/api" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/selectors" ) +type mockPageLinker struct { + link *string +} + +func (pl *mockPageLinker) GetOdataNextLink() *string { + return pl.link +} + +type pagerResult struct { + drives []models.Driveable + nextLink *string + err error +} + +type mockDrivePager struct { + toReturn []pagerResult + getIdx int +} + +func (p *mockDrivePager) GetPage(context.Context) (api.PageLinker, error) { + if len(p.toReturn) <= p.getIdx { + return nil, assert.AnError + } + + idx := p.getIdx + p.getIdx++ + + return &mockPageLinker{p.toReturn[idx].nextLink}, p.toReturn[idx].err +} + +func (p *mockDrivePager) SetNext(string) {} + +func (p *mockDrivePager) ValuesIn(api.PageLinker) ([]models.Driveable, error) { + idx := p.getIdx + if idx > 0 { + // Return values lag by one since we increment in GetPage(). + idx-- + } + + if len(p.toReturn) <= idx { + return nil, assert.AnError + } + + return p.toReturn[idx].drives, nil +} + +// Unit tests +type OneDriveUnitSuite struct { + suite.Suite +} + +func TestOneDriveUnitSuite(t *testing.T) { + suite.Run(t, new(OneDriveUnitSuite)) +} + +func (suite *OneDriveUnitSuite) TestDrives() { + numDriveResults := 4 + emptyLink := "" + link := "foo" + + // These errors won't be the "correct" format when compared to what graph + // returns, but they're close enough to have the same info when the inner + // details are extracted via support package. + tmp := userMysiteURLNotFound + tmpMySiteURLNotFound := odataerrors.NewMainError() + tmpMySiteURLNotFound.SetMessage(&tmp) + + mySiteURLNotFound := odataerrors.NewODataError() + mySiteURLNotFound.SetError(tmpMySiteURLNotFound) + + tmp2 := userMysiteNotFound + tmpMySiteNotFound := odataerrors.NewMainError() + tmpMySiteNotFound.SetMessage(&tmp2) + + mySiteNotFound := odataerrors.NewODataError() + mySiteNotFound.SetError(tmpMySiteNotFound) + + tmp3 := contextDeadlineExceeded + tmpDeadlineExceeded := odataerrors.NewMainError() + tmpDeadlineExceeded.SetMessage(&tmp3) + + deadlineExceeded := odataerrors.NewODataError() + deadlineExceeded.SetError(tmpDeadlineExceeded) + + resultDrives := make([]models.Driveable, 0, numDriveResults) + + for i := 0; i < numDriveResults; i++ { + d := models.NewDrive() + id := uuid.NewString() + d.SetId(&id) + + resultDrives = append(resultDrives, d) + } + + tooManyRetries := make([]pagerResult, 0, getDrivesRetries+1) + + for i := 0; i < getDrivesRetries+1; i++ { + tooManyRetries = append(tooManyRetries, pagerResult{ + err: deadlineExceeded, + }) + } + + table := []struct { + name string + pagerResults []pagerResult + retry bool + expectedErr assert.ErrorAssertionFunc + expectedResults []models.Driveable + }{ + { + name: "AllOneResultNilNextLink", + pagerResults: []pagerResult{ + { + drives: resultDrives, + nextLink: nil, + err: nil, + }, + }, + retry: false, + expectedErr: assert.NoError, + expectedResults: resultDrives, + }, + { + name: "AllOneResultEmptyNextLink", + pagerResults: []pagerResult{ + { + drives: resultDrives, + nextLink: &emptyLink, + err: nil, + }, + }, + retry: false, + expectedErr: assert.NoError, + expectedResults: resultDrives, + }, + { + name: "SplitResultsNilNextLink", + pagerResults: []pagerResult{ + { + drives: resultDrives[:numDriveResults/2], + nextLink: &link, + err: nil, + }, + { + drives: resultDrives[numDriveResults/2:], + nextLink: nil, + err: nil, + }, + }, + retry: false, + expectedErr: assert.NoError, + expectedResults: resultDrives, + }, + { + name: "SplitResultsEmptyNextLink", + pagerResults: []pagerResult{ + { + drives: resultDrives[:numDriveResults/2], + nextLink: &link, + err: nil, + }, + { + drives: resultDrives[numDriveResults/2:], + nextLink: &emptyLink, + err: nil, + }, + }, + retry: false, + expectedErr: assert.NoError, + expectedResults: resultDrives, + }, + { + name: "NonRetryableError", + pagerResults: []pagerResult{ + { + drives: resultDrives, + nextLink: &link, + err: nil, + }, + { + drives: nil, + nextLink: nil, + err: assert.AnError, + }, + }, + retry: true, + expectedErr: assert.Error, + expectedResults: nil, + }, + { + name: "SiteURLNotFound", + pagerResults: []pagerResult{ + { + drives: nil, + nextLink: nil, + err: mySiteURLNotFound, + }, + }, + retry: true, + expectedErr: assert.NoError, + expectedResults: nil, + }, + { + name: "SiteNotFound", + pagerResults: []pagerResult{ + { + drives: nil, + nextLink: nil, + err: mySiteNotFound, + }, + }, + retry: true, + expectedErr: assert.NoError, + expectedResults: nil, + }, + { + name: "SplitResultsContextTimeoutWithRetries", + pagerResults: []pagerResult{ + { + drives: resultDrives[:numDriveResults/2], + nextLink: &link, + err: nil, + }, + { + drives: nil, + nextLink: nil, + err: deadlineExceeded, + }, + { + drives: resultDrives[numDriveResults/2:], + nextLink: &emptyLink, + err: nil, + }, + }, + retry: true, + expectedErr: assert.NoError, + expectedResults: resultDrives, + }, + { + name: "SplitResultsContextTimeoutNoRetries", + pagerResults: []pagerResult{ + { + drives: resultDrives[:numDriveResults/2], + nextLink: &link, + err: nil, + }, + { + drives: nil, + nextLink: nil, + err: deadlineExceeded, + }, + { + drives: resultDrives[numDriveResults/2:], + nextLink: &emptyLink, + err: nil, + }, + }, + retry: false, + expectedErr: assert.Error, + expectedResults: nil, + }, + { + name: "TooManyRetries", + pagerResults: append( + []pagerResult{ + { + drives: resultDrives[:numDriveResults/2], + nextLink: &link, + err: nil, + }, + }, + tooManyRetries..., + ), + retry: true, + expectedErr: assert.Error, + expectedResults: nil, + }, + } + for _, test := range table { + suite.T().Run(test.name, func(t *testing.T) { + ctx, flush := tester.NewContext() + defer flush() + + pager := &mockDrivePager{ + toReturn: test.pagerResults, + } + + drives, err := drives(ctx, pager, test.retry) + test.expectedErr(t, err) + + assert.ElementsMatch(t, test.expectedResults, drives) + }) + } +} + +// Integration tests + type OneDriveSuite struct { suite.Suite userID string @@ -44,7 +346,10 @@ func (suite *OneDriveSuite) TestCreateGetDeleteFolder() { folderElements := []string{folderName1} gs := loadTestService(t) - drives, err := drives(ctx, gs, suite.userID, OneDriveSource) + pager, err := PagerForSource(OneDriveSource, gs, suite.userID, nil) + require.NoError(t, err) + + drives, err := drives(ctx, pager, true) require.NoError(t, err) require.NotEmpty(t, drives) @@ -89,7 +394,10 @@ func (suite *OneDriveSuite) TestCreateGetDeleteFolder() { for _, test := range table { suite.T().Run(test.name, func(t *testing.T) { - allFolders, err := GetAllFolders(ctx, gs, suite.userID, test.prefix) + pager, err := PagerForSource(OneDriveSource, gs, suite.userID, nil) + require.NoError(t, err) + + allFolders, err := GetAllFolders(ctx, gs, pager, test.prefix) require.NoError(t, err) foundFolderIDs := []string{} diff --git a/src/internal/connector/onedrive/item_test.go b/src/internal/connector/onedrive/item_test.go index 5364d543c..938748ca2 100644 --- a/src/internal/connector/onedrive/item_test.go +++ b/src/internal/connector/onedrive/item_test.go @@ -75,7 +75,10 @@ func (suite *ItemIntegrationSuite) SetupSuite() { suite.user = tester.SecondaryM365UserID(t) - odDrives, err := drives(ctx, suite, suite.user, OneDriveSource) + pager, err := PagerForSource(OneDriveSource, suite, suite.user, nil) + require.NoError(t, err) + + odDrives, err := drives(ctx, pager, true) require.NoError(t, err) // Test Requirement 1: Need a drive require.Greaterf(t, len(odDrives), 0, "user %s does not have a drive", suite.user) From 704a0f8878e43fbbe4514b93d292840dcfec21f0 Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Fri, 27 Jan 2023 15:13:16 -0800 Subject: [PATCH 16/36] Create helper functions/interfaces to retrieve next and delta links (#2308) ## Description Create a shared set of helper functions and interfaces for getting next and delta links from Graph API responses. This helps standardize how they are handled with respect to nil/empty values and makes comparisons easier in other code ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [x] :broom: Tech Debt/Cleanup ## Issue(s) * #2264 ## Test Plan - [ ] :muscle: Manual - [x] :zap: Unit test - [x] :green_heart: E2E --- .../connector/exchange/api/contacts.go | 5 +- src/internal/connector/exchange/api/events.go | 5 +- src/internal/connector/exchange/api/mail.go | 5 +- src/internal/connector/exchange/api/shared.go | 22 ++-- src/internal/connector/graph/api/api.go | 30 +++++ src/internal/connector/graph/api/api_test.go | 114 ++++++++++++++++++ src/internal/connector/onedrive/api/drive.go | 13 +- src/internal/connector/onedrive/drive.go | 13 +- src/internal/connector/onedrive/drive_test.go | 2 +- 9 files changed, 175 insertions(+), 34 deletions(-) create mode 100644 src/internal/connector/graph/api/api.go create mode 100644 src/internal/connector/graph/api/api_test.go diff --git a/src/internal/connector/exchange/api/contacts.go b/src/internal/connector/exchange/api/contacts.go index 85fea19fc..2e9014235 100644 --- a/src/internal/connector/exchange/api/contacts.go +++ b/src/internal/connector/exchange/api/contacts.go @@ -13,6 +13,7 @@ import ( "github.com/pkg/errors" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/graph/api" "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/pkg/backup/details" ) @@ -173,7 +174,7 @@ type contactPager struct { options *users.ItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration } -func (p *contactPager) getPage(ctx context.Context) (pageLinker, error) { +func (p *contactPager) getPage(ctx context.Context) (api.DeltaPageLinker, error) { return p.builder.Get(ctx, p.options) } @@ -181,7 +182,7 @@ func (p *contactPager) setNext(nextLink string) { p.builder = users.NewItemContactFoldersItemContactsDeltaRequestBuilder(nextLink, p.gs.Adapter()) } -func (p *contactPager) valuesIn(pl pageLinker) ([]getIDAndAddtler, error) { +func (p *contactPager) valuesIn(pl api.DeltaPageLinker) ([]getIDAndAddtler, error) { return toValues[models.Contactable](pl) } diff --git a/src/internal/connector/exchange/api/events.go b/src/internal/connector/exchange/api/events.go index cd968056d..b3e6f9467 100644 --- a/src/internal/connector/exchange/api/events.go +++ b/src/internal/connector/exchange/api/events.go @@ -14,6 +14,7 @@ import ( "github.com/alcionai/corso/src/internal/common" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/graph/api" "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/logger" @@ -203,7 +204,7 @@ type eventPager struct { options *users.ItemCalendarsItemEventsDeltaRequestBuilderGetRequestConfiguration } -func (p *eventPager) getPage(ctx context.Context) (pageLinker, error) { +func (p *eventPager) getPage(ctx context.Context) (api.DeltaPageLinker, error) { resp, err := p.builder.Get(ctx, p.options) return resp, err } @@ -212,7 +213,7 @@ func (p *eventPager) setNext(nextLink string) { p.builder = users.NewItemCalendarsItemEventsDeltaRequestBuilder(nextLink, p.gs.Adapter()) } -func (p *eventPager) valuesIn(pl pageLinker) ([]getIDAndAddtler, error) { +func (p *eventPager) valuesIn(pl api.DeltaPageLinker) ([]getIDAndAddtler, error) { return toValues[models.Eventable](pl) } diff --git a/src/internal/connector/exchange/api/mail.go b/src/internal/connector/exchange/api/mail.go index f4d2d2e33..4c9d564f0 100644 --- a/src/internal/connector/exchange/api/mail.go +++ b/src/internal/connector/exchange/api/mail.go @@ -13,6 +13,7 @@ import ( "github.com/pkg/errors" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/graph/api" "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/logger" @@ -198,7 +199,7 @@ type mailPager struct { options *users.ItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration } -func (p *mailPager) getPage(ctx context.Context) (pageLinker, error) { +func (p *mailPager) getPage(ctx context.Context) (api.DeltaPageLinker, error) { return p.builder.Get(ctx, p.options) } @@ -206,7 +207,7 @@ func (p *mailPager) setNext(nextLink string) { p.builder = users.NewItemMailFoldersItemMessagesDeltaRequestBuilder(nextLink, p.gs.Adapter()) } -func (p *mailPager) valuesIn(pl pageLinker) ([]getIDAndAddtler, error) { +func (p *mailPager) valuesIn(pl api.DeltaPageLinker) ([]getIDAndAddtler, error) { return toValues[models.Messageable](pl) } diff --git a/src/internal/connector/exchange/api/shared.go b/src/internal/connector/exchange/api/shared.go index dfe64d716..d89ce7411 100644 --- a/src/internal/connector/exchange/api/shared.go +++ b/src/internal/connector/exchange/api/shared.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/graph/api" "github.com/alcionai/corso/src/internal/connector/support" ) @@ -14,14 +15,9 @@ import ( // --------------------------------------------------------------------------- type itemPager interface { - getPage(context.Context) (pageLinker, error) + getPage(context.Context) (api.DeltaPageLinker, error) setNext(string) - valuesIn(pageLinker) ([]getIDAndAddtler, error) -} - -type pageLinker interface { - GetOdataDeltaLink() *string - GetOdataNextLink() *string + valuesIn(api.DeltaPageLinker) ([]getIDAndAddtler, error) } type getIDAndAddtler interface { @@ -98,24 +94,24 @@ func getItemsAddedAndRemovedFromContainer( } } + nextLink, delta := api.NextAndDeltaLink(resp) + // the deltaLink is kind of like a cursor for overall data state. // once we run through pages of nextLinks, the last query will // produce a deltaLink instead (if supported), which we'll use on // the next backup to only get the changes since this run. - delta := resp.GetOdataDeltaLink() - if delta != nil && len(*delta) > 0 { - deltaURL = *delta + if len(delta) > 0 { + deltaURL = delta } // the nextLink is our page cursor within this query. // if we have more data to retrieve, we'll have a // nextLink instead of a deltaLink. - nextLink := resp.GetOdataNextLink() - if nextLink == nil || len(*nextLink) == 0 { + if len(nextLink) == 0 { break } - pager.setNext(*nextLink) + pager.setNext(nextLink) } return addedIDs, removedIDs, deltaURL, nil diff --git a/src/internal/connector/graph/api/api.go b/src/internal/connector/graph/api/api.go new file mode 100644 index 000000000..abcf29a24 --- /dev/null +++ b/src/internal/connector/graph/api/api.go @@ -0,0 +1,30 @@ +package api + +type PageLinker interface { + GetOdataNextLink() *string +} + +type DeltaPageLinker interface { + PageLinker + GetOdataDeltaLink() *string +} + +func NextLink(pl PageLinker) string { + next := pl.GetOdataNextLink() + if next == nil || len(*next) == 0 { + return "" + } + + return *next +} + +func NextAndDeltaLink(pl DeltaPageLinker) (string, string) { + next := NextLink(pl) + + delta := pl.GetOdataDeltaLink() + if delta == nil || len(*delta) == 0 { + return next, "" + } + + return next, *delta +} diff --git a/src/internal/connector/graph/api/api_test.go b/src/internal/connector/graph/api/api_test.go new file mode 100644 index 000000000..37932396d --- /dev/null +++ b/src/internal/connector/graph/api/api_test.go @@ -0,0 +1,114 @@ +package api_test + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" + + "github.com/alcionai/corso/src/internal/connector/graph/api" +) + +type mockNextLink struct { + nextLink *string +} + +func (l mockNextLink) GetOdataNextLink() *string { + return l.nextLink +} + +type mockDeltaNextLink struct { + mockNextLink + deltaLink *string +} + +func (l mockDeltaNextLink) GetOdataDeltaLink() *string { + return l.deltaLink +} + +type testInput struct { + name string + inputLink *string + expectedLink string +} + +// Needs to be var not const so we can take the address of it. +var ( + emptyLink = "" + link = "foo" + link2 = "bar" + + nextLinkInputs = []testInput{ + { + name: "empty", + inputLink: &emptyLink, + expectedLink: "", + }, + { + name: "nil", + inputLink: nil, + expectedLink: "", + }, + { + name: "non_empty", + inputLink: &link, + expectedLink: link, + }, + } +) + +type APIUnitSuite struct { + suite.Suite +} + +func TestAPIUnitSuite(t *testing.T) { + suite.Run(t, new(APIUnitSuite)) +} + +func (suite *APIUnitSuite) TestNextLink() { + for _, test := range nextLinkInputs { + suite.T().Run(test.name, func(t *testing.T) { + l := mockNextLink{nextLink: test.inputLink} + assert.Equal(t, test.expectedLink, api.NextLink(l)) + }) + } +} + +func (suite *APIUnitSuite) TestNextAndDeltaLink() { + deltaTable := []testInput{ + { + name: "empty", + inputLink: &emptyLink, + expectedLink: "", + }, + { + name: "nil", + inputLink: nil, + expectedLink: "", + }, + { + name: "non_empty", + // Use a different link so we can see if the results get swapped or something. + inputLink: &link2, + expectedLink: link2, + }, + } + + for _, next := range nextLinkInputs { + for _, delta := range deltaTable { + name := strings.Join([]string{next.name, "next", delta.name, "delta"}, "_") + + suite.T().Run(name, func(t *testing.T) { + l := mockDeltaNextLink{ + mockNextLink: mockNextLink{nextLink: next.inputLink}, + deltaLink: delta.inputLink, + } + gotNext, gotDelta := api.NextAndDeltaLink(l) + + assert.Equal(t, next.expectedLink, gotNext) + assert.Equal(t, delta.expectedLink, gotDelta) + }) + } + } +} diff --git a/src/internal/connector/onedrive/api/drive.go b/src/internal/connector/onedrive/api/drive.go index 7e5cfcaac..6dd7d46a1 100644 --- a/src/internal/connector/onedrive/api/drive.go +++ b/src/internal/connector/onedrive/api/drive.go @@ -9,12 +9,9 @@ import ( "github.com/pkg/errors" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/graph/api" ) -type PageLinker interface { - GetOdataNextLink() *string -} - type userDrivePager struct { gs graph.Servicer builder *msusers.ItemDrivesRequestBuilder @@ -41,7 +38,7 @@ func NewUserDrivePager( return res } -func (p *userDrivePager) GetPage(ctx context.Context) (PageLinker, error) { +func (p *userDrivePager) GetPage(ctx context.Context) (api.PageLinker, error) { return p.builder.Get(ctx, p.options) } @@ -49,7 +46,7 @@ func (p *userDrivePager) SetNext(link string) { p.builder = msusers.NewItemDrivesRequestBuilder(link, p.gs.Adapter()) } -func (p *userDrivePager) ValuesIn(l PageLinker) ([]models.Driveable, error) { +func (p *userDrivePager) ValuesIn(l api.PageLinker) ([]models.Driveable, error) { page, ok := l.(interface{ GetValue() []models.Driveable }) if !ok { return nil, errors.Errorf( @@ -87,7 +84,7 @@ func NewSiteDrivePager( return res } -func (p *siteDrivePager) GetPage(ctx context.Context) (PageLinker, error) { +func (p *siteDrivePager) GetPage(ctx context.Context) (api.PageLinker, error) { return p.builder.Get(ctx, p.options) } @@ -95,7 +92,7 @@ func (p *siteDrivePager) SetNext(link string) { p.builder = mssites.NewItemDrivesRequestBuilder(link, p.gs.Adapter()) } -func (p *siteDrivePager) ValuesIn(l PageLinker) ([]models.Driveable, error) { +func (p *siteDrivePager) ValuesIn(l api.PageLinker) ([]models.Driveable, error) { page, ok := l.(interface{ GetValue() []models.Driveable }) if !ok { return nil, errors.Errorf( diff --git a/src/internal/connector/onedrive/drive.go b/src/internal/connector/onedrive/drive.go index 4bc56aec0..6270ec08a 100644 --- a/src/internal/connector/onedrive/drive.go +++ b/src/internal/connector/onedrive/drive.go @@ -14,6 +14,7 @@ import ( "golang.org/x/exp/maps" "github.com/alcionai/corso/src/internal/connector/graph" + gapi "github.com/alcionai/corso/src/internal/connector/graph/api" "github.com/alcionai/corso/src/internal/connector/onedrive/api" "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/pkg/logger" @@ -36,9 +37,9 @@ const ( ) type drivePager interface { - GetPage(context.Context) (api.PageLinker, error) + GetPage(context.Context) (gapi.PageLinker, error) SetNext(nextLink string) - ValuesIn(api.PageLinker) ([]models.Driveable, error) + ValuesIn(gapi.PageLinker) ([]models.Driveable, error) } func PagerForSource( @@ -64,7 +65,7 @@ func drives( ) ([]models.Driveable, error) { var ( err error - page api.PageLinker + page gapi.PageLinker numberOfRetries = getDrivesRetries drives = []models.Driveable{} ) @@ -111,12 +112,12 @@ func drives( drives = append(drives, tmp...) - nextLink := page.GetOdataNextLink() - if nextLink == nil || len(*nextLink) == 0 { + nextLink := gapi.NextLink(page) + if len(nextLink) == 0 { break } - pager.SetNext(*nextLink) + pager.SetNext(nextLink) } logger.Ctx(ctx).Debugf("Found %d drives", len(drives)) diff --git a/src/internal/connector/onedrive/drive_test.go b/src/internal/connector/onedrive/drive_test.go index 6ace0c3c2..66449a917 100644 --- a/src/internal/connector/onedrive/drive_test.go +++ b/src/internal/connector/onedrive/drive_test.go @@ -14,7 +14,7 @@ import ( "github.com/alcionai/corso/src/internal/common" "github.com/alcionai/corso/src/internal/connector/graph" - "github.com/alcionai/corso/src/internal/connector/onedrive/api" + "github.com/alcionai/corso/src/internal/connector/graph/api" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/logger" From 2d7c46c6b3a065dec3302d2961747df2530a1af6 Mon Sep 17 00:00:00 2001 From: Keepers Date: Fri, 27 Jan 2023 19:06:15 -0700 Subject: [PATCH 17/36] add getItem unit with retries (#2305) ## Description separates item get/retry when iterating over items in exchange collection streams, and adds a mocked unit test on that func. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :robot: Test ## Issue(s) * closes #2299 ## Test Plan - [x] :zap: Unit test --- .../exchange/exchange_data_collection.go | 84 ++++++++++--------- .../exchange/exchange_data_collection_test.go | 70 ++++++++++++++-- .../connector/graph_connector_test.go | 45 ++++++++-- .../mockconnector/mock_data_message.go | 58 ++++++++----- 4 files changed, 185 insertions(+), 72 deletions(-) diff --git a/src/internal/connector/exchange/exchange_data_collection.go b/src/internal/connector/exchange/exchange_data_collection.go index 44418e9bd..d53e3dbe9 100644 --- a/src/internal/connector/exchange/exchange_data_collection.go +++ b/src/internal/connector/exchange/exchange_data_collection.go @@ -173,6 +173,9 @@ func (col *Collection) streamItems(ctx context.Context) { colProgress chan<- struct{} user = col.user + log = logger.Ctx(ctx).With( + "service", path.ExchangeService.String(), + "category", col.category.String()) ) defer func() { @@ -251,50 +254,19 @@ func (col *Collection) streamItems(ctx context.Context) { err error ) - for i := 1; i <= numberOfRetries; i++ { - item, info, err = col.items.GetItem(ctx, user, id) - if err == nil { - break - } - - // If the data is no longer available just return here and chalk it up - // as a success. There's no reason to retry and no way we can backup up - // enough information to restore the item anyway. - if graph.IsErrDeletedInFlight(err) { - atomic.AddInt64(&success, 1) - logger.Ctx(ctx).Infow( - "Graph reported item not found", - "error", err, - "service", path.ExchangeService.String(), - "category", col.category.String) - - return - } - - if i < numberOfRetries { - time.Sleep(time.Duration(3*(i+1)) * time.Second) - } - } - + item, info, err = getItemWithRetries(ctx, user, id, col.items) if err != nil { // Don't report errors for deleted items as there's no way for us to - // back up data that is gone. Chalk them up as a "success" though since - // there's really nothing we can do and not reporting it will make the - // status code upset cause we won't have the same number of results as - // attempted items. + // back up data that is gone. Record it as a "success", since there's + // nothing else we can do, and not reporting it will make the status + // investigation upset. if graph.IsErrDeletedInFlight(err) { atomic.AddInt64(&success, 1) - logger.Ctx(ctx).Infow( - "Graph reported item not found", - "error", err, - "service", path.ExchangeService.String(), - "category", col.category.String) - - return + log.Infow("item not found", "err", err) + } else { + errUpdater(user, support.ConnectorStackErrorTraceWrap(err, "fetching item")) } - errUpdater(user, support.ConnectorStackErrorTraceWrap(err, "fetching item")) - return } @@ -325,6 +297,42 @@ func (col *Collection) streamItems(ctx context.Context) { wg.Wait() } +// get an item while handling retry and backoff. +func getItemWithRetries( + ctx context.Context, + userID, itemID string, + items itemer, +) (serialization.Parsable, *details.ExchangeInfo, error) { + var ( + item serialization.Parsable + info *details.ExchangeInfo + err error + ) + + for i := 1; i <= numberOfRetries; i++ { + item, info, err = items.GetItem(ctx, userID, itemID) + if err == nil { + break + } + + // If the data is no longer available just return here and chalk it up + // as a success. There's no reason to retry; it's gone Let it go. + if graph.IsErrDeletedInFlight(err) { + return nil, nil, err + } + + if i < numberOfRetries { + time.Sleep(time.Duration(3*(i+1)) * time.Second) + } + } + + if err != nil { + return nil, nil, err + } + + return item, info, err +} + // terminatePopulateSequence is a utility function used to close a Collection's data channel // and to send the status update through the channel. func (col *Collection) finishPopulation(ctx context.Context, success int, totalBytes int64, errs error) { diff --git a/src/internal/connector/exchange/exchange_data_collection_test.go b/src/internal/connector/exchange/exchange_data_collection_test.go index a63a7caf8..e45f3d80c 100644 --- a/src/internal/connector/exchange/exchange_data_collection_test.go +++ b/src/internal/connector/exchange/exchange_data_collection_test.go @@ -10,23 +10,33 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "github.com/alcionai/corso/src/internal/common" + "github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/data" + "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/path" ) -type mockItemer struct{} +type mockItemer struct { + getCount int + serializeCount int + getErr error + serializeErr error +} -func (mi mockItemer) GetItem( +func (mi *mockItemer) GetItem( context.Context, string, string, ) (serialization.Parsable, *details.ExchangeInfo, error) { - return nil, nil, nil + mi.getCount++ + return nil, nil, mi.getErr } -func (mi mockItemer) Serialize(context.Context, serialization.Parsable, string, string) ([]byte, error) { - return nil, nil +func (mi *mockItemer) Serialize(context.Context, serialization.Parsable, string, string) ([]byte, error) { + mi.serializeCount++ + return nil, mi.serializeErr } type ExchangeDataCollectionSuite struct { @@ -153,10 +163,58 @@ func (suite *ExchangeDataCollectionSuite) TestNewCollection_state() { "u", test.curr, test.prev, 0, - mockItemer{}, nil, + &mockItemer{}, nil, control.Options{}, false) assert.Equal(t, test.expect, c.State()) }) } } + +func (suite *ExchangeDataCollectionSuite) TestGetItemWithRetries() { + table := []struct { + name string + items *mockItemer + expectErr func(*testing.T, error) + expectGetCalls int + }{ + { + name: "happy", + items: &mockItemer{}, + expectErr: func(t *testing.T, err error) { + assert.NoError(t, err) + }, + expectGetCalls: 1, + }, + { + name: "an error", + items: &mockItemer{getErr: assert.AnError}, + expectErr: func(t *testing.T, err error) { + assert.Error(t, err) + }, + expectGetCalls: 3, + }, + { + name: "deleted in flight", + items: &mockItemer{ + getErr: graph.ErrDeletedInFlight{ + Err: *common.EncapsulateError(assert.AnError), + }, + }, + expectErr: func(t *testing.T, err error) { + assert.True(t, graph.IsErrDeletedInFlight(err), "is ErrDeletedInFlight") + }, + expectGetCalls: 1, + }, + } + for _, test := range table { + suite.T().Run(test.name, func(t *testing.T) { + ctx, flush := tester.NewContext() + defer flush() + + // itemer is mocked, so only the errors are configured atm. + _, _, err := getItemWithRetries(ctx, "userID", "itemID", test.items) + test.expectErr(t, err) + }) + } +} diff --git a/src/internal/connector/graph_connector_test.go b/src/internal/connector/graph_connector_test.go index af4ae0824..1ed353be6 100644 --- a/src/internal/connector/graph_connector_test.go +++ b/src/internal/connector/graph_connector_test.go @@ -375,8 +375,7 @@ func runRestoreBackupTest( t.Logf( "Restoring collections to %s for resourceOwners(s) %v\n", dest.ContainerName, - resourceOwners, - ) + resourceOwners) start := time.Now() @@ -394,8 +393,10 @@ func runRestoreBackupTest( status := restoreGC.AwaitStatus() runTime := time.Since(start) - assert.Equal(t, totalItems, status.ObjectCount, "status.ObjectCount") - assert.Equal(t, totalItems, status.Successful, "status.Successful") + assert.NoError(t, status.Err, "restored status.Err") + assert.Zero(t, status.ErrorCount, "restored status.ErrorCount") + assert.Equal(t, totalItems, status.ObjectCount, "restored status.ObjectCount") + assert.Equal(t, totalItems, status.Successful, "restored status.Successful") assert.Len( t, deets.Entries, @@ -434,8 +435,13 @@ func runRestoreBackupTest( skipped := checkCollections(t, totalItems, expectedData, dcs) status = backupGC.AwaitStatus() - assert.Equal(t, totalItems+skipped, status.ObjectCount, "status.ObjectCount") - assert.Equal(t, totalItems+skipped, status.Successful, "status.Successful") + + assert.NoError(t, status.Err, "backup status.Err") + assert.Zero(t, status.ErrorCount, "backup status.ErrorCount") + assert.Equalf(t, totalItems+skipped, status.ObjectCount, + "backup status.ObjectCount; wanted %d items + %d skipped", totalItems, skipped) + assert.Equalf(t, totalItems+skipped, status.Successful, + "backup status.Successful; wanted %d items + %d skipped", totalItems, skipped) } func (suite *GraphConnectorIntegrationSuite) TestRestoreAndBackup() { @@ -907,3 +913,30 @@ func (suite *GraphConnectorIntegrationSuite) TestMultiFolderBackupDifferentNames }) } } + +// TODO: this should only be run during smoke tests, not part of the standard CI. +// That's why it's set aside instead of being included in the other test set. +func (suite *GraphConnectorIntegrationSuite) TestRestoreAndBackup_largeMailAttachment() { + subjectText := "Test message for restore with large attachment" + + test := restoreBackupInfo{ + name: "EmailsWithLargeAttachments", + service: path.ExchangeService, + resource: Users, + collections: []colInfo{ + { + pathElements: []string{"Inbox"}, + category: path.EmailCategory, + items: []itemInfo{ + { + name: "35mbAttachment", + data: mockconnector.GetMockMessageWithSizedAttachment(subjectText, 35), + lookupKey: subjectText, + }, + }, + }, + }, + } + + runRestoreBackupTest(suite.T(), suite.acct, test, suite.connector.tenant, []string{suite.user}) +} diff --git a/src/internal/connector/mockconnector/mock_data_message.go b/src/internal/connector/mockconnector/mock_data_message.go index 4c63806c9..597447492 100644 --- a/src/internal/connector/mockconnector/mock_data_message.go +++ b/src/internal/connector/mockconnector/mock_data_message.go @@ -155,6 +155,41 @@ func GetMockMessageWith( return []byte(message) } +// GetMockMessageWithDirectAttachment returns a message an attachment that contains n MB of data. +// Max limit on N is 35 (imposed by exchange) . +// Serialized with: kiota-serialization-json-go v0.7.1 +func GetMockMessageWithSizedAttachment(subject string, n int) []byte { + // I know we said 35, but after base64encoding, 24mb of base content + // bloats up to 34mb (35 baloons to 49). So we have to restrict n + // appropriately. + if n > 24 { + n = 24 + } + + //nolint:lll + messageFmt := "{\"id\":\"AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwBGAAAAAADCNgjhM9QmQYWNcI7hCpPrBwDSEBNbUIB9RL6ePDeF3FIYAAAAAAEMAADSEBNbUIB9RL6ePDeF3FIYAAB4moqeAAA=\"," + + "\"@odata.type\":\"#microsoft.graph.message\",\"@odata.etag\":\"W/\\\"CQAAABYAAADSEBNbUIB9RL6ePDeF3FIYAAB3maFQ\\\"\",\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#users('a4a472f8-ccb0-43ec-bf52-3697a91b926c')/messages/$entity\",\"categories\":[]," + + "\"changeKey\":\"CQAAABYAAADSEBNbUIB9RL6ePDeF3FIYAAB3maFQ\",\"createdDateTime\":\"2022-09-29T17:39:06Z\",\"lastModifiedDateTime\":\"2022-09-29T17:39:08Z\"," + + "\"attachments\":[{\"id\":\"AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwBGAAAAAADCNgjhM9QmQYWNcI7hCpPrBwDSEBNbUIB9RL6ePDeF3FIYAAAAAAEMAADSEBNbUIB9RL6ePDeF3FIYAAB4moqeAAABEgAQANMmZLFhjWJJj4X9mj8piqg=\",\"@odata.type\":\"#microsoft.graph.fileAttachment\",\"@odata.mediaContentType\":\"application/octet-stream\"," + + "\"contentType\":\"application/octet-stream\",\"isInline\":false,\"lastModifiedDateTime\":\"2022-09-29T17:39:06Z\",\"name\":\"database.db\",\"size\":%d," + + "\"contentBytes\":\"%s\"}]," + + "\"bccRecipients\":[],\"body\":{\"content\":\"\\r\\n
Lidia,

I hope this message finds you well. I am researching a database construct for next quarter's review. SkyNet will not be able to match our database process speeds if we utilize the formulae that are included. 

Please give me your thoughts on the implementation.

Best,

Dustin
\",\"contentType\":\"html\",\"@odata.type\":\"#microsoft.graph.itemBody\"}," + + "\"bodyPreview\":\"Lidia,\\r\\n\\r\\nI hope this message finds you well. I am researching a database construct for next quarter's review. SkyNet will not be able to match our database process speeds if we utilize the formulae that are included.\\r\\n\\r\\nPlease give me your thoughts on th\",\"ccRecipients\":[]," + + "\"conversationId\":\"AAQkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwAQANPFOcy_BapBghezTzIIldI=\",\"conversationIndex\":\"AQHY1Cpb08U5zL4FqkGCF7NPMgiV0g==\",\"flag\":{\"flagStatus\":\"notFlagged\",\"@odata.type\":\"#microsoft.graph.followupFlag\"}," + + "\"from\":{\"emailAddress\":{\"address\":\"dustina@8qzvrj.onmicrosoft.com\",\"name\":\"Dustin Abbot\",\"@odata.type\":\"#microsoft.graph.emailAddress\"},\"@odata.type\":\"#microsoft.graph.recipient\"},\"hasAttachments\":true,\"importance\":\"normal\",\"inferenceClassification\":\"focused\"," + + "\"internetMessageId\":\"\",\"isDeliveryReceiptRequested\":false,\"isDraft\":false,\"isRead\":false,\"isReadReceiptRequested\":false," + + "\"parentFolderId\":\"AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwAuAAAAAADCNgjhM9QmQYWNcI7hCpPrAQDSEBNbUIB9RL6ePDeF3FIYAAAAAAEMAAA=\",\"receivedDateTime\":\"2022-09-29T17:39:07Z\",\"replyTo\":[],\"sender\":{\"emailAddress\":{\"address\":\"dustina@8qzvrj.onmicrosoft.com\",\"name\":\"Dustin Abbot\"," + + "\"@odata.type\":\"#microsoft.graph.emailAddress\"},\"@odata.type\":\"#microsoft.graph.recipient\"},\"sentDateTime\":\"2022-09-29T17:39:02Z\"," + + "\"subject\":\"" + subject + "\",\"toRecipients\":[{\"emailAddress\":{\"address\":\"LidiaH@8qzvrj.onmicrosoft.com\",\"name\":\"Lidia Holloway\",\"@odata.type\":\"#microsoft.graph.emailAddress\"},\"@odata.type\":\"#microsoft.graph.recipient\"}]," + + "\"webLink\":\"https://outlook.office365.com/owa/?ItemID=AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwBGAAAAAADCNgjhM9QmQYWNcI7hCpPrBwDSEBNbUIB9RL6ePDeF3FIYAAAAAAEMAADSEBNbUIB9RL6ePDeF3FIYAAB4moqeAAA%3D&exvsurl=1&viewmodel=ReadMessageItem\"}" + + attachmentSize := n * 1024 * 1024 // n MB + attachmentBytes := make([]byte, attachmentSize) + + // Attachment content bytes are base64 encoded + return []byte(fmt.Sprintf(messageFmt, attachmentSize, base64.StdEncoding.EncodeToString([]byte(attachmentBytes)))) +} + // GetMockMessageWithDirectAttachment returns a message with inline attachment // Serialized with: kiota-serialization-json-go v0.7.1 func GetMockMessageWithDirectAttachment(subject string) []byte { @@ -228,28 +263,7 @@ func GetMockMessageWithDirectAttachment(subject string) []byte { // used in GetMockMessageWithDirectAttachment // Serialized with: kiota-serialization-json-go v0.7.1 func GetMockMessageWithLargeAttachment(subject string) []byte { - //nolint:lll - messageFmt := "{\"id\":\"AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwBGAAAAAADCNgjhM9QmQYWNcI7hCpPrBwDSEBNbUIB9RL6ePDeF3FIYAAAAAAEMAADSEBNbUIB9RL6ePDeF3FIYAAB4moqeAAA=\"," + - "\"@odata.type\":\"#microsoft.graph.message\",\"@odata.etag\":\"W/\\\"CQAAABYAAADSEBNbUIB9RL6ePDeF3FIYAAB3maFQ\\\"\",\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#users('a4a472f8-ccb0-43ec-bf52-3697a91b926c')/messages/$entity\",\"categories\":[]," + - "\"changeKey\":\"CQAAABYAAADSEBNbUIB9RL6ePDeF3FIYAAB3maFQ\",\"createdDateTime\":\"2022-09-29T17:39:06Z\",\"lastModifiedDateTime\":\"2022-09-29T17:39:08Z\"," + - "\"attachments\":[{\"id\":\"AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwBGAAAAAADCNgjhM9QmQYWNcI7hCpPrBwDSEBNbUIB9RL6ePDeF3FIYAAAAAAEMAADSEBNbUIB9RL6ePDeF3FIYAAB4moqeAAABEgAQANMmZLFhjWJJj4X9mj8piqg=\",\"@odata.type\":\"#microsoft.graph.fileAttachment\",\"@odata.mediaContentType\":\"application/octet-stream\"," + - "\"contentType\":\"application/octet-stream\",\"isInline\":false,\"lastModifiedDateTime\":\"2022-09-29T17:39:06Z\",\"name\":\"database.db\",\"size\":%d," + - "\"contentBytes\":\"%s\"}]," + - "\"bccRecipients\":[],\"body\":{\"content\":\"\\r\\n
Lidia,

I hope this message finds you well. I am researching a database construct for next quarter's review. SkyNet will not be able to match our database process speeds if we utilize the formulae that are included. 

Please give me your thoughts on the implementation.

Best,

Dustin
\",\"contentType\":\"html\",\"@odata.type\":\"#microsoft.graph.itemBody\"}," + - "\"bodyPreview\":\"Lidia,\\r\\n\\r\\nI hope this message finds you well. I am researching a database construct for next quarter's review. SkyNet will not be able to match our database process speeds if we utilize the formulae that are included.\\r\\n\\r\\nPlease give me your thoughts on th\",\"ccRecipients\":[]," + - "\"conversationId\":\"AAQkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwAQANPFOcy_BapBghezTzIIldI=\",\"conversationIndex\":\"AQHY1Cpb08U5zL4FqkGCF7NPMgiV0g==\",\"flag\":{\"flagStatus\":\"notFlagged\",\"@odata.type\":\"#microsoft.graph.followupFlag\"}," + - "\"from\":{\"emailAddress\":{\"address\":\"dustina@8qzvrj.onmicrosoft.com\",\"name\":\"Dustin Abbot\",\"@odata.type\":\"#microsoft.graph.emailAddress\"},\"@odata.type\":\"#microsoft.graph.recipient\"},\"hasAttachments\":true,\"importance\":\"normal\",\"inferenceClassification\":\"focused\"," + - "\"internetMessageId\":\"\",\"isDeliveryReceiptRequested\":false,\"isDraft\":false,\"isRead\":false,\"isReadReceiptRequested\":false," + - "\"parentFolderId\":\"AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwAuAAAAAADCNgjhM9QmQYWNcI7hCpPrAQDSEBNbUIB9RL6ePDeF3FIYAAAAAAEMAAA=\",\"receivedDateTime\":\"2022-09-29T17:39:07Z\",\"replyTo\":[],\"sender\":{\"emailAddress\":{\"address\":\"dustina@8qzvrj.onmicrosoft.com\",\"name\":\"Dustin Abbot\"," + - "\"@odata.type\":\"#microsoft.graph.emailAddress\"},\"@odata.type\":\"#microsoft.graph.recipient\"},\"sentDateTime\":\"2022-09-29T17:39:02Z\"," + - "\"subject\":\"" + subject + "\",\"toRecipients\":[{\"emailAddress\":{\"address\":\"LidiaH@8qzvrj.onmicrosoft.com\",\"name\":\"Lidia Holloway\",\"@odata.type\":\"#microsoft.graph.emailAddress\"},\"@odata.type\":\"#microsoft.graph.recipient\"}]," + - "\"webLink\":\"https://outlook.office365.com/owa/?ItemID=AAMkAGZmNjNlYjI3LWJlZWYtNGI4Mi04YjMyLTIxYThkNGQ4NmY1MwBGAAAAAADCNgjhM9QmQYWNcI7hCpPrBwDSEBNbUIB9RL6ePDeF3FIYAAAAAAEMAADSEBNbUIB9RL6ePDeF3FIYAAB4moqeAAA%3D&exvsurl=1&viewmodel=ReadMessageItem\"}" - - attachmentSize := 3 * 1024 * 1024 // 3 MB - attachmentBytes := make([]byte, attachmentSize) - - // Attachment content bytes are base64 encoded - return []byte(fmt.Sprintf(messageFmt, attachmentSize, base64.StdEncoding.EncodeToString([]byte(attachmentBytes)))) + return GetMockMessageWithSizedAttachment(subject, 3) } // GetMessageWithOneDriveAttachment returns a message with an OneDrive attachment represented in bytes From 37cd9b8ca2ada4314356dbb5a8f44b857110c44b Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Sat, 28 Jan 2023 03:24:12 +0000 Subject: [PATCH 18/36] [Snyk] Security upgrade amazonlinux from latest to 2 (#2310) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keeping your Docker base image up-to-date means you’ll benefit from security fixes in the latest version of your chosen image. #### Changes included in this PR - src/testfiles/otel_daemon/Dockerfile We recommend upgrading to `amazonlinux:2`, as this image has only 0 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected. Some of the most important vulnerabilities in your base image include: | Severity | Issue | Exploit Maturity | | :------: | :---- | :--------------- | | ![high severity](https://res.cloudinary.com/snyk/image/upload/w_20,h_20/v1561977819/icon/h.png "high severity") | Integer Overflow or Wraparound
[SNYK-AMZN2-KRB5LIBS-3244096](https://snyk.io/vuln/SNYK-AMZN2-KRB5LIBS-3244096) | No Known Exploit | | ![medium severity](https://res.cloudinary.com/snyk/image/upload/w_20,h_20/v1561977819/icon/m.png "medium severity") | Out-of-bounds Write
[SNYK-AMZN2-VIMDATA-3244105](https://snyk.io/vuln/SNYK-AMZN2-VIMDATA-3244105) | No Known Exploit | | ![medium severity](https://res.cloudinary.com/snyk/image/upload/w_20,h_20/v1561977819/icon/m.png "medium severity") | Out-of-bounds Write
[SNYK-AMZN2-VIMMINIMAL-3244088](https://snyk.io/vuln/SNYK-AMZN2-VIMMINIMAL-3244088) | No Known Exploit | --- **Note:** _You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs._ For more information: 🧐 [View latest project report](https://app.snyk.io/org/asimonalcion.ai/project/70e8c43e-1af4-4f6c-97ce-f2acbe45f2f4?utm_source=github&utm_medium=referral&page=fix-pr) 🛠 [Adjust project settings](https://app.snyk.io/org/asimonalcion.ai/project/70e8c43e-1af4-4f6c-97ce-f2acbe45f2f4?utm_source=github&utm_medium=referral&page=fix-pr/settings) [//]: # 'snyk:metadata:{"prId":"2b57a20d-47ea-4612-88f0-3248edceb33e","prPublicId":"2b57a20d-47ea-4612-88f0-3248edceb33e","dependencies":[{"name":"amazonlinux","from":"latest","to":"2"}],"packageManager":"dockerfile","projectPublicId":"70e8c43e-1af4-4f6c-97ce-f2acbe45f2f4","projectUrl":"https://app.snyk.io/org/asimonalcion.ai/project/70e8c43e-1af4-4f6c-97ce-f2acbe45f2f4?utm_source=github&utm_medium=referral&page=fix-pr","type":"auto","patch":[],"vulns":["SNYK-AMZN2-KRB5LIBS-3244096","SNYK-AMZN2-VIMMINIMAL-3244088","SNYK-AMZN2-VIMDATA-3244105"],"upgrade":["SNYK-AMZN2-KRB5LIBS-3244096","SNYK-AMZN2-VIMDATA-3244105","SNYK-AMZN2-VIMMINIMAL-3244088"],"isBreakingChange":false,"env":"prod","prType":"fix","templateVariants":["updated-fix-title"],"priorityScoreList":[null,null,null]}' --- **Learn how to fix vulnerabilities with free interactive lessons:** 🦉 [Learn about vulnerability in an interactive lesson of Snyk Learn.](https://learn.snyk.io/?loc=fix-pr) --- src/testfiles/otel_daemon/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testfiles/otel_daemon/Dockerfile b/src/testfiles/otel_daemon/Dockerfile index 85afeb757..89b956905 100644 --- a/src/testfiles/otel_daemon/Dockerfile +++ b/src/testfiles/otel_daemon/Dockerfile @@ -1,4 +1,4 @@ -FROM amazonlinux +FROM amazonlinux:2 RUN yum install -y unzip RUN curl -o daemon.zip https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-3.x.zip RUN unzip daemon.zip && cp xray /usr/bin/xray From d431b99970e0c45fd643a75ec0fa434dbfd5dfc2 Mon Sep 17 00:00:00 2001 From: Niraj Tolia Date: Sat, 28 Jan 2023 22:02:24 -0800 Subject: [PATCH 19/36] Remove new line check for new version (#2311) ## Description Should fix the release process ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :bug: Bugfix --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9739788cb..acc1b68eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -517,7 +517,7 @@ jobs: curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_x86_64.tar.gz > corso.tar.gz tar -xf corso.tar.gz ./corso --help - ./corso --version 2>&1 | grep -E "^version: ${{ env.CORSO_VERSION }}$" + ./corso --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$" - name: Validate arm64 binary artifacts uses: uraimo/run-on-arch-action@v2 with: @@ -531,7 +531,7 @@ jobs: curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_arm64.tar.gz > corso.tar.gz tar -xf corso.tar.gz ./corso --help - ./corso --version 2>&1 | grep -E "^version: ${{ env.CORSO_VERSION }}$" + ./corso --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$" Validate-Docker-Artifacts: needs: [Publish-Binary, Publish-Image, SetEnv] @@ -549,11 +549,11 @@ jobs: - name: Validate amd64 container images run: | docker run --platform linux/amd64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --help - docker run --platform linux/amd64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --version | grep -E "^version: ${{ env.CORSO_VERSION }}$" + docker run --platform linux/amd64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --version | grep -E "version: ${{ env.CORSO_VERSION }}$" - name: Validate arm64 container images run: | docker run --platform linux/arm64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --help - docker run --platform linux/amd64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --version | grep -E "^version: ${{ env.CORSO_VERSION }}$" + docker run --platform linux/amd64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --version | grep -E "version: ${{ env.CORSO_VERSION }}$" Validate-MacOS-Artifacts: needs: [Publish-Binary, Publish-Image, SetEnv] @@ -569,7 +569,7 @@ jobs: curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Darwin_x86_64.tar.gz > corso.tar.gz tar -xf corso.tar.gz ./corso --help - ./corso --version 2>&1 | grep -E "^version: ${{ env.CORSO_VERSION }}$" + ./corso --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$" - name: Validate arm64 binary artifacts run: | set -ex @@ -590,7 +590,7 @@ jobs: curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Windows_x86_64.zip -o corso.zip 7z x corso.zip ./corso.exe --help - ./corso.exe --version 2>&1 | grep -E "^version: ${{ env.CORSO_VERSION }}$" + ./corso.exe --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$" Publish-Website-Test: needs: [Test-Suite-Trusted, Linting, Website-Linting, SetEnv] @@ -634,4 +634,4 @@ jobs: steps: - name: Validate docs run: | - curl https://corsobackup.io/docs/quickstart/ | grep https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_x86_64.tar.gz \ No newline at end of file + curl https://corsobackup.io/docs/quickstart/ | grep https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_x86_64.tar.gz From 414c843daf0443120ed22e926273b969b855734c Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Sun, 29 Jan 2023 12:02:03 +0530 Subject: [PATCH 20/36] Changelog update post release (#2312) ## Description Updating headers in CHANGELOG now that v.0.2.0 is out. --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 696b33e9d..16b893cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] (alpha) +## [v0.2.0] (alpha) - 2023-1-29 + ### Fixed - Check if the user specified for an exchange backup operation has a mailbox. @@ -129,7 +131,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Miscellaneous - Optional usage statistics reporting ([RM-35](https://github.com/alcionai/corso-roadmap/issues/35)) -[Unreleased]: https://github.com/alcionai/corso/compare/v0.1.0...HEAD +[Unreleased]: https://github.com/alcionai/corso/compare/v0.2.0...HEAD +[v0.2.0]: https://github.com/alcionai/corso/compare/v0.1.0...v0.2.0 [v0.1.0]: https://github.com/alcionai/corso/compare/v0.0.4...v0.1.0 [v0.0.4]: https://github.com/alcionai/corso/compare/v0.0.3...v0.0.4 [v0.0.3]: https://github.com/alcionai/corso/compare/v0.0.2...v0.0.3 From 27e935301cbd45b1625efe52c4581d14dfe012b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 07:36:21 +0000 Subject: [PATCH 21/36] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20github.com/aw?= =?UTF-8?q?s/aws-sdk-go=20from=201.44.188=20to=201.44.189=20in=20/src=20(#?= =?UTF-8?q?2314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.188 to 1.44.189.
Release notes

Sourced from github.com/aws/aws-sdk-go's releases.

Release v1.44.189 (2023-01-27)

Service Client Updates

  • service/application-autoscaling: Adds new service
  • service/appstream: Updates service waiters
    • Fixing the issue where Appstream waiters hang for fleet_started and fleet_stopped.
  • service/elasticbeanstalk: Adds new service
    • Enabled FIPS endpoints for GovCloud (US) regions in SDK.
  • service/fis: Adds new service
  • service/glacier: Adds new service
    • Enabled FIPS endpoints for GovCloud (US) regions in SDK.
  • service/greengrass: Adds new service
    • Enabled FIPS endpoints for GovCloud (US) regions in SDK.
  • service/greengrassv2: Adds new service
  • service/mediatailor: Updates service API and documentation
  • service/outposts: Updates service API and documentation
  • service/runtime.sagemaker: Updates service API and documentation
  • service/sagemaker: Updates service API and documentation
    • This release supports running SageMaker Training jobs with container images that are in a private Docker registry.
  • service/serverlessrepo: Adds new service
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/aws/aws-sdk-go&package-manager=go_modules&previous-version=1.44.188&new-version=1.44.189)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- src/go.mod | 2 +- src/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/go.mod b/src/go.mod index 64ff5f1b8..b9cb5ec53 100644 --- a/src/go.mod +++ b/src/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 github.com/alcionai/clues v0.0.0-20230120231953-1cf61dbafc40 - github.com/aws/aws-sdk-go v1.44.188 + github.com/aws/aws-sdk-go v1.44.189 github.com/aws/aws-xray-sdk-go v1.8.0 github.com/google/uuid v1.3.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/src/go.sum b/src/go.sum index 9b63e27fe..b8f926e79 100644 --- a/src/go.sum +++ b/src/go.sum @@ -62,8 +62,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/aws/aws-sdk-go v1.44.188 h1:NCN6wFDWKU72Ka+f7cCk3HRj1KxkEXhRdr7lO8oBRRQ= -github.com/aws/aws-sdk-go v1.44.188/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.189 h1:9PBrjndH1uL5AN8818qI3duhQ4hgkMuLvqkJlg9MRyk= +github.com/aws/aws-sdk-go v1.44.189/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-xray-sdk-go v1.8.0 h1:0xncHZ588wB/geLjbM/esoW3FOEThWy2TJyb4VXfLFY= github.com/aws/aws-xray-sdk-go v1.8.0/go.mod h1:7LKe47H+j3evfvS1+q0wzpoaGXGrF3mUsfM+thqVO+A= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= From d763d9597628863b7919547dbedc36469c49dea7 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 30 Jan 2023 11:51:32 -0500 Subject: [PATCH 22/36] BUG Fix: Restore: Operations (#2316) BUG FIX: Adds clause to return an error if experienced during path building of a collection. ## Description ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :bug: Bugfix - related to #2257 ## Test Plan - [x] :muscle: Manual --- src/internal/operations/restore.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/internal/operations/restore.go b/src/internal/operations/restore.go index 3ed84c5f8..7dfd689d6 100644 --- a/src/internal/operations/restore.go +++ b/src/internal/operations/restore.go @@ -309,5 +309,9 @@ func formatDetailsForRestoration( paths[i] = p } + if errs != nil { + return nil, errs + } + return paths, nil } From ac1ff0c5cc686c302f211ac7e4bb8a63947bef35 Mon Sep 17 00:00:00 2001 From: Niraj Tolia Date: Mon, 30 Jan 2023 09:03:18 -0800 Subject: [PATCH 23/36] Add guidance on using Corso repos (#2315) ## Description Clarify how Corso repositories and object storage buckets are related. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :world_map: Documentation --- website/docs/setup/repos.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/website/docs/setup/repos.md b/website/docs/setup/repos.md index 6dbc62dff..3c2a7c119 100644 --- a/website/docs/setup/repos.md +++ b/website/docs/setup/repos.md @@ -10,9 +10,15 @@ import TabItem from '@theme/TabItem'; import TOCInline from '@theme/TOCInline'; import {Version} from '@site/src/corsoEnv'; -A Corso [repository](../concepts#corso-concepts) stores encrypted copies of your backup data. Corso uses +A Corso [repository](../concepts#corso-concepts) stores encrypted copies of a Microsoft 365 tenant's +backup data. Each repository is configured to store data in an object storage bucket and, optionally, +a user-specified prefix within the bucket. A repository is only meant to store a single tenant's data +but a single object storage bucket can contain multiple repositories if unique `--prefix` options are +specified when initializing a repository. + +Within a repository, Corso uses AES256-GCM-HMAC-SHA256 to encrypt data at rest using keys that are derived from the repository passphrase. -Data in flight is encrypted via TLS. +Data in flight to and from the repositiry is encrypted via TLS. Repositories are supported on the following object storage systems: From 637b1904aaea55bd39f6f35ded2e1ff2c7304ecc Mon Sep 17 00:00:00 2001 From: Keepers Date: Mon, 30 Jan 2023 11:57:45 -0700 Subject: [PATCH 24/36] remove operation "started" (#2247) ## Description This flag is confusing, and is better represented by tracking errors. ## Type of change - [x] :broom: Tech Debt/Cleanup ## Test Plan - [x] :zap: Unit test --- src/internal/operations/backup.go | 10 ++++----- src/internal/operations/backup_test.go | 8 +++----- src/internal/operations/restore.go | 27 +++++++++---------------- src/internal/operations/restore_test.go | 4 +--- 4 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 026061b59..7d6c14748 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -90,7 +90,6 @@ type backupStats struct { k *kopia.BackupStats gc *support.ConnectorOperationStatus resourceCount int - started bool readErr, writeErr error } @@ -228,7 +227,6 @@ func (op *BackupOperation) Run(ctx context.Context) (err error) { // should always be 1, since backups are 1:1 with resourceOwners. opStats.resourceCount = 1 - opStats.started = true return err } @@ -558,9 +556,12 @@ func (op *BackupOperation) persistResults( ) error { op.Results.StartedAt = started op.Results.CompletedAt = time.Now() + op.Results.ReadErrors = opStats.readErr + op.Results.WriteErrors = opStats.writeErr op.Status = Completed - if !opStats.started { + + if opStats.readErr != nil || opStats.writeErr != nil { op.Status = Failed return multierror.Append( @@ -573,9 +574,6 @@ func (op *BackupOperation) persistResults( op.Status = NoData } - op.Results.ReadErrors = opStats.readErr - op.Results.WriteErrors = opStats.writeErr - op.Results.BytesRead = opStats.k.TotalHashedBytes op.Results.BytesUploaded = opStats.k.TotalUploadedBytes op.Results.ItemsRead = opStats.gc.Successful diff --git a/src/internal/operations/backup_test.go b/src/internal/operations/backup_test.go index 795f341c6..2a7a1ecce 100644 --- a/src/internal/operations/backup_test.go +++ b/src/internal/operations/backup_test.go @@ -373,7 +373,6 @@ func (suite *BackupOpSuite) TestBackupOperation_PersistResults() { expectStatus: Completed, expectErr: assert.NoError, stats: backupStats{ - started: true, resourceCount: 1, k: &kopia.BackupStats{ TotalFileCount: 1, @@ -389,7 +388,7 @@ func (suite *BackupOpSuite) TestBackupOperation_PersistResults() { expectStatus: Failed, expectErr: assert.Error, stats: backupStats{ - started: false, + readErr: assert.AnError, k: &kopia.BackupStats{}, gc: &support.ConnectorOperationStatus{}, }, @@ -398,9 +397,8 @@ func (suite *BackupOpSuite) TestBackupOperation_PersistResults() { expectStatus: NoData, expectErr: assert.NoError, stats: backupStats{ - started: true, - k: &kopia.BackupStats{}, - gc: &support.ConnectorOperationStatus{}, + k: &kopia.BackupStats{}, + gc: &support.ConnectorOperationStatus{}, }, }, } diff --git a/src/internal/operations/restore.go b/src/internal/operations/restore.go index 7dfd689d6..8ddaa8d29 100644 --- a/src/internal/operations/restore.go +++ b/src/internal/operations/restore.go @@ -89,7 +89,6 @@ type restoreStats struct { gc *support.ConnectorOperationStatus bytesRead *stats.ByteCounter resourceCount int - started bool readErr, writeErr error // a transient value only used to pair up start-end events. @@ -143,10 +142,8 @@ func (op *RestoreOperation) Run(ctx context.Context) (restoreDetails *details.De detailsStore, ) if err != nil { - err = errors.Wrap(err, "restore") - opStats.readErr = err - - return nil, err + opStats.readErr = errors.Wrap(err, "restore") + return nil, opStats.readErr } ctx = clues.Add(ctx, "resource_owner", bup.Selector.DiscreteOwner) @@ -178,10 +175,8 @@ func (op *RestoreOperation) Run(ctx context.Context) (restoreDetails *details.De dcs, err := op.kopia.RestoreMultipleItems(ctx, bup.SnapshotID, paths, opStats.bytesRead) if err != nil { - err = errors.Wrap(err, "retrieving service data") - opStats.readErr = err - - return nil, err + opStats.readErr = errors.Wrap(err, "retrieving service data") + return nil, opStats.readErr } kopiaComplete <- struct{}{} @@ -207,14 +202,11 @@ func (op *RestoreOperation) Run(ctx context.Context) (restoreDetails *details.De op.Destination, dcs) if err != nil { - err = errors.Wrap(err, "restoring service data") - opStats.writeErr = err - - return nil, err + opStats.writeErr = errors.Wrap(err, "restoring service data") + return nil, opStats.writeErr } restoreComplete <- struct{}{} - opStats.started = true opStats.gc = gc.AwaitStatus() logger.Ctx(ctx).Debug(gc.PrintableStatus()) @@ -230,10 +222,12 @@ func (op *RestoreOperation) persistResults( ) error { op.Results.StartedAt = started op.Results.CompletedAt = time.Now() + op.Results.ReadErrors = opStats.readErr + op.Results.WriteErrors = opStats.writeErr op.Status = Completed - if !opStats.started { + if opStats.readErr != nil || opStats.writeErr != nil { op.Status = Failed return multierror.Append( @@ -246,9 +240,6 @@ func (op *RestoreOperation) persistResults( op.Status = NoData } - op.Results.ReadErrors = opStats.readErr - op.Results.WriteErrors = opStats.writeErr - op.Results.BytesRead = opStats.bytesRead.NumBytes op.Results.ItemsRead = len(opStats.cs) // TODO: file count, not collection count op.Results.ItemsWritten = opStats.gc.Successful diff --git a/src/internal/operations/restore_test.go b/src/internal/operations/restore_test.go index 44de04c66..973a178b4 100644 --- a/src/internal/operations/restore_test.go +++ b/src/internal/operations/restore_test.go @@ -57,7 +57,6 @@ func (suite *RestoreOpSuite) TestRestoreOperation_PersistResults() { expectStatus: Completed, expectErr: assert.NoError, stats: restoreStats{ - started: true, resourceCount: 1, bytesRead: &stats.ByteCounter{ NumBytes: 42, @@ -73,7 +72,7 @@ func (suite *RestoreOpSuite) TestRestoreOperation_PersistResults() { expectStatus: Failed, expectErr: assert.Error, stats: restoreStats{ - started: false, + readErr: assert.AnError, bytesRead: &stats.ByteCounter{}, gc: &support.ConnectorOperationStatus{}, }, @@ -82,7 +81,6 @@ func (suite *RestoreOpSuite) TestRestoreOperation_PersistResults() { expectStatus: NoData, expectErr: assert.NoError, stats: restoreStats{ - started: true, bytesRead: &stats.ByteCounter{}, cs: []data.Collection{}, gc: &support.ConnectorOperationStatus{}, From 03642c517f69862d82d00851dfffbf029ac192c3 Mon Sep 17 00:00:00 2001 From: Keepers Date: Mon, 30 Jan 2023 12:24:44 -0700 Subject: [PATCH 25/36] standardize deleteContainer func in exch api (#2246) ## Description Minor refactor that came up while hunting bugs. For the life of me, I cannot find the reason for read/write counts being off in event incrementals. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :broom: Tech Debt/Cleanup ## Issue(s) * #2022 ## Test Plan - [x] :muscle: Manual - [x] :green_heart: E2E --- .../connector/exchange/api/contacts.go | 5 +- src/internal/connector/exchange/api/events.go | 4 +- src/internal/connector/exchange/api/mail.go | 4 +- .../connector/exchange/restore_test.go | 75 +++++++++---------- src/internal/kopia/upload.go | 16 ++++ .../operations/backup_integration_test.go | 21 +++--- src/internal/tester/storage.go | 5 +- 7 files changed, 74 insertions(+), 56 deletions(-) diff --git a/src/internal/connector/exchange/api/contacts.go b/src/internal/connector/exchange/api/contacts.go index 2e9014235..0db1e964c 100644 --- a/src/internal/connector/exchange/api/contacts.go +++ b/src/internal/connector/exchange/api/contacts.go @@ -48,9 +48,8 @@ func (c Contacts) CreateContactFolder( return c.stable.Client().UsersById(user).ContactFolders().Post(ctx, requestBody, nil) } -// DeleteContactFolder deletes the ContactFolder associated with the M365 ID if permissions are valid. -// Errors returned if the function call was not successful. -func (c Contacts) DeleteContactFolder( +// DeleteContainer deletes the ContactFolder associated with the M365 ID if permissions are valid. +func (c Contacts) DeleteContainer( ctx context.Context, user, folderID string, ) error { diff --git a/src/internal/connector/exchange/api/events.go b/src/internal/connector/exchange/api/events.go index b3e6f9467..e643c1f89 100644 --- a/src/internal/connector/exchange/api/events.go +++ b/src/internal/connector/exchange/api/events.go @@ -50,9 +50,9 @@ func (c Events) CreateCalendar( return c.stable.Client().UsersById(user).Calendars().Post(ctx, requestbody, nil) } -// DeleteCalendar removes calendar from user's M365 account +// DeleteContainer removes a calendar from user's M365 account // Reference: https://docs.microsoft.com/en-us/graph/api/calendar-delete?view=graph-rest-1.0&tabs=go -func (c Events) DeleteCalendar( +func (c Events) DeleteContainer( ctx context.Context, user, calendarID string, ) error { diff --git a/src/internal/connector/exchange/api/mail.go b/src/internal/connector/exchange/api/mail.go index 4c9d564f0..bbac48a66 100644 --- a/src/internal/connector/exchange/api/mail.go +++ b/src/internal/connector/exchange/api/mail.go @@ -72,9 +72,9 @@ func (c Mail) CreateMailFolderWithParent( Post(ctx, requestBody, nil) } -// DeleteMailFolder removes a mail folder with the corresponding M365 ID from the user's M365 Exchange account +// DeleteContainer removes a mail folder with the corresponding M365 ID from the user's M365 Exchange account // Reference: https://docs.microsoft.com/en-us/graph/api/mailfolder-delete?view=graph-rest-1.0&tabs=http -func (c Mail) DeleteMailFolder( +func (c Mail) DeleteContainer( ctx context.Context, user, folderID string, ) error { diff --git a/src/internal/connector/exchange/restore_test.go b/src/internal/connector/exchange/restore_test.go index f439ea3ad..9c32fd530 100644 --- a/src/internal/connector/exchange/restore_test.go +++ b/src/internal/connector/exchange/restore_test.go @@ -76,7 +76,7 @@ func (suite *ExchangeRestoreSuite) TestRestoreContact() { defer func() { // Remove the folder containing contact prior to exiting test - err = suite.ac.Contacts().DeleteContactFolder(ctx, userID, folderID) + err = suite.ac.Contacts().DeleteContainer(ctx, userID, folderID) assert.NoError(t, err) }() @@ -110,7 +110,7 @@ func (suite *ExchangeRestoreSuite) TestRestoreEvent() { defer func() { // Removes calendar containing events created during the test - err = suite.ac.Events().DeleteCalendar(ctx, userID, calendarID) + err = suite.ac.Events().DeleteContainer(ctx, userID, calendarID) assert.NoError(t, err) }() @@ -124,6 +124,10 @@ func (suite *ExchangeRestoreSuite) TestRestoreEvent() { assert.NotNil(t, info, "event item info") } +type containerDeleter interface { + DeleteContainer(context.Context, string, string) error +} + // TestRestoreExchangeObject verifies path.Category usage for restored objects func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { a := tester.NewM365Account(suite.T()) @@ -133,20 +137,24 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { service, err := createService(m365) require.NoError(suite.T(), err) + deleters := map[path.CategoryType]containerDeleter{ + path.EmailCategory: suite.ac.Mail(), + path.ContactsCategory: suite.ac.Contacts(), + path.EventsCategory: suite.ac.Events(), + } + userID := tester.M365UserID(suite.T()) now := time.Now() tests := []struct { name string bytes []byte category path.CategoryType - cleanupFunc func(context.Context, string, string) error destination func(*testing.T, context.Context) string }{ { - name: "Test Mail", - bytes: mockconnector.GetMockMessageBytes("Restore Exchange Object"), - category: path.EmailCategory, - cleanupFunc: suite.ac.Mail().DeleteMailFolder, + name: "Test Mail", + bytes: mockconnector.GetMockMessageBytes("Restore Exchange Object"), + category: path.EmailCategory, destination: func(t *testing.T, ctx context.Context) string { folderName := "TestRestoreMailObject: " + common.FormatSimpleDateTime(now) folder, err := suite.ac.Mail().CreateMailFolder(ctx, userID, folderName) @@ -156,10 +164,9 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { }, }, { - name: "Test Mail: One Direct Attachment", - bytes: mockconnector.GetMockMessageWithDirectAttachment("Restore 1 Attachment"), - category: path.EmailCategory, - cleanupFunc: suite.ac.Mail().DeleteMailFolder, + name: "Test Mail: One Direct Attachment", + bytes: mockconnector.GetMockMessageWithDirectAttachment("Restore 1 Attachment"), + category: path.EmailCategory, destination: func(t *testing.T, ctx context.Context) string { folderName := "TestRestoreMailwithAttachment: " + common.FormatSimpleDateTime(now) folder, err := suite.ac.Mail().CreateMailFolder(ctx, userID, folderName) @@ -169,10 +176,9 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { }, }, { - name: "Test Mail: One Large Attachment", - bytes: mockconnector.GetMockMessageWithLargeAttachment("Restore Large Attachment"), - category: path.EmailCategory, - cleanupFunc: suite.ac.Mail().DeleteMailFolder, + name: "Test Mail: One Large Attachment", + bytes: mockconnector.GetMockMessageWithLargeAttachment("Restore Large Attachment"), + category: path.EmailCategory, destination: func(t *testing.T, ctx context.Context) string { folderName := "TestRestoreMailwithLargeAttachment: " + common.FormatSimpleDateTime(now) folder, err := suite.ac.Mail().CreateMailFolder(ctx, userID, folderName) @@ -182,10 +188,9 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { }, }, { - name: "Test Mail: Two Attachments", - bytes: mockconnector.GetMockMessageWithTwoAttachments("Restore 2 Attachments"), - category: path.EmailCategory, - cleanupFunc: suite.ac.Mail().DeleteMailFolder, + name: "Test Mail: Two Attachments", + bytes: mockconnector.GetMockMessageWithTwoAttachments("Restore 2 Attachments"), + category: path.EmailCategory, destination: func(t *testing.T, ctx context.Context) string { folderName := "TestRestoreMailwithAttachments: " + common.FormatSimpleDateTime(now) folder, err := suite.ac.Mail().CreateMailFolder(ctx, userID, folderName) @@ -195,10 +200,9 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { }, }, { - name: "Test Mail: Reference(OneDrive) Attachment", - bytes: mockconnector.GetMessageWithOneDriveAttachment("Restore Reference(OneDrive) Attachment"), - category: path.EmailCategory, - cleanupFunc: suite.ac.Mail().DeleteMailFolder, + name: "Test Mail: Reference(OneDrive) Attachment", + bytes: mockconnector.GetMessageWithOneDriveAttachment("Restore Reference(OneDrive) Attachment"), + category: path.EmailCategory, destination: func(t *testing.T, ctx context.Context) string { folderName := "TestRestoreMailwithReferenceAttachment: " + common.FormatSimpleDateTime(now) folder, err := suite.ac.Mail().CreateMailFolder(ctx, userID, folderName) @@ -209,10 +213,9 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { }, // TODO: #884 - reinstate when able to specify root folder by name { - name: "Test Contact", - bytes: mockconnector.GetMockContactBytes("Test_Omega"), - category: path.ContactsCategory, - cleanupFunc: suite.ac.Contacts().DeleteContactFolder, + name: "Test Contact", + bytes: mockconnector.GetMockContactBytes("Test_Omega"), + category: path.ContactsCategory, destination: func(t *testing.T, ctx context.Context) string { folderName := "TestRestoreContactObject: " + common.FormatSimpleDateTime(now) folder, err := suite.ac.Contacts().CreateContactFolder(ctx, userID, folderName) @@ -222,10 +225,9 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { }, }, { - name: "Test Events", - bytes: mockconnector.GetDefaultMockEventBytes("Restored Event Object"), - category: path.EventsCategory, - cleanupFunc: suite.ac.Events().DeleteCalendar, + name: "Test Events", + bytes: mockconnector.GetDefaultMockEventBytes("Restored Event Object"), + category: path.EventsCategory, destination: func(t *testing.T, ctx context.Context) string { calendarName := "TestRestoreEventObject: " + common.FormatSimpleDateTime(now) calendar, err := suite.ac.Events().CreateCalendar(ctx, userID, calendarName) @@ -235,10 +237,9 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { }, }, { - name: "Test Event with Attachment", - bytes: mockconnector.GetMockEventWithAttachment("Restored Event Attachment"), - category: path.EventsCategory, - cleanupFunc: suite.ac.Events().DeleteCalendar, + name: "Test Event with Attachment", + bytes: mockconnector.GetMockEventWithAttachment("Restored Event Attachment"), + category: path.EventsCategory, destination: func(t *testing.T, ctx context.Context) string { calendarName := "TestRestoreEventObject_" + common.FormatSimpleDateTime(now) calendar, err := suite.ac.Events().CreateCalendar(ctx, userID, calendarName) @@ -266,9 +267,7 @@ func (suite *ExchangeRestoreSuite) TestRestoreExchangeObject() { ) assert.NoError(t, err, support.ConnectorStackErrorTrace(err)) assert.NotNil(t, info, "item info is populated") - - cleanupError := test.cleanupFunc(ctx, userID, destination) - assert.NoError(t, cleanupError) + assert.NoError(t, deleters[test.category].DeleteContainer(ctx, userID, destination)) }) } } diff --git a/src/internal/kopia/upload.go b/src/internal/kopia/upload.go index 5301e6872..8ddb46978 100644 --- a/src/internal/kopia/upload.go +++ b/src/internal/kopia/upload.go @@ -3,10 +3,13 @@ package kopia import ( "bytes" "context" + "encoding/base64" "encoding/binary" + "fmt" "io" "os" "runtime/trace" + "strings" "sync" "sync/atomic" "time" @@ -204,6 +207,19 @@ func (cp *corsoProgress) FinishedHashingFile(fname string, bs int64) { // Pass the call through as well so we don't break expected functionality. defer cp.UploadProgress.FinishedHashingFile(fname, bs) + sl := strings.Split(fname, "/") + + for i := range sl { + rdt, err := base64.StdEncoding.DecodeString(sl[i]) + if err != nil { + fmt.Println("f did not decode") + } + + sl[i] = string(rdt) + } + + logger.Ctx(context.Background()).Debugw("finished hashing file", "path", sl[2:]) + atomic.AddInt64(&cp.totalBytes, bs) } diff --git a/src/internal/operations/backup_integration_test.go b/src/internal/operations/backup_integration_test.go index f6e63b022..c28159c1a 100644 --- a/src/internal/operations/backup_integration_test.go +++ b/src/internal/operations/backup_integration_test.go @@ -633,6 +633,8 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchangeIncrementals() { ctx, flush := tester.NewContext() defer flush() + tester.LogTimeOfTest(suite.T()) + var ( t = suite.T() acct = tester.NewM365Account(t) @@ -803,7 +805,7 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchangeIncrementals() { { name: "move an email folder to a subfolder", updateUserData: func(t *testing.T) { - // contacts cannot be sufoldered; this is an email-only change + // contacts and events cannot be sufoldered; this is an email-only change toContainer := dataset[path.EmailCategory].dests[container1].containerID fromContainer := dataset[path.EmailCategory].dests[container2].containerID @@ -826,23 +828,22 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchangeIncrementals() { updateUserData: func(t *testing.T) { for category, d := range dataset { containerID := d.dests[container2].containerID - cli := gc.Service.Client().UsersById(suite.user) switch category { case path.EmailCategory: require.NoError( t, - cli.MailFoldersById(containerID).Delete(ctx, nil), + ac.Mail().DeleteContainer(ctx, suite.user, containerID), "deleting an email folder") case path.ContactsCategory: require.NoError( t, - cli.ContactFoldersById(containerID).Delete(ctx, nil), + ac.Contacts().DeleteContainer(ctx, suite.user, containerID), "deleting a contacts folder") case path.EventsCategory: require.NoError( t, - cli.CalendarsById(containerID).Delete(ctx, nil), + ac.Events().DeleteContainer(ctx, suite.user, containerID), "deleting a calendar") } } @@ -923,19 +924,19 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchangeIncrementals() { require.NoError(t, err, "updating contact folder name") case path.EventsCategory: - ccf := cli.CalendarsById(containerID) + cbi := cli.CalendarsById(containerID) - body, err := ccf.Get(ctx, nil) + body, err := cbi.Get(ctx, nil) require.NoError(t, err, "getting calendar") body.SetName(&containerRename) - _, err = ccf.Patch(ctx, body, nil) + _, err = cbi.Patch(ctx, body, nil) require.NoError(t, err, "updating calendar name") } } }, - itemsRead: 0, - itemsWritten: 4, + itemsRead: 0, // containers are not counted as reads + itemsWritten: 4, // two items per category }, { name: "add a new item", diff --git a/src/internal/tester/storage.go b/src/internal/tester/storage.go index 0cfabba20..3e16ce05e 100644 --- a/src/internal/tester/storage.go +++ b/src/internal/tester/storage.go @@ -29,11 +29,14 @@ func NewPrefixedS3Storage(t *testing.T) storage.Storage { cfg, err := readTestConfig() require.NoError(t, err, "configuring storage from test file") + prefix := testRepoRootPrefix + t.Name() + "-" + now + t.Logf("testing at s3 bucket [%s] prefix [%s]", cfg[TestCfgBucket], prefix) + st, err := storage.NewStorage( storage.ProviderS3, storage.S3Config{ Bucket: cfg[TestCfgBucket], - Prefix: testRepoRootPrefix + t.Name() + "-" + now, + Prefix: prefix, }, storage.CommonConfig{ Corso: credentials.GetCorso(), From 2458508969c05e6e6b099fc470c227d35d8a262c Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Mon, 30 Jan 2023 11:44:06 -0800 Subject: [PATCH 26/36] Wire up GraphConnector <-> BackupOp item exclude list (#2245) ## Description Return an item exclude list from GraphConnector to BackupOp. BackupOp does not yet pass this to kopia wrapper. Returned list is set to nil (eventually) by all components so even if this were wired to kopia wrapper it wouldn't change the current behavior of the system ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No ## Type of change - [x] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Issue(s) * #2243 merge after: * #2143 ## Test Plan - [ ] :muscle: Manual - [x] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/connector/data_collections.go | 36 ++++++++++--------- .../connector/data_collections_test.go | 19 +++++++--- .../connector/exchange/data_collections.go | 12 ++++--- .../connector/graph_connector_test.go | 8 +++-- .../connector/onedrive/collections.go | 14 ++++---- src/internal/connector/onedrive/drive_test.go | 4 ++- .../connector/sharepoint/data_collections.go | 20 +++++------ src/internal/operations/backup.go | 6 +++- 8 files changed, 73 insertions(+), 46 deletions(-) diff --git a/src/internal/connector/data_collections.go b/src/internal/connector/data_collections.go index 0b6d20b27..7d187a854 100644 --- a/src/internal/connector/data_collections.go +++ b/src/internal/connector/data_collections.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/pkg/errors" + "golang.org/x/exp/maps" "github.com/alcionai/corso/src/internal/connector/discovery" "github.com/alcionai/corso/src/internal/connector/discovery/api" @@ -35,27 +36,27 @@ func (gc *GraphConnector) DataCollections( sels selectors.Selector, metadata []data.Collection, ctrlOpts control.Options, -) ([]data.Collection, error) { +) ([]data.Collection, map[string]struct{}, error) { ctx, end := D.Span(ctx, "gc:dataCollections", D.Index("service", sels.Service.String())) defer end() err := verifyBackupInputs(sels, gc.GetUsers(), gc.GetSiteIDs()) if err != nil { - return nil, err + return nil, nil, err } serviceEnabled, err := checkServiceEnabled(ctx, gc.Owners.Users(), path.ServiceType(sels.Service), sels.DiscreteOwner) if err != nil { - return nil, err + return nil, nil, err } if !serviceEnabled { - return []data.Collection{}, nil + return []data.Collection{}, nil, nil } switch sels.Service { case selectors.ServiceExchange: - colls, err := exchange.DataCollections( + colls, excludes, err := exchange.DataCollections( ctx, sels, metadata, @@ -64,7 +65,7 @@ func (gc *GraphConnector) DataCollections( gc.UpdateStatus, ctrlOpts) if err != nil { - return nil, err + return nil, nil, err } for _, c := range colls { @@ -79,13 +80,13 @@ func (gc *GraphConnector) DataCollections( } } - return colls, nil + return colls, excludes, nil case selectors.ServiceOneDrive: return gc.OneDriveDataCollections(ctx, sels, ctrlOpts) case selectors.ServiceSharePoint: - colls, err := sharepoint.DataCollections( + colls, excludes, err := sharepoint.DataCollections( ctx, gc.itemClient, sels, @@ -94,17 +95,17 @@ func (gc *GraphConnector) DataCollections( gc, ctrlOpts) if err != nil { - return nil, err + return nil, nil, err } for range colls { gc.incrementAwaitingMessages() } - return colls, nil + return colls, excludes, nil default: - return nil, errors.Errorf("service %s not supported", sels.Service.String()) + return nil, nil, errors.Errorf("service %s not supported", sels.Service.String()) } } @@ -182,15 +183,16 @@ func (gc *GraphConnector) OneDriveDataCollections( ctx context.Context, selector selectors.Selector, ctrlOpts control.Options, -) ([]data.Collection, error) { +) ([]data.Collection, map[string]struct{}, error) { odb, err := selector.ToOneDriveBackup() if err != nil { - return nil, errors.Wrap(err, "oneDriveDataCollection: parsing selector") + return nil, nil, errors.Wrap(err, "oneDriveDataCollection: parsing selector") } var ( user = selector.DiscreteOwner collections = []data.Collection{} + allExcludes = map[string]struct{}{} errs error ) @@ -198,7 +200,7 @@ func (gc *GraphConnector) OneDriveDataCollections( for _, scope := range odb.Scopes() { logger.Ctx(ctx).With("user", user).Debug("Creating OneDrive collections") - odcs, err := onedrive.NewCollections( + odcs, excludes, err := onedrive.NewCollections( gc.itemClient, gc.credentials.AzureTenantID, user, @@ -209,15 +211,17 @@ func (gc *GraphConnector) OneDriveDataCollections( ctrlOpts, ).Get(ctx) if err != nil { - return nil, support.WrapAndAppend(user, err, errs) + return nil, nil, support.WrapAndAppend(user, err, errs) } collections = append(collections, odcs...) + + maps.Copy(allExcludes, excludes) } for range collections { gc.incrementAwaitingMessages() } - return collections, errs + return collections, allExcludes, errs } diff --git a/src/internal/connector/data_collections_test.go b/src/internal/connector/data_collections_test.go index 877975bb5..c90bee511 100644 --- a/src/internal/connector/data_collections_test.go +++ b/src/internal/connector/data_collections_test.go @@ -99,7 +99,7 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestExchangeDataCollection for _, test := range tests { suite.T().Run(test.name, func(t *testing.T) { - collections, err := exchange.DataCollections( + collections, excludes, err := exchange.DataCollections( ctx, test.getSelector(t), nil, @@ -108,6 +108,8 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestExchangeDataCollection control.Options{}) require.NoError(t, err) + assert.Empty(t, excludes) + for range collections { connector.incrementAwaitingMessages() } @@ -199,9 +201,10 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestDataCollections_invali for _, test := range tests { suite.T().Run(test.name, func(t *testing.T) { - collections, err := connector.DataCollections(ctx, test.getSelector(t), nil, control.Options{}) + collections, excludes, err := connector.DataCollections(ctx, test.getSelector(t), nil, control.Options{}) assert.Error(t, err) assert.Empty(t, collections) + assert.Empty(t, excludes) }) } } @@ -242,7 +245,7 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestSharePointDataCollecti for _, test := range tests { suite.T().Run(test.name, func(t *testing.T) { - collections, err := sharepoint.DataCollections( + collections, excludes, err := sharepoint.DataCollections( ctx, graph.HTTPClient(graph.NoTimeout()), test.getSelector(), @@ -251,6 +254,8 @@ func (suite *ConnectorDataCollectionIntegrationSuite) TestSharePointDataCollecti connector, control.Options{}) require.NoError(t, err) + // Not expecting excludes as this isn't an incremental backup. + assert.Empty(t, excludes) for range collections { connector.incrementAwaitingMessages() @@ -320,9 +325,11 @@ func (suite *ConnectorCreateSharePointCollectionIntegrationSuite) TestCreateShar sel := selectors.NewSharePointBackup(siteIDs) sel.Include(sel.Libraries([]string{"foo"}, selectors.PrefixMatch())) - cols, err := gc.DataCollections(ctx, sel.Selector, nil, control.Options{}) + cols, excludes, err := gc.DataCollections(ctx, sel.Selector, nil, control.Options{}) require.NoError(t, err) assert.Len(t, cols, 1) + // No excludes yet as this isn't an incremental backup. + assert.Empty(t, excludes) for _, collection := range cols { t.Logf("Path: %s\n", collection.FullPath().String()) @@ -344,9 +351,11 @@ func (suite *ConnectorCreateSharePointCollectionIntegrationSuite) TestCreateShar sel := selectors.NewSharePointBackup(siteIDs) sel.Include(sel.Lists(selectors.Any(), selectors.PrefixMatch())) - cols, err := gc.DataCollections(ctx, sel.Selector, nil, control.Options{}) + cols, excludes, err := gc.DataCollections(ctx, sel.Selector, nil, control.Options{}) require.NoError(t, err) assert.Less(t, 0, len(cols)) + // No excludes yet as this isn't an incremental backup. + assert.Empty(t, excludes) for _, collection := range cols { t.Logf("Path: %s\n", collection.FullPath().String()) diff --git a/src/internal/connector/exchange/data_collections.go b/src/internal/connector/exchange/data_collections.go index 619d75cee..41bc16301 100644 --- a/src/internal/connector/exchange/data_collections.go +++ b/src/internal/connector/exchange/data_collections.go @@ -167,10 +167,10 @@ func DataCollections( acct account.M365Config, su support.StatusUpdater, ctrlOpts control.Options, -) ([]data.Collection, error) { +) ([]data.Collection, map[string]struct{}, error) { eb, err := selector.ToExchangeBackup() if err != nil { - return nil, errors.Wrap(err, "exchangeDataCollection: parsing selector") + return nil, nil, errors.Wrap(err, "exchangeDataCollection: parsing selector") } var ( @@ -181,7 +181,7 @@ func DataCollections( cdps, err := parseMetadataCollections(ctx, metadata) if err != nil { - return nil, err + return nil, nil, err } for _, scope := range eb.Scopes() { @@ -196,13 +196,15 @@ func DataCollections( ctrlOpts, su) if err != nil { - return nil, support.WrapAndAppend(user, err, errs) + return nil, nil, support.WrapAndAppend(user, err, errs) } collections = append(collections, dcs...) } - return collections, errs + // Exchange does not require adding items to the global exclude list so always + // return nil. + return collections, nil, errs } func getterByType(ac api.Client, category path.CategoryType) (addedAndRemovedItemIDsGetter, error) { diff --git a/src/internal/connector/graph_connector_test.go b/src/internal/connector/graph_connector_test.go index 1ed353be6..be1439c35 100644 --- a/src/internal/connector/graph_connector_test.go +++ b/src/internal/connector/graph_connector_test.go @@ -425,8 +425,10 @@ func runRestoreBackupTest( t.Logf("Selective backup of %s\n", backupSel) start = time.Now() - dcs, err := backupGC.DataCollections(ctx, backupSel, nil, control.Options{}) + dcs, excludes, err := backupGC.DataCollections(ctx, backupSel, nil, control.Options{}) require.NoError(t, err) + // No excludes yet because this isn't an incremental backup. + assert.Empty(t, excludes) t.Logf("Backup enumeration complete in %v\n", time.Since(start)) @@ -898,8 +900,10 @@ func (suite *GraphConnectorIntegrationSuite) TestMultiFolderBackupDifferentNames backupSel := backupSelectorForExpected(t, test.service, expectedDests) t.Log("Selective backup of", backupSel) - dcs, err := backupGC.DataCollections(ctx, backupSel, nil, control.Options{}) + dcs, excludes, err := backupGC.DataCollections(ctx, backupSel, nil, control.Options{}) require.NoError(t, err) + // No excludes yet because this isn't an incremental backup. + assert.Empty(t, excludes) t.Log("Backup enumeration complete") diff --git a/src/internal/connector/onedrive/collections.go b/src/internal/connector/onedrive/collections.go index 0813c13ed..f83ce342a 100644 --- a/src/internal/connector/onedrive/collections.go +++ b/src/internal/connector/onedrive/collections.go @@ -92,19 +92,20 @@ func NewCollections( } } -// Retrieves drive data as set of `data.Collections` -func (c *Collections) Get(ctx context.Context) ([]data.Collection, error) { +// Retrieves drive data as set of `data.Collections` and a set of item names to +// be excluded from the upcoming backup. +func (c *Collections) Get(ctx context.Context) ([]data.Collection, map[string]struct{}, error) { // Enumerate drives for the specified resourceOwner pager, err := PagerForSource(c.source, c.service, c.resourceOwner, nil) if err != nil { - return nil, err + return nil, nil, err } retry := c.source == OneDriveSource drives, err := drives(ctx, pager, retry) if err != nil { - return nil, err + return nil, nil, err } var ( @@ -133,7 +134,7 @@ func (c *Collections) Get(ctx context.Context) ([]data.Collection, error) { c.UpdateCollections, ) if err != nil { - return nil, err + return nil, nil, err } if len(delta) > 0 { @@ -185,7 +186,8 @@ func (c *Collections) Get(ctx context.Context) ([]data.Collection, error) { collections = append(collections, metadata) } - return collections, nil + // TODO(ashmrtn): Track and return the set of items to exclude. + return collections, nil, nil } // UpdateCollections initializes and adds the provided drive items to Collections diff --git a/src/internal/connector/onedrive/drive_test.go b/src/internal/connector/onedrive/drive_test.go index 66449a917..36fef30ab 100644 --- a/src/internal/connector/onedrive/drive_test.go +++ b/src/internal/connector/onedrive/drive_test.go @@ -454,7 +454,7 @@ func (suite *OneDriveSuite) TestOneDriveNewCollections() { scope := selectors. NewOneDriveBackup([]string{test.user}). AllData()[0] - odcs, err := NewCollections( + odcs, excludes, err := NewCollections( graph.HTTPClient(graph.NoTimeout()), creds.AzureTenantID, test.user, @@ -465,6 +465,8 @@ func (suite *OneDriveSuite) TestOneDriveNewCollections() { control.Options{}, ).Get(ctx) assert.NoError(t, err) + // Don't expect excludes as this isn't an incremental backup. + assert.Empty(t, excludes) for _, entry := range odcs { assert.NotEmpty(t, entry.FullPath()) diff --git a/src/internal/connector/sharepoint/data_collections.go b/src/internal/connector/sharepoint/data_collections.go index d64542271..6011c32a0 100644 --- a/src/internal/connector/sharepoint/data_collections.go +++ b/src/internal/connector/sharepoint/data_collections.go @@ -31,10 +31,10 @@ func DataCollections( serv graph.Servicer, su statusUpdater, ctrlOpts control.Options, -) ([]data.Collection, error) { +) ([]data.Collection, map[string]struct{}, error) { b, err := selector.ToSharePointBackup() if err != nil { - return nil, errors.Wrap(err, "sharePointDataCollection: parsing selector") + return nil, nil, errors.Wrap(err, "sharePointDataCollection: parsing selector") } var ( @@ -63,11 +63,11 @@ func DataCollections( su, ctrlOpts) if err != nil { - return nil, support.WrapAndAppend(site, err, errs) + return nil, nil, support.WrapAndAppend(site, err, errs) } case path.LibrariesCategory: - spcs, err = collectLibraries( + spcs, _, err = collectLibraries( ctx, itemClient, serv, @@ -77,7 +77,7 @@ func DataCollections( su, ctrlOpts) if err != nil { - return nil, support.WrapAndAppend(site, err, errs) + return nil, nil, support.WrapAndAppend(site, err, errs) } } @@ -85,7 +85,7 @@ func DataCollections( foldersComplete <- struct{}{} } - return collections, errs + return collections, nil, errs } func collectLists( @@ -134,7 +134,7 @@ func collectLibraries( scope selectors.SharePointScope, updater statusUpdater, ctrlOpts control.Options, -) ([]data.Collection, error) { +) ([]data.Collection, map[string]struct{}, error) { var ( collections = []data.Collection{} errs error @@ -152,12 +152,12 @@ func collectLibraries( updater.UpdateStatus, ctrlOpts) - odcs, err := colls.Get(ctx) + odcs, excludes, err := colls.Get(ctx) if err != nil { - return nil, support.WrapAndAppend(siteID, err, errs) + return nil, nil, support.WrapAndAppend(siteID, err, errs) } - return append(collections, odcs...), errs + return append(collections, odcs...), excludes, errs } type folderMatcher struct { diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 7d6c14748..247f9859b 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -261,7 +261,11 @@ func produceBackupDataCollections( closer() }() - return gc.DataCollections(ctx, sel, metadata, ctrlOpts) + // TODO(ashmrtn): When we're ready to wire up the global exclude list return + // all values. + cols, _, errs := gc.DataCollections(ctx, sel, metadata, ctrlOpts) + + return cols, errs } // --------------------------------------------------------------------------- From 48e6e8f08fdf46e43157965f1b815042c5ac10ac Mon Sep 17 00:00:00 2001 From: Keepers Date: Mon, 30 Jan 2023 18:23:08 -0700 Subject: [PATCH 27/36] enable onedrive backup for single user (#2317) ## Description unskips the backup load tests for a single user. Also adds a wrapper to make toggling restore load tests controllable for each test suite, instead of a file-wide configuration. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :robot: Test ## Issue(s) * #2279 ## Test Plan - [x] :green_heart: E2E --- src/pkg/repository/repository_load_test.go | 35 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/pkg/repository/repository_load_test.go b/src/pkg/repository/repository_load_test.go index 5725e5fda..744b57449 100644 --- a/src/pkg/repository/repository_load_test.go +++ b/src/pkg/repository/repository_load_test.go @@ -114,6 +114,7 @@ func runLoadTest( prefix, service string, usersUnderTest []string, bupSel, restSel selectors.Selector, + runRestore bool, ) { //revive:enable:context-as-argument t.Run(prefix+"_load_test_main", func(t *testing.T) { @@ -126,12 +127,33 @@ func runLoadTest( runBackupListLoadTest(t, ctx, r, service, bid) runBackupDetailsLoadTest(t, ctx, r, service, bid, usersUnderTest) + runRestoreLoadTest(t, ctx, r, prefix, service, bid, usersUnderTest, restSel, b, runRestore) + }) +} + +//revive:disable:context-as-argument +func runRestoreLoadTest( + t *testing.T, + ctx context.Context, + r repository.Repository, + prefix, service, backupID string, + usersUnderTest []string, + restSel selectors.Selector, + bup operations.BackupOperation, + runRestore bool, +) { + //revive:enable:context-as-argument + t.Run(prefix+"_load_test_restore", func(t *testing.T) { + if !runRestore { + t.Skip("restore load test is toggled off") + } + dest := tester.DefaultTestRestoreDestination() - rst, err := r.NewRestore(ctx, bid, restSel, dest) + rst, err := r.NewRestore(ctx, backupID, restSel, dest) require.NoError(t, err) - runRestoreLoadTest(t, ctx, rst, service, b.Results.ItemsWritten, usersUnderTest) + doRestoreLoadTest(t, ctx, rst, service, bup.Results.ItemsWritten, usersUnderTest) }) } @@ -240,7 +262,7 @@ func runBackupDetailsLoadTest( } //revive:disable:context-as-argument -func runRestoreLoadTest( +func doRestoreLoadTest( t *testing.T, ctx context.Context, r operations.RestoreOperation, @@ -408,6 +430,7 @@ func (suite *RepositoryLoadTestExchangeSuite) TestExchange() { "all_users", "exchange", suite.usersUnderTest, sel, sel, // same selection for backup and restore + true, ) } @@ -456,6 +479,7 @@ func (suite *RepositoryIndividualLoadTestExchangeSuite) TestExchange() { "single_user", "exchange", suite.usersUnderTest, sel, sel, // same selection for backup and restore + true, ) } @@ -504,6 +528,7 @@ func (suite *RepositoryLoadTestOneDriveSuite) TestOneDrive() { "all_users", "one_drive", suite.usersUnderTest, sel, sel, // same selection for backup and restore + false, ) } @@ -523,7 +548,6 @@ func TestRepositoryIndividualLoadTestOneDriveSuite(t *testing.T) { func (suite *RepositoryIndividualLoadTestOneDriveSuite) SetupSuite() { t := suite.T() - t.Skip("not running onedrive load tests atm") t.Parallel() suite.ctx, suite.repo, suite.acct, suite.st = initM365Repo(t) suite.usersUnderTest = singleUserSet(t) @@ -548,6 +572,7 @@ func (suite *RepositoryIndividualLoadTestOneDriveSuite) TestOneDrive() { "single_user", "one_drive", suite.usersUnderTest, sel, sel, // same selection for backup and restore + false, ) } @@ -596,6 +621,7 @@ func (suite *RepositoryLoadTestSharePointSuite) TestSharePoint() { "all_sites", "share_point", suite.sitesUnderTest, sel, sel, // same selection for backup and restore + false, ) } @@ -640,5 +666,6 @@ func (suite *RepositoryIndividualLoadTestSharePointSuite) TestSharePoint() { "single_site", "share_point", suite.sitesUnderTest, sel, sel, // same selection for backup and restore + false, ) } From da0fac20bf903afbaa64798583738d8ed16d713e Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Tue, 31 Jan 2023 07:12:04 +0530 Subject: [PATCH 28/36] Bump slash-command-dispatch and avoid running unverified commit in ok-to-test (#1756) ## Description Bumps ok-to-test to v3. Plus fix the issue where someone might have been able to run unverified code if they push between commenting `/ok-to-test` and the job starting. ## Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [x] :computer: CI/Deployment - [ ] :hamster: Trivial/Minor ## Issue(s) * https://github.com/alcionai/corso/pull/1651 ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- .github/workflows/ci.yml | 16 ++++++++++++++-- .github/workflows/ok-to-test.yml | 3 +-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acc1b68eb..170a63357 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -239,17 +239,29 @@ jobs: run: working-directory: src steps: - - name: Fail check + - name: Fail check if not repository_dispatch if: github.event_name != 'repository_dispatch' run: | echo "Workflow requires approval from a maintainer to run. It will be automatically rerun on approval." exit 1 + - uses: marocchino/sticky-pull-request-comment@v2 + if: github.event.client_payload.slash_command.args.named.sha != '' && contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.args.named.sha) + with: + message: | + Workflow run sha specified via `ok-to-test` is not the latest commit on PR. Run canceled. + + - name: Fail check if not head of PR + if: github.event.client_payload.slash_command.args.named.sha != '' && contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.args.named.sha) + run: | + echo "Workflow run sha specified is not the latest commit on PR. Exiting." + exit 1 + # add comment to PR with link to workflow run - uses: marocchino/sticky-pull-request-comment@v2 with: message: | - https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID + Test suite run will be available at https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID # Check out merge commit - name: Fork based /ok-to-test checkout diff --git a/.github/workflows/ok-to-test.yml b/.github/workflows/ok-to-test.yml index bd6a7db67..f48e49129 100644 --- a/.github/workflows/ok-to-test.yml +++ b/.github/workflows/ok-to-test.yml @@ -19,7 +19,7 @@ jobs: private_key: ${{ secrets.PRIVATE_KEY }} - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v1 + uses: peter-evans/slash-command-dispatch@v3 env: TOKEN: ${{ steps.generate_token.outputs.token }} with: @@ -27,5 +27,4 @@ jobs: reaction-token: ${{ secrets.GITHUB_TOKEN }} issue-type: pull-request commands: ok-to-test - named-args: true permission: write From 1fd640a7549489c64d2baa4a9b5cc0bb1a1ce0ee Mon Sep 17 00:00:00 2001 From: Niraj Tolia Date: Mon, 30 Jan 2023 17:53:02 -0800 Subject: [PATCH 29/36] Add docs page for fault-tolerance (#2313) ## Description Add docs on Coso's fault tolerance and reliability ## Does this PR need a docs update or release note? - [x] :white_check_mark: Yes, it's included ## Type of change - [x] :world_map: Documentation --- CHANGELOG.md | 4 +++ website/docs/setup/fault-tolerance.md | 48 +++++++++++++++++++++++++++ website/sidebars.js | 4 +-- website/styles/Vocab/Base/accept.txt | 3 +- 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 website/docs/setup/fault-tolerance.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b893cc6..f4dd1f52c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] (alpha) +### Added + +- Document Corso's fault-tolerance and restartability features + ## [v0.2.0] (alpha) - 2023-1-29 ### Fixed diff --git a/website/docs/setup/fault-tolerance.md b/website/docs/setup/fault-tolerance.md new file mode 100644 index 000000000..1771f600a --- /dev/null +++ b/website/docs/setup/fault-tolerance.md @@ -0,0 +1,48 @@ +# Fault tolerance + +Given the millions of objects found in a typical Microsoft 365 tenant, +Corso is optimized for high-performance processing, hardened to +tolerate transient failures and, most importantly, able to restart backups. + +Corso’s fault-tolerance architecture is motivated by Microsoft’s Graph +API variable performance and throttling. Corso follows Microsoft’s +recommend best practices (for example, [correctly decorating API +traffic](https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#how-to-decorate-your-http-traffic)) +and, in addition, implements a number of optimizations to improve +backup and restore reliability. + +## Recovery from transient failures + +Corso, at the HTTP layer, will retry requests (after a HTTP timeout, +for example) and will respect Graph API’s directives such as the +`retry-after` header to backoff when needed. This allows backups to +succeed in the face of transient or temporary failures. + +## Restarting from permanent API failures + +The Graph API can, for internal reasons, exhibit extended periods of +failures for particular Graph objects. In this scenario, bounded retries +will be ineffective. Unless invoked with the +fail fast option, Corso will skip over these failing objects. For +backups, it will move forward with backing up other objects belonging +to the user and, for restores, it will continue with trying to restore +any remaining objects. If a multi-user backed is in progress (via `*` +or by specifying multiple users with the `—user` argument), Corso will +also continue processing backups for the remaining users. In both +cases, Corso will exit with a non-zero exit code to reflect incomplete +backups or restores. + +On subsequent backup attempts, Corso will try to +minimize the work involved. If the previous backup was successful and +Corso’s stored state tokens haven’t expired, it will use [delta +queries](https://learn.microsoft.com/en-us/graph/delta-query-overview), +wherever supported, to perform incremental backups. + +If the previous backup for a user had resulted in a failure, Corso +uses a variety of fallback mechanisms to reduce the amount of data +downloaded and reduce the number of objects enumerated. For example, with +OneDrive, Corso won't redo downloads of data from Microsoft 365 or +uploads of data to the Corso repository if it had successfully backed +up that OneDrive file as a part of a previously incomplete and failed +backup. Even if the Graph API might not allow Corso to skip +downloading data, Corso can still skip another upload it to the repository. diff --git a/website/sidebars.js b/website/sidebars.js index fd92ea50e..2403412b7 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -19,8 +19,8 @@ const sidebars = { 'quickstart', { type: 'category', - label: 'Corso setup', - items: ['setup/concepts', 'setup/download', 'setup/m365-access', 'setup/configuration', 'setup/repos'], + label: 'Usage', + items: ['setup/concepts', 'setup/download', 'setup/m365-access', 'setup/configuration', 'setup/repos', 'setup/fault-tolerance'], }, { type: 'category', diff --git a/website/styles/Vocab/Base/accept.txt b/website/styles/Vocab/Base/accept.txt index eae43d149..69565b8a5 100644 --- a/website/styles/Vocab/Base/accept.txt +++ b/website/styles/Vocab/Base/accept.txt @@ -36,4 +36,5 @@ Atlassian SLAs runbooks stdout -stderr \ No newline at end of file +stderr +backoff \ No newline at end of file From bf404c0602f7c9cc636dbc83f8e16e687ae080ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 05:11:15 +0000 Subject: [PATCH 30/36] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20@loadable/com?= =?UTF-8?q?ponent=20from=205.15.2=20to=205.15.3=20in=20/website=20(#2325)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/package-lock.json | 16 ++++++++-------- website/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/website/package-lock.json b/website/package-lock.json index 15757ccf8..d5d5f5883 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -11,7 +11,7 @@ "@docusaurus/core": "2.3.0", "@docusaurus/plugin-google-gtag": "^2.3.0", "@docusaurus/preset-classic": "2.3.0", - "@loadable/component": "^5.15.2", + "@loadable/component": "^5.15.3", "@mdx-js/react": "^1.6.22", "animate.css": "^4.1.1", "clsx": "^1.2.1", @@ -2818,9 +2818,9 @@ "license": "MIT" }, "node_modules/@loadable/component": { - "version": "5.15.2", - "resolved": "https://registry.npmjs.org/@loadable/component/-/component-5.15.2.tgz", - "integrity": "sha512-ryFAZOX5P2vFkUdzaAtTG88IGnr9qxSdvLRvJySXcUA4B4xVWurUNADu3AnKPksxOZajljqTrDEDcYjeL4lvLw==", + "version": "5.15.3", + "resolved": "https://registry.npmjs.org/@loadable/component/-/component-5.15.3.tgz", + "integrity": "sha512-VOgYgCABn6+/7aGIpg7m0Ruj34tGetaJzt4bQ345FwEovDQZ+dua+NWLmuJKv8rWZyxOUSfoJkmGnzyDXH2BAQ==", "dependencies": { "@babel/runtime": "^7.7.7", "hoist-non-react-statics": "^3.3.1", @@ -2834,7 +2834,7 @@ "url": "https://github.com/sponsors/gregberge" }, "peerDependencies": { - "react": ">=16.3.0" + "react": "^16.3.0 || ^17.0.0 || ^18.0.0" } }, "node_modules/@mdx-js/mdx": { @@ -16396,9 +16396,9 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, "@loadable/component": { - "version": "5.15.2", - "resolved": "https://registry.npmjs.org/@loadable/component/-/component-5.15.2.tgz", - "integrity": "sha512-ryFAZOX5P2vFkUdzaAtTG88IGnr9qxSdvLRvJySXcUA4B4xVWurUNADu3AnKPksxOZajljqTrDEDcYjeL4lvLw==", + "version": "5.15.3", + "resolved": "https://registry.npmjs.org/@loadable/component/-/component-5.15.3.tgz", + "integrity": "sha512-VOgYgCABn6+/7aGIpg7m0Ruj34tGetaJzt4bQ345FwEovDQZ+dua+NWLmuJKv8rWZyxOUSfoJkmGnzyDXH2BAQ==", "requires": { "@babel/runtime": "^7.7.7", "hoist-non-react-statics": "^3.3.1", diff --git a/website/package.json b/website/package.json index 4f64d0b6f..be749e6ce 100644 --- a/website/package.json +++ b/website/package.json @@ -17,7 +17,7 @@ "@docusaurus/core": "2.3.0", "@docusaurus/plugin-google-gtag": "^2.3.0", "@docusaurus/preset-classic": "2.3.0", - "@loadable/component": "^5.15.2", + "@loadable/component": "^5.15.3", "@mdx-js/react": "^1.6.22", "animate.css": "^4.1.1", "clsx": "^1.2.1", From 0f39b23a00c4375f74ef9b6f5d7dfb820a570cbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 05:16:37 +0000 Subject: [PATCH 31/36] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20@iconify/reac?= =?UTF-8?q?t=20from=204.0.1=20to=204.1.0=20in=20/website=20(#2326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/package-lock.json | 14 +++++++------- website/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/website/package-lock.json b/website/package-lock.json index d5d5f5883..11a0d15e1 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@docusaurus/module-type-aliases": "2.3.0", - "@iconify/react": "^4.0.1", + "@iconify/react": "^4.1.0", "autoprefixer": "^10.4.13", "postcss": "^8.4.21", "tailwindcss": "^3.2.4" @@ -2728,9 +2728,9 @@ } }, "node_modules/@iconify/react": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@iconify/react/-/react-4.0.1.tgz", - "integrity": "sha512-/DBJqh5K7W4f+d4kpvyJa/OTpVa3GfgrE9bZFAKP0vIWDr0cvVU9MVvbbkek216w9nLQhpJY/FeJtc6izB1PHw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@iconify/react/-/react-4.1.0.tgz", + "integrity": "sha512-Mf72i3TNNKpKCKxmo7kzqyrUdCgaoljpqtWmtqpqwyxoV4ukhnDsSRNLhf2yBnqGr3cVZsdj/i0FMpXIY0Qk0g==", "dev": true, "dependencies": { "@iconify/types": "^2.0.0" @@ -16330,9 +16330,9 @@ } }, "@iconify/react": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@iconify/react/-/react-4.0.1.tgz", - "integrity": "sha512-/DBJqh5K7W4f+d4kpvyJa/OTpVa3GfgrE9bZFAKP0vIWDr0cvVU9MVvbbkek216w9nLQhpJY/FeJtc6izB1PHw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@iconify/react/-/react-4.1.0.tgz", + "integrity": "sha512-Mf72i3TNNKpKCKxmo7kzqyrUdCgaoljpqtWmtqpqwyxoV4ukhnDsSRNLhf2yBnqGr3cVZsdj/i0FMpXIY0Qk0g==", "dev": true, "requires": { "@iconify/types": "^2.0.0" diff --git a/website/package.json b/website/package.json index be749e6ce..5d5670674 100644 --- a/website/package.json +++ b/website/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@docusaurus/module-type-aliases": "2.3.0", - "@iconify/react": "^4.0.1", + "@iconify/react": "^4.1.0", "autoprefixer": "^10.4.13", "postcss": "^8.4.21", "tailwindcss": "^3.2.4" From 14be75e7aeed3c918db64efd911727d7326d8f8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 16:14:29 +0000 Subject: [PATCH 32/36] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20github.com/aw?= =?UTF-8?q?s/aws-sdk-go=20from=201.44.189=20to=201.44.190=20in=20/src=20(#?= =?UTF-8?q?2327)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.189 to 1.44.190.
Release notes

Sourced from github.com/aws/aws-sdk-go's releases.

Release v1.44.190 (2023-01-30)

Service Client Updates

  • service/clouddirectory: Adds new service
    • Enabled FIPS endpoints for GovCloud (US) regions in SDK.
  • service/cloudformation: Updates service API and documentation
    • This feature provides a method of obtaining which regions a stackset has stack instances deployed in.
  • service/discovery: Updates service API
    • Update ImportName validation to 255 from the current length of 100
  • service/dlm: Adds new service
  • service/ec2: Updates service API and documentation
    • We add Prefix Lists as a new route destination option for LocalGatewayRoutes. This will allow customers to create routes to Prefix Lists. Prefix List routes will allow customers to group individual CIDR routes with the same target into a single route.
  • service/imagebuilder: Adds new service
  • service/kafka: Adds new service
  • service/mediaconvert: Adds new service
    • Enabled FIPS endpoints for GovCloud (US) regions in SDK.
  • service/swf: Adds new service
    • Enabled FIPS endpoints for GovCloud (US) regions in SDK.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/aws/aws-sdk-go&package-manager=go_modules&previous-version=1.44.189&new-version=1.44.190)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- src/go.mod | 2 +- src/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/go.mod b/src/go.mod index b9cb5ec53..f424073cf 100644 --- a/src/go.mod +++ b/src/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 github.com/alcionai/clues v0.0.0-20230120231953-1cf61dbafc40 - github.com/aws/aws-sdk-go v1.44.189 + github.com/aws/aws-sdk-go v1.44.190 github.com/aws/aws-xray-sdk-go v1.8.0 github.com/google/uuid v1.3.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/src/go.sum b/src/go.sum index b8f926e79..365d78e35 100644 --- a/src/go.sum +++ b/src/go.sum @@ -62,8 +62,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/aws/aws-sdk-go v1.44.189 h1:9PBrjndH1uL5AN8818qI3duhQ4hgkMuLvqkJlg9MRyk= -github.com/aws/aws-sdk-go v1.44.189/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.190 h1:QC+Pf/Ooj7Waf2obOPZbIQOqr00hy4h54j3ZK9mvHcc= +github.com/aws/aws-sdk-go v1.44.190/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-xray-sdk-go v1.8.0 h1:0xncHZ588wB/geLjbM/esoW3FOEThWy2TJyb4VXfLFY= github.com/aws/aws-xray-sdk-go v1.8.0/go.mod h1:7LKe47H+j3evfvS1+q0wzpoaGXGrF3mUsfM+thqVO+A= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= From 3a5211590adbe27b2fa1211bf8c80b36c7db7689 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 31 Jan 2023 11:38:28 -0500 Subject: [PATCH 33/36] GC: Beta Client Package (#2205) ## Description To add needed features, Kiota-Generated Beta Connector created ## Does this PR need a docs update or release note? - [x] :white_check_mark: Yes, it's included ## Type of change - [x] :sunflower: Feature ## Issue(s) * closes #2086 * closes #2174 * closes #2223 ## Test Plan Compilation and current CI tests will fail if the package does not align with current operational standards. - [x] :zap: Unit test - [x] :green_heart: E2E --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 4 + src/.golangci.yml | 12 +- src/go.mod | 14 +- src/go.sum | 28 +- .../connector/graph/betasdk/beta_client.go | 86 ++++ .../graph/betasdk/beta_client_test.go | 80 ++++ .../connector/graph/betasdk/kiota-lock.json | 131 ++++++ .../graph/betasdk/models/base_item.go | 379 +++++++++++++++++ .../graph/betasdk/models/canvas_layout.go | 103 +++++ .../graph/betasdk/models/canvas_layoutable.go | 16 + .../betasdk/models/horizontal_section.go | 133 ++++++ .../horizontal_section_collection_response.go | 75 ++++ ...izontal_section_collection_responseable.go | 14 + .../models/horizontal_section_column.go | 103 +++++ ...ntal_section_column_collection_response.go | 75 ++++ ..._section_column_collection_responseable.go | 14 + .../models/horizontal_section_columnable.go | 16 + .../models/horizontal_section_layout_type.go | 52 +++ .../betasdk/models/horizontal_sectionable.go | 18 + .../models/meta_data_key_string_pair.go | 123 ++++++ ...ata_key_string_pair_collection_response.go | 75 ++++ ...key_string_pair_collection_responseable.go | 14 + .../models/meta_data_key_string_pairable.go | 17 + .../models/meta_data_key_value_pair.go | 135 ++++++ ...data_key_value_pair_collection_response.go | 75 ++++ ..._key_value_pair_collection_responseable.go | 14 + .../models/meta_data_key_value_pairable.go | 18 + .../graph/betasdk/models/page_layout_type.go | 40 ++ .../betasdk/models/page_promotion_type.go | 40 ++ .../graph/betasdk/models/publication_facet.go | 123 ++++++ .../betasdk/models/publication_facetable.go | 17 + .../graph/betasdk/models/reactions_facet.go | 149 +++++++ .../betasdk/models/reactions_facetable.go | 19 + .../betasdk/models/section_emphasis_type.go | 43 ++ .../models/server_processed_content.go | 294 +++++++++++++ .../models/server_processed_contentable.go | 25 ++ .../graph/betasdk/models/site_access_type.go | 37 ++ .../graph/betasdk/models/site_page.go | 387 ++++++++++++++++++ .../models/site_page_collection_response.go | 76 ++++ .../site_page_collection_responseable.go | 14 + .../graph/betasdk/models/site_pageable.go | 36 ++ .../betasdk/models/site_security_level.go | 52 +++ .../graph/betasdk/models/site_settings.go | 123 ++++++ .../graph/betasdk/models/site_settingsable.go | 17 + .../graph/betasdk/models/standard_web_part.go | 88 ++++ .../standard_web_part_collection_response.go | 75 ++++ ...andard_web_part_collection_responseable.go | 14 + .../betasdk/models/standard_web_partable.go | 15 + .../graph/betasdk/models/text_web_part.go | 62 +++ .../text_web_part_collection_response.go | 75 ++++ .../text_web_part_collection_responseable.go | 14 + .../graph/betasdk/models/text_web_partable.go | 13 + .../graph/betasdk/models/title_area.go | 360 ++++++++++++++++ .../betasdk/models/title_area_layout_type.go | 43 ++ .../models/title_area_text_alignment_type.go | 37 ++ .../graph/betasdk/models/title_areaable.go | 33 ++ .../graph/betasdk/models/vertical_section.go | 104 +++++ .../betasdk/models/vertical_sectionable.go | 16 + .../graph/betasdk/models/web_part.go | 59 +++ .../models/web_part_collection_response.go | 75 ++++ .../web_part_collection_responseable.go | 14 + .../graph/betasdk/models/web_part_data.go | 251 ++++++++++++ .../graph/betasdk/models/web_part_dataable.go | 26 ++ .../graph/betasdk/models/web_part_position.go | 175 ++++++++ .../betasdk/models/web_part_positionable.go | 21 + .../graph/betasdk/models/web_partable.go | 12 + .../betasdk/sites/count_request_builder.go | 116 ++++++ .../sites/item_pages_count_request_builder.go | 115 ++++++ ...rizontal_sections_count_request_builder.go | 122 ++++++ ...horizontal_section_item_request_builder.go | 260 ++++++++++++ ...ions_item_columns_count_request_builder.go | 117 ++++++ ...tal_section_column_item_request_builder.go | 247 +++++++++++ ...mns_item_webparts_count_request_builder.go | 111 +++++ ...et_position_of_web_part_request_builder.go | 96 +++++ ...m_columns_item_webparts_request_builder.go | 180 ++++++++ ..._webparts_web_part_item_request_builder.go | 209 ++++++++++ ...l_sections_item_columns_request_builder.go | 180 ++++++++ ...out_horizontal_sections_request_builder.go | 179 ++++++++ ...ages_item_canvas_layout_request_builder.go | 230 +++++++++++ ...layout_vertical_section_request_builder.go | 226 ++++++++++ ..._section_webparts_count_request_builder.go | 107 +++++ ...et_position_of_web_part_request_builder.go | 97 +++++ ...rtical_section_webparts_request_builder.go | 177 ++++++++ ..._webparts_web_part_item_request_builder.go | 209 ++++++++++ ...web_parts_by_position_post_request_body.go | 182 ++++++++ ...parts_by_position_post_request_bodyable.go | 17 + ...t_web_parts_by_position_request_builder.go | 91 ++++ ...item_get_web_parts_by_position_response.go | 89 ++++ ..._get_web_parts_by_position_responseable.go | 16 + ...item_pages_item_publish_request_builder.go | 82 ++++ ...es_item_web_parts_count_request_builder.go | 103 +++++ ...et_position_of_web_part_request_builder.go | 96 +++++ ...em_pages_item_web_parts_request_builder.go | 172 ++++++++ ...web_parts_web_part_item_request_builder.go | 209 ++++++++++ .../sites/item_pages_request_builder.go | 176 ++++++++ ...em_pages_site_page_item_request_builder.go | 237 +++++++++++ .../sites/item_sites_count_request_builder.go | 103 +++++ .../item_sites_site_item_request_builder.go | 104 +++++ .../sites/site_item_request_builder.go | 249 +++++++++++ .../connector/graph_connector_helper_test.go | 26 +- src/internal/connector/sharepoint/pageInfo.go | 3 +- .../connector/sharepoint/pageInfo_test.go | 11 +- .../connector/sharepoint/site_page.go | 187 --------- .../connector/sharepoint/site_pageable.go | 24 -- 105 files changed, 9803 insertions(+), 252 deletions(-) create mode 100644 src/internal/connector/graph/betasdk/beta_client.go create mode 100644 src/internal/connector/graph/betasdk/beta_client_test.go create mode 100644 src/internal/connector/graph/betasdk/kiota-lock.json create mode 100644 src/internal/connector/graph/betasdk/models/base_item.go create mode 100644 src/internal/connector/graph/betasdk/models/canvas_layout.go create mode 100644 src/internal/connector/graph/betasdk/models/canvas_layoutable.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_section.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_section_collection_response.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_section_collection_responseable.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_section_column.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_section_column_collection_response.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_section_column_collection_responseable.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_section_columnable.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_section_layout_type.go create mode 100644 src/internal/connector/graph/betasdk/models/horizontal_sectionable.go create mode 100644 src/internal/connector/graph/betasdk/models/meta_data_key_string_pair.go create mode 100644 src/internal/connector/graph/betasdk/models/meta_data_key_string_pair_collection_response.go create mode 100644 src/internal/connector/graph/betasdk/models/meta_data_key_string_pair_collection_responseable.go create mode 100644 src/internal/connector/graph/betasdk/models/meta_data_key_string_pairable.go create mode 100644 src/internal/connector/graph/betasdk/models/meta_data_key_value_pair.go create mode 100644 src/internal/connector/graph/betasdk/models/meta_data_key_value_pair_collection_response.go create mode 100644 src/internal/connector/graph/betasdk/models/meta_data_key_value_pair_collection_responseable.go create mode 100644 src/internal/connector/graph/betasdk/models/meta_data_key_value_pairable.go create mode 100644 src/internal/connector/graph/betasdk/models/page_layout_type.go create mode 100644 src/internal/connector/graph/betasdk/models/page_promotion_type.go create mode 100644 src/internal/connector/graph/betasdk/models/publication_facet.go create mode 100644 src/internal/connector/graph/betasdk/models/publication_facetable.go create mode 100644 src/internal/connector/graph/betasdk/models/reactions_facet.go create mode 100644 src/internal/connector/graph/betasdk/models/reactions_facetable.go create mode 100644 src/internal/connector/graph/betasdk/models/section_emphasis_type.go create mode 100644 src/internal/connector/graph/betasdk/models/server_processed_content.go create mode 100644 src/internal/connector/graph/betasdk/models/server_processed_contentable.go create mode 100644 src/internal/connector/graph/betasdk/models/site_access_type.go create mode 100644 src/internal/connector/graph/betasdk/models/site_page.go create mode 100644 src/internal/connector/graph/betasdk/models/site_page_collection_response.go create mode 100644 src/internal/connector/graph/betasdk/models/site_page_collection_responseable.go create mode 100644 src/internal/connector/graph/betasdk/models/site_pageable.go create mode 100644 src/internal/connector/graph/betasdk/models/site_security_level.go create mode 100644 src/internal/connector/graph/betasdk/models/site_settings.go create mode 100644 src/internal/connector/graph/betasdk/models/site_settingsable.go create mode 100644 src/internal/connector/graph/betasdk/models/standard_web_part.go create mode 100644 src/internal/connector/graph/betasdk/models/standard_web_part_collection_response.go create mode 100644 src/internal/connector/graph/betasdk/models/standard_web_part_collection_responseable.go create mode 100644 src/internal/connector/graph/betasdk/models/standard_web_partable.go create mode 100644 src/internal/connector/graph/betasdk/models/text_web_part.go create mode 100644 src/internal/connector/graph/betasdk/models/text_web_part_collection_response.go create mode 100644 src/internal/connector/graph/betasdk/models/text_web_part_collection_responseable.go create mode 100644 src/internal/connector/graph/betasdk/models/text_web_partable.go create mode 100644 src/internal/connector/graph/betasdk/models/title_area.go create mode 100644 src/internal/connector/graph/betasdk/models/title_area_layout_type.go create mode 100644 src/internal/connector/graph/betasdk/models/title_area_text_alignment_type.go create mode 100644 src/internal/connector/graph/betasdk/models/title_areaable.go create mode 100644 src/internal/connector/graph/betasdk/models/vertical_section.go create mode 100644 src/internal/connector/graph/betasdk/models/vertical_sectionable.go create mode 100644 src/internal/connector/graph/betasdk/models/web_part.go create mode 100644 src/internal/connector/graph/betasdk/models/web_part_collection_response.go create mode 100644 src/internal/connector/graph/betasdk/models/web_part_collection_responseable.go create mode 100644 src/internal/connector/graph/betasdk/models/web_part_data.go create mode 100644 src/internal/connector/graph/betasdk/models/web_part_dataable.go create mode 100644 src/internal/connector/graph/betasdk/models/web_part_position.go create mode 100644 src/internal/connector/graph/betasdk/models/web_part_positionable.go create mode 100644 src/internal/connector/graph/betasdk/models/web_partable.go create mode 100644 src/internal/connector/graph/betasdk/sites/count_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_count_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_count_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_horizontal_section_item_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_count_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_horizontal_section_column_item_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_count_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_item_get_position_of_web_part_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_web_part_item_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_count_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_item_get_position_of_web_part_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_web_part_item_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_post_request_body.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_post_request_bodyable.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_response.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_responseable.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_publish_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_count_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_item_get_position_of_web_part_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_web_part_item_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_pages_site_page_item_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_sites_count_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/item_sites_site_item_request_builder.go create mode 100644 src/internal/connector/graph/betasdk/sites/site_item_request_builder.go delete mode 100644 src/internal/connector/sharepoint/site_page.go delete mode 100644 src/internal/connector/sharepoint/site_pageable.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 170a63357..7083e885b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: working-directory: src steps: - uses: actions/checkout@v3 - + # single setup and sum cache handling here. # the results will cascade onto both testing and linting. - name: Setup Golang with cache diff --git a/CHANGELOG.md b/CHANGELOG.md index f4dd1f52c..1b18a4d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Check if the user specified for an exchange backup operation has a mailbox. + +### Changed + +- BetaClient introduced. Enables Corso to be able to interact with SharePoint Page objects. Package located `/internal/connector/graph/betasdk` - Handle case where user's drive has not been initialized - Inline attachments (e.g. copy/paste ) are discovered and backed up correctly ([#2163](https://github.com/alcionai/corso/issues/2163)) - Guest and External users (for cloud accounts) and non-on-premise users (for systems that use on-prem AD syncs) are now excluded from backup and restore operations. diff --git a/src/.golangci.yml b/src/.golangci.yml index db883efc4..bda9330be 100644 --- a/src/.golangci.yml +++ b/src/.golangci.yml @@ -3,7 +3,6 @@ run: linters: enable: - - gci - gofmt - gofumpt - errcheck @@ -106,3 +105,14 @@ issues: linters: - forbidigo text: "context.(Background|TODO)" + - path: internal/connector/graph/betasdk + linters: + - wsl + - revive + - gci + - lll + - gofmt + - gofumpt + - misspell + - errcheck + diff --git a/src/go.mod b/src/go.mod index f424073cf..1b05ec06b 100644 --- a/src/go.mod +++ b/src/go.mod @@ -10,12 +10,12 @@ require ( github.com/google/uuid v1.3.0 github.com/hashicorp/go-multierror v1.1.1 github.com/kopia/kopia v0.12.2-0.20230123092305-e5387cec0acb - github.com/microsoft/kiota-abstractions-go v0.15.2 - github.com/microsoft/kiota-authentication-azure-go v0.5.0 - github.com/microsoft/kiota-http-go v0.11.0 + github.com/microsoft/kiota-abstractions-go v0.16.0 + github.com/microsoft/kiota-authentication-azure-go v0.6.0 + github.com/microsoft/kiota-http-go v0.13.0 github.com/microsoft/kiota-serialization-json-go v0.7.2 - github.com/microsoftgraph/msgraph-sdk-go v0.50.0 - github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1 + github.com/microsoftgraph/msgraph-sdk-go v0.53.0 + github.com/microsoftgraph/msgraph-sdk-go-core v0.33.0 github.com/pkg/errors v0.9.1 github.com/rudderlabs/analytics-go v3.3.3+incompatible github.com/spatialcurrent/go-lazy v0.0.0-20211115014721-47315cc003d1 @@ -53,8 +53,8 @@ require ( ) require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect diff --git a/src/go.sum b/src/go.sum index 365d78e35..72af64b2d 100644 --- a/src/go.sum +++ b/src/go.sum @@ -36,12 +36,12 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUXTtj12tQ6zE2GZUgVQw= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 h1:VuHAcMq8pU1IWNT/m5yRaGqbK0BiQKHT8X4DTp9CHdI= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0/go.mod h1:tZoQYdDZNOiIjdSn0dVWVfl0NEPGOJqVLzSrcFk4Is0= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 h1:XUNQ4mw+zJmaA2KXzP9JlQiecy1SI+Eog7xVkPiqIbg= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM= github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -269,22 +269,22 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09 github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/microsoft/kiota-abstractions-go v0.15.2 h1:Pp78BbqPvkF2mAMH0Ph37ymwfSH7uF9iYfY1fZ8g630= -github.com/microsoft/kiota-abstractions-go v0.15.2/go.mod h1:RT/s9sCzg49i4iO7e2qhyWmX+DlJDgC0P+Wp8fKQQfo= -github.com/microsoft/kiota-authentication-azure-go v0.5.0 h1:RVA/tTgMnDIN3u4qPZtvYvVRsQDOFkd3yvi6KXjZJko= -github.com/microsoft/kiota-authentication-azure-go v0.5.0/go.mod h1:1Io6h+88FlDRmrajdjSnXPz8oyObUVjNuQZLhrF9kQk= -github.com/microsoft/kiota-http-go v0.11.0 h1:0K0y/wZcTvEEX2Xdj5tngJqknqYQpArLdtjB/fo88Dc= -github.com/microsoft/kiota-http-go v0.11.0/go.mod h1:4D6vMjT7jQ3IRAJrpFoaDtfS9eMaSjQKHY6ETSV2cc0= +github.com/microsoft/kiota-abstractions-go v0.16.0 h1:DZ1L4YsRsQw39iPGnVq2fQkqLXMsazdPwmWsnaH4EZg= +github.com/microsoft/kiota-abstractions-go v0.16.0/go.mod h1:RT/s9sCzg49i4iO7e2qhyWmX+DlJDgC0P+Wp8fKQQfo= +github.com/microsoft/kiota-authentication-azure-go v0.6.0 h1:Il9bLO34J6D8DY89xYAXoGh9muvlphayqG4eihyT6B8= +github.com/microsoft/kiota-authentication-azure-go v0.6.0/go.mod h1:EJCHiLWLXW1/mSgX7lYReAhVO37MzRT5Xi2mcPTwCRQ= +github.com/microsoft/kiota-http-go v0.13.0 h1:CZSC+UrBSwjIvLlVh+AEPsDbD0c17AWd/QPRHIljd8k= +github.com/microsoft/kiota-http-go v0.13.0/go.mod h1:aWtBlFhCetH0JmouvN3hiSaJoqCEdVHPqlrcLYExs3k= github.com/microsoft/kiota-serialization-form-go v0.2.0 h1:jgPE+8DtrWhL+KwnAwRm13HnMNydbelC/NP9wRGwDUo= github.com/microsoft/kiota-serialization-form-go v0.2.0/go.mod h1:chOuh09tO7IrNtubAumdlG5wnrcYdMkjV7joVVGDyGs= github.com/microsoft/kiota-serialization-json-go v0.7.2 h1:DSb4fNDi5O+DqJwrHo+vRy2kSvfxG5VtN6m1EHzn5Vw= github.com/microsoft/kiota-serialization-json-go v0.7.2/go.mod h1:Ojum5prlijopyCOZ2XctRcVlE2pU8h+43r3tMdiWoDU= github.com/microsoft/kiota-serialization-text-go v0.6.0 h1:3N2vftYZlwKdog69AN7ha+FZT0QxPG7xp/hLv0/W2OQ= github.com/microsoft/kiota-serialization-text-go v0.6.0/go.mod h1:OUA4dNH+f6afiJUs+rQAatJos7QVF5PJkyrqoD89lx4= -github.com/microsoftgraph/msgraph-sdk-go v0.50.0 h1:yfPBDr7+tSdq8jKiNCvY5XzQji1kZzOHXvxQ9XxQ4E4= -github.com/microsoftgraph/msgraph-sdk-go v0.50.0/go.mod h1:XoTT9lzRSersVV4/lsFup3sOLfOLEf2dMsLckiAAKq8= -github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1 h1:aVvnO5l8qLCEcvELc5n9grt7UXhAVtpog1QeQKLMlTE= -github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1/go.mod h1:RE4F2qGCTehGtQGc9Txafc4l+XMpbjYuO4amDLFgOWE= +github.com/microsoftgraph/msgraph-sdk-go v0.53.0 h1:HpQd1Nvr8yQNeqhDuiVSbqn1fkHsFbRFDmnuhhXJXOQ= +github.com/microsoftgraph/msgraph-sdk-go v0.53.0/go.mod h1:BZLyon4n4T4EuLIAlX+kJ5JgneFTXVQDah1AJuq3FRY= +github.com/microsoftgraph/msgraph-sdk-go-core v0.33.0 h1:cDL3ov/IZ2ZarUJdGGPsdR+46ALdd3CRAiDBIylLCoA= +github.com/microsoftgraph/msgraph-sdk-go-core v0.33.0/go.mod h1:d0mU3PQAWnN/C4CwPJEZz2QhesrnR5UDnqRu2ODWPkI= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go/v7 v7.0.45 h1:g4IeM9M9pW/Lo8AGGNOjBZYlvmtlE1N5TQEYWXRWzIs= diff --git a/src/internal/connector/graph/betasdk/beta_client.go b/src/internal/connector/graph/betasdk/beta_client.go new file mode 100644 index 000000000..515e1de95 --- /dev/null +++ b/src/internal/connector/graph/betasdk/beta_client.go @@ -0,0 +1,86 @@ +package betasdk + +import ( + i1a3c1a5501c5e41b7fd169f2d4c768dce9b096ac28fb5431bf02afcc57295411 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/sites" + absser "github.com/microsoft/kiota-abstractions-go" + kioser "github.com/microsoft/kiota-abstractions-go/serialization" + kform "github.com/microsoft/kiota-serialization-form-go" + kw "github.com/microsoft/kiota-serialization-json-go" + ktext "github.com/microsoft/kiota-serialization-text-go" + msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" +) + +// BetaClient the main entry point of the SDK, exposes the configuration and the fluent API. +// Minimal Beta Connector: +// Details on how the Code was generated is present in `kioter-lock.json`. +// NOTE: kiota gen file is altered to indicate what files are included in the created +// +// Changes to Sites Directory: +// Access files send requests with an adapter's with ASync() support. +// This feature is not enabled in v1.0. Manually changed in remaining files. +// Additionally, only calls that begin as client.SitesBy(siteID).Pages() have an endpoint. +// +// The use case specific to Pages(). All other requests should be routed to the /internal/connector/graph.Servicer +// Specifics on `betaClient.SitesById(siteID).Pages` are located: sites/site_item_request_builder.go +// +// Required model files are identified as `modelFiles` in kiota-lock.json. Directory -> betasdk/models +// Required access files are identified as `sitesFiles` in kiota-lock.json. Directory -> betasdk/sites +// +// BetaClient minimal msgraph-beta-sdk-go for connecting to msgraph-beta-sdk-go +// for retrieving `SharePoint.Pages`. Code is generated from kiota.dev. +// requestAdapter is registered with the following the serializers: +// -- "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory", +// -- "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", +// -- "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory" +type BetaClient struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter *msgraphsdk.GraphRequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// NewBetaClient instantiates a new BetaClient and sets the default values. +// func NewBetaClient(requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*BetaClient) { +func NewBetaClient(requestAdapter *msgraphsdk.GraphRequestAdapter) *BetaClient { + m := &BetaClient{} + m.pathParameters = make(map[string]string) + m.urlTemplate = "{+baseurl}" + m.requestAdapter = requestAdapter + absser.RegisterDefaultSerializer(func() kioser.SerializationWriterFactory { + return kw.NewJsonSerializationWriterFactory() + }) + absser.RegisterDefaultSerializer(func() kioser.SerializationWriterFactory { + return ktext.NewTextSerializationWriterFactory() + }) + absser.RegisterDefaultSerializer(func() kioser.SerializationWriterFactory { + return kform.NewFormSerializationWriterFactory() + }) + absser.RegisterDefaultDeserializer(func() kioser.ParseNodeFactory { + return kw.NewJsonParseNodeFactory() + }) + absser.RegisterDefaultDeserializer(func() kioser.ParseNodeFactory { + return ktext.NewTextParseNodeFactory() + }) + absser.RegisterDefaultDeserializer(func() kioser.ParseNodeFactory { + return kform.NewFormParseNodeFactory() + }) + + if m.requestAdapter.GetBaseUrl() == "" { + m.requestAdapter.SetBaseUrl("https://graph.microsoft.com/beta") + } + return m +} + +// SitesById provides operations to manage the collection of site entities. +func (m *BetaClient) SitesById(id string) *i1a3c1a5501c5e41b7fd169f2d4c768dce9b096ac28fb5431bf02afcc57295411.SiteItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.pathParameters { + urlTplParams[idx] = item + } + if id != "" { + urlTplParams["site%2Did"] = id + } + return i1a3c1a5501c5e41b7fd169f2d4c768dce9b096ac28fb5431bf02afcc57295411.NewSiteItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +} diff --git a/src/internal/connector/graph/betasdk/beta_client_test.go b/src/internal/connector/graph/betasdk/beta_client_test.go new file mode 100644 index 000000000..84f2db6c5 --- /dev/null +++ b/src/internal/connector/graph/betasdk/beta_client_test.go @@ -0,0 +1,80 @@ +package betasdk + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/tester" + "github.com/alcionai/corso/src/pkg/account" +) + +type BetaClientSuite struct { + suite.Suite + credentials account.M365Config +} + +func TestBetaClientSuite(t *testing.T) { + suite.Run(t, new(BetaClientSuite)) +} + +func (suite *BetaClientSuite) SetupSuite() { + t := suite.T() + a := tester.NewM365Account(t) + m365, err := a.M365Config() + require.NoError(t, err) + + suite.credentials = m365 +} + +func (suite *BetaClientSuite) TestCreateBetaClient() { + t := suite.T() + adpt, err := graph.CreateAdapter( + suite.credentials.AzureTenantID, + suite.credentials.AzureClientID, + suite.credentials.AzureClientSecret, + ) + + require.NoError(t, err) + + client := NewBetaClient(adpt) + assert.NotNil(t, client) +} + +// TestBasicClientGetFunctionality. Tests that adapter is able +// to parse retrieved Site Page. Additional tests should +// be handled within the /internal/connector/sharepoint when +// additional features are added. +func (suite *BetaClientSuite) TestBasicClientGetFunctionality() { + ctx, flush := tester.NewContext() + defer flush() + t := suite.T() + adpt, err := graph.CreateAdapter( + suite.credentials.AzureTenantID, + suite.credentials.AzureClientID, + suite.credentials.AzureClientSecret, + ) + + require.NoError(t, err) + client := NewBetaClient(adpt) + require.NotNil(t, client) + + siteID := tester.M365SiteID(t) + // TODO(dadams39) document allowable calls in main + collection, err := client.SitesById(siteID).Pages().Get(ctx, nil) + // Ensures that the client is able to receive data from beta + // Not Registered Error: content type application/json does not have a factory registered to be parsed + require.NoError(t, err) + + for _, page := range collection.GetValue() { + assert.NotNil(t, page, "betasdk call for page does not return value.") + + if page != nil { + t.Logf("Page :%s ", *page.GetName()) + assert.NotNil(t, page.GetId()) + } + } +} diff --git a/src/internal/connector/graph/betasdk/kiota-lock.json b/src/internal/connector/graph/betasdk/kiota-lock.json new file mode 100644 index 000000000..21a111aef --- /dev/null +++ b/src/internal/connector/graph/betasdk/kiota-lock.json @@ -0,0 +1,131 @@ +{ + "lockFileVersion": "1.0.0", + "kiotaVersion": "0.10.0.0", + "clientClassName": "BetaClient", + "clientNamespaceName": "github.com/alcionai/corso/src/internal/connector/graph/betasdk", + "language": "Go", + "betaVersion": "0.53.0", + "usesBackingStore": false, + "includeAdditionalData": true, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory" + ], + "deserializers": [ + "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory", + "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", + "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain", + "application/x-www-form-urlencoded" + ], + "includePatterns": [ + "**/sites/**" + ], + "excludePatterns": [ + "**/admin/**", + "**/users/**", + "**/groups/**", + "**/onenote/**" + ], + "sitesFiles": [ + "count_request_builder.go", + "item_pages_count_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_count_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_horizontal_section_item_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_item_columns_count_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_item_columns_horizontal_section_column_item_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_count_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_item_get_position_of_web_part_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_web_part_item_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_item_columns_request_builder.go", + "item_pages_item_canvas_layout_horizontal_sections_request_builder.go", + "item_pages_item_canvas_layout_request_builder.go", + "item_pages_item_canvas_layout_vertical_section_request_builder.go", + "item_pages_item_canvas_layout_vertical_section_webparts_count_request_builder.go", + "item_pages_item_canvas_layout_vertical_section_webparts_item_get_position_of_web_part_request_builder.go", + "item_pages_item_canvas_layout_vertical_section_webparts_request_builder.go", + "item_pages_item_canvas_layout_vertical_section_webparts_web_part_item_request_builder.go", + "item_pages_item_get_web_parts_by_position_post_request_body.go", + "item_pages_item_get_web_parts_by_position_post_request_bodyable.go", + "item_pages_item_get_web_parts_by_position_request_builder.go", + "item_pages_item_get_web_parts_by_position_response.go", + "item_pages_item_get_web_parts_by_position_responseable.go", + "item_pages_item_publish_request_builder.go", + "item_pages_item_web_parts_count_request_builder.go", + "item_pages_item_web_parts_item_get_position_of_web_part_request_builder.go", + "item_pages_item_web_parts_request_builder.go", + "item_pages_item_web_parts_web_part_item_request_builder.go", + "item_pages_request_builder.go", + "item_pages_site_page_item_request_builder.go", + "item_sites_count_request_builder.go", + "item_sites_site_item_request_builder.go", + "site_item_request_builder.go" + ], + "modelFiles":[ + "base_item.go", + "page_layout_type.go", + "standard_web_partable.go", + "canvas_layout.go", + "page_promotion_type.go", + "text_web_part.go", + "canvas_layoutable.go", + "publication_facet.go", + "text_web_part_collection_response.go", + "horizontal_section.go", + "publication_facetable.go", + "text_web_part_collection_responseable.go", + "horizontal_section_collection_response.go", + "reactions_facet.go", + "text_web_partable.go", + "horizontal_section_collection_responseable.go", + "reactions_facetable.go", + "title_area.go", + "horizontal_section_column.go", + "section_emphasis_type.go", + "title_area_layout_type.go", + "horizontal_section_column_collection_response.go", + "server_processed_content.go", + "title_area_text_alignment_type.go", + "horizontal_section_column_collection_responseable.go", + "server_processed_contentable.go", + "title_areaable.go", + "horizontal_section_columnable.go", + "site_access_type.go", + "vertical_section.go", + "horizontal_section_layout_type.go", + "site_page.go", + "vertical_sectionable.go", + "horizontal_sectionable.go", + "site_page_collection_response.go", + "web_part.go", + "meta_data_key_string_pair.go", + "site_page_collection_responseable.go", + "web_part_collection_response.go", + "meta_data_key_string_pair_collection_response.go", + "site_pageable.go", + "web_part_collection_responseable.go", + "meta_data_key_string_pair_collection_responseable.go", + "site_security_level.go", + "web_part_data.go", + "meta_data_key_string_pairable.go", + "site_settings.go", + "web_part_dataable.go", + "meta_data_key_value_pair.go", + "site_settingsable.go", + "web_part_position.go", + "meta_data_key_value_pair_collection_response.go", + "standard_web_part.go", + "web_part_positionable.go", + "meta_data_key_value_pair_collection_responseable.go", + "standard_web_part_collection_response.go", + "web_partable.go", + "meta_data_key_value_pairable.go", + "standard_web_part_collection_responseable.go" + ], + "disabledValidationRules": [] +} diff --git a/src/internal/connector/graph/betasdk/models/base_item.go b/src/internal/connector/graph/betasdk/models/base_item.go new file mode 100644 index 000000000..880262348 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/base_item.go @@ -0,0 +1,379 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// BaseItem +type BaseItem struct { + msmodel.Entity + // Identity of the user, device, or application which created the item. Read-only. + createdBy msmodel.IdentitySetable + // The createdByUser property + createdByUser msmodel.Userable + // Date and time of item creation. Read-only. + createdDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // ETag for the item. Read-only. + eTag *string + // Identity of the user, device, and application which last modified the item. Read-only. + lastModifiedBy msmodel.IdentitySetable + // The lastModifiedByUser property + lastModifiedByUser msmodel.Userable + // Date and time the item was last modified. Read-only. + lastModifiedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the item. Read-write. + name *string + // Parent information, if the item has a parent. Read-write. + parentReference msmodel.ItemReferenceable + // URL that displays the resource in the browser. Read-only. + webUrl *string +} + +// NewBaseItem instantiates a new baseItem and sets the default values. +func NewBaseItem() *BaseItem { + m := &BaseItem{ + Entity: *msmodel.NewEntity(), + } + return m +} + +// CreateBaseItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateBaseItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("@odata.type") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + switch *mappingValue { + case "#microsoft.graph.drive": + return msmodel.NewDrive(), nil + case "#microsoft.graph.driveItem": + return msmodel.NewDriveItem(), nil + case "#microsoft.graph.list": + return msmodel.NewList(), nil + case "#microsoft.graph.listItem": + return msmodel.NewListItem(), nil + case "#microsoft.graph.sharedDriveItem": + return msmodel.NewSharedDriveItem(), nil + case "#microsoft.graph.site": + return msmodel.NewSite(), nil + case "#microsoft.graph.sitePage": + return NewSitePage(), nil + } + } + } + } + return NewBaseItem(), nil +} + +// GetCreatedBy gets the createdBy property value. Identity of the user, device, or application which created the item. Read-only. +func (m *BaseItem) GetCreatedBy() msmodel.IdentitySetable { + return m.createdBy +} + +// GetCreatedByUser gets the createdByUser property value. The createdByUser property +func (m *BaseItem) GetCreatedByUser() msmodel.Userable { + return m.createdByUser +} + +// GetCreatedDateTime gets the createdDateTime property value. Date and time of item creation. Read-only. +func (m *BaseItem) GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + return m.createdDateTime +} + +// GetDescription gets the description property value. The description property +func (m *BaseItem) GetDescription() *string { + return m.description +} + +// GetETag gets the eTag property value. ETag for the item. Read-only. +func (m *BaseItem) GetETag() *string { + return m.eTag +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *BaseItem) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["createdBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(msmodel.CreateIdentitySetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreatedBy(val.(msmodel.IdentitySetable)) + } + return nil + } + res["createdByUser"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(msmodel.CreateUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreatedByUser(val.(msmodel.Userable)) + } + return nil + } + res["createdDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedDateTime(val) + } + return nil + } + res["description"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["eTag"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetETag(val) + } + return nil + } + res["lastModifiedBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(msmodel.CreateIdentitySetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedBy(val.(msmodel.IdentitySetable)) + } + return nil + } + res["lastModifiedByUser"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(msmodel.CreateUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedByUser(val.(msmodel.Userable)) + } + return nil + } + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["name"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["parentReference"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(msmodel.CreateItemReferenceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParentReference(val.(msmodel.ItemReferenceable)) + } + return nil + } + res["webUrl"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebUrl(val) + } + return nil + } + return res +} + +// GetLastModifiedBy gets the lastModifiedBy property value. Identity of the user, device, and application which last modified the item. Read-only. +func (m *BaseItem) GetLastModifiedBy() msmodel.IdentitySetable { + return m.lastModifiedBy +} + +// GetLastModifiedByUser gets the lastModifiedByUser property value. The lastModifiedByUser property +func (m *BaseItem) GetLastModifiedByUser() msmodel.Userable { + return m.lastModifiedByUser +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. Date and time the item was last modified. Read-only. +func (m *BaseItem) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + return m.lastModifiedDateTime +} + +// GetName gets the name property value. The name of the item. Read-write. +func (m *BaseItem) GetName() *string { + return m.name +} + +// GetParentReference gets the parentReference property value. Parent information, if the item has a parent. Read-write. +func (m *BaseItem) GetParentReference() msmodel.ItemReferenceable { + return m.parentReference +} + +// GetWebUrl gets the webUrl property value. URL that displays the resource in the browser. Read-only. +func (m *BaseItem) GetWebUrl() *string { + return m.webUrl +} + +// Serialize serializes information the current object +func (m *BaseItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("createdBy", m.GetCreatedBy()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("createdByUser", m.GetCreatedByUser()) + if err != nil { + return err + } + } + { + err = writer.WriteTimeValue("createdDateTime", m.GetCreatedDateTime()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("eTag", m.GetETag()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("lastModifiedBy", m.GetLastModifiedBy()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("lastModifiedByUser", m.GetLastModifiedByUser()) + if err != nil { + return err + } + } + { + err = writer.WriteTimeValue("lastModifiedDateTime", m.GetLastModifiedDateTime()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("parentReference", m.GetParentReference()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("webUrl", m.GetWebUrl()) + if err != nil { + return err + } + } + return nil +} + +// SetCreatedBy sets the createdBy property value. Identity of the user, device, or application which created the item. Read-only. +func (m *BaseItem) SetCreatedBy(value msmodel.IdentitySetable) { + m.createdBy = value +} + +// SetCreatedByUser sets the createdByUser property value. The createdByUser property +func (m *BaseItem) SetCreatedByUser(value msmodel.Userable) { + m.createdByUser = value +} + +// SetCreatedDateTime sets the createdDateTime property value. Date and time of item creation. Read-only. +func (m *BaseItem) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + m.createdDateTime = value +} + +// SetDescription sets the description property value. The description property +func (m *BaseItem) SetDescription(value *string) { + m.description = value +} + +// SetETag sets the eTag property value. ETag for the item. Read-only. +func (m *BaseItem) SetETag(value *string) { + m.eTag = value +} + +// SetLastModifiedBy sets the lastModifiedBy property value. Identity of the user, device, and application which last modified the item. Read-only. +func (m *BaseItem) SetLastModifiedBy(value msmodel.IdentitySetable) { + m.lastModifiedBy = value +} + +// SetLastModifiedByUser sets the lastModifiedByUser property value. The lastModifiedByUser property +func (m *BaseItem) SetLastModifiedByUser(value msmodel.Userable) { + m.lastModifiedByUser = value +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. Date and time the item was last modified. Read-only. +func (m *BaseItem) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + m.lastModifiedDateTime = value +} + +// SetName sets the name property value. The name of the item. Read-write. +func (m *BaseItem) SetName(value *string) { + m.name = value +} + +// SetParentReference sets the parentReference property value. Parent information, if the item has a parent. Read-write. +func (m *BaseItem) SetParentReference(value msmodel.ItemReferenceable) { + m.parentReference = value +} + +// SetWebUrl sets the webUrl property value. URL that displays the resource in the browser. Read-only. +func (m *BaseItem) SetWebUrl(value *string) { + m.webUrl = value +} diff --git a/src/internal/connector/graph/betasdk/models/canvas_layout.go b/src/internal/connector/graph/betasdk/models/canvas_layout.go new file mode 100644 index 000000000..cda577a77 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/canvas_layout.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// CanvasLayout +type CanvasLayout struct { + msmodel.Entity + // Collection of horizontal sections on the SharePoint page. + horizontalSections []HorizontalSectionable + // Vertical section on the SharePoint page. + verticalSection VerticalSectionable +} + +// NewCanvasLayout instantiates a new canvasLayout and sets the default values. +func NewCanvasLayout() *CanvasLayout { + m := &CanvasLayout{ + Entity: *msmodel.NewEntity(), + } + return m +} + +// CreateCanvasLayoutFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateCanvasLayoutFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCanvasLayout(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *CanvasLayout) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["horizontalSections"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateHorizontalSectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]HorizontalSectionable, len(val)) + for i, v := range val { + res[i] = v.(HorizontalSectionable) + } + m.SetHorizontalSections(res) + } + return nil + } + res["verticalSection"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerticalSectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerticalSection(val.(VerticalSectionable)) + } + return nil + } + return res +} + +// GetHorizontalSections gets the horizontalSections property value. Collection of horizontal sections on the SharePoint page. +func (m *CanvasLayout) GetHorizontalSections() []HorizontalSectionable { + return m.horizontalSections +} + +// GetVerticalSection gets the verticalSection property value. Vertical section on the SharePoint page. +func (m *CanvasLayout) GetVerticalSection() VerticalSectionable { + return m.verticalSection +} + +// Serialize serializes information the current object +func (m *CanvasLayout) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetHorizontalSections() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetHorizontalSections())) + for i, v := range m.GetHorizontalSections() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("horizontalSections", cast) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("verticalSection", m.GetVerticalSection()) + if err != nil { + return err + } + } + return nil +} + +// SetHorizontalSections sets the horizontalSections property value. Collection of horizontal sections on the SharePoint page. +func (m *CanvasLayout) SetHorizontalSections(value []HorizontalSectionable) { + m.horizontalSections = value +} + +// SetVerticalSection sets the verticalSection property value. Vertical section on the SharePoint page. +func (m *CanvasLayout) SetVerticalSection(value VerticalSectionable) { + m.verticalSection = value +} diff --git a/src/internal/connector/graph/betasdk/models/canvas_layoutable.go b/src/internal/connector/graph/betasdk/models/canvas_layoutable.go new file mode 100644 index 000000000..537d5b0df --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/canvas_layoutable.go @@ -0,0 +1,16 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// CanvasLayoutable +type CanvasLayoutable interface { + msmodel.Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHorizontalSections() []HorizontalSectionable + GetVerticalSection() VerticalSectionable + SetHorizontalSections(value []HorizontalSectionable) + SetVerticalSection(value VerticalSectionable) +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_section.go b/src/internal/connector/graph/betasdk/models/horizontal_section.go new file mode 100644 index 000000000..3e143d40f --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_section.go @@ -0,0 +1,133 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// HorizontalSection provides operations to call the remove method. +type HorizontalSection struct { + msmodel.Entity + // The set of vertical columns in this section. + columns []HorizontalSectionColumnable + // Enumeration value that indicates the emphasis of the section background. The possible values are: none, netural, soft, strong, unknownFutureValue. + emphasis *SectionEmphasisType + // Layout type of the section. The possible values are: none, oneColumn, twoColumns, threeColumns, oneThirdLeftColumn, oneThirdRightColumn, fullWidth, unknownFutureValue. + layout *HorizontalSectionLayoutType +} + +// NewHorizontalSection instantiates a new horizontalSection and sets the default values. +func NewHorizontalSection() *HorizontalSection { + m := &HorizontalSection{ + Entity: *msmodel.NewEntity(), + } + return m +} + +// CreateHorizontalSectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateHorizontalSectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHorizontalSection(), nil +} + +// GetColumns gets the columns property value. The set of vertical columns in this section. +func (m *HorizontalSection) GetColumns() []HorizontalSectionColumnable { + return m.columns +} + +// GetEmphasis gets the emphasis property value. Enumeration value that indicates the emphasis of the section background. The possible values are: none, netural, soft, strong, unknownFutureValue. +func (m *HorizontalSection) GetEmphasis() *SectionEmphasisType { + return m.emphasis +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *HorizontalSection) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["columns"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateHorizontalSectionColumnFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]HorizontalSectionColumnable, len(val)) + for i, v := range val { + res[i] = v.(HorizontalSectionColumnable) + } + m.SetColumns(res) + } + return nil + } + res["emphasis"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSectionEmphasisType) + if err != nil { + return err + } + if val != nil { + m.SetEmphasis(val.(*SectionEmphasisType)) + } + return nil + } + res["layout"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseHorizontalSectionLayoutType) + if err != nil { + return err + } + if val != nil { + m.SetLayout(val.(*HorizontalSectionLayoutType)) + } + return nil + } + return res +} + +// GetLayout gets the layout property value. Layout type of the section. The possible values are: none, oneColumn, twoColumns, threeColumns, oneThirdLeftColumn, oneThirdRightColumn, fullWidth, unknownFutureValue. +func (m *HorizontalSection) GetLayout() *HorizontalSectionLayoutType { + return m.layout +} + +// Serialize serializes information the current object +func (m *HorizontalSection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetColumns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetColumns())) + for i, v := range m.GetColumns() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("columns", cast) + if err != nil { + return err + } + } + if m.GetEmphasis() != nil { + cast := (*m.GetEmphasis()).String() + err = writer.WriteStringValue("emphasis", &cast) + if err != nil { + return err + } + } + if m.GetLayout() != nil { + cast := (*m.GetLayout()).String() + err = writer.WriteStringValue("layout", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetColumns sets the columns property value. The set of vertical columns in this section. +func (m *HorizontalSection) SetColumns(value []HorizontalSectionColumnable) { + m.columns = value +} + +// SetEmphasis sets the emphasis property value. Enumeration value that indicates the emphasis of the section background. The possible values are: none, netural, soft, strong, unknownFutureValue. +func (m *HorizontalSection) SetEmphasis(value *SectionEmphasisType) { + m.emphasis = value +} + +// SetLayout sets the layout property value. Layout type of the section. The possible values are: none, oneColumn, twoColumns, threeColumns, oneThirdLeftColumn, oneThirdRightColumn, fullWidth, unknownFutureValue. +func (m *HorizontalSection) SetLayout(value *HorizontalSectionLayoutType) { + m.layout = value +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_section_collection_response.go b/src/internal/connector/graph/betasdk/models/horizontal_section_collection_response.go new file mode 100644 index 000000000..70fb40959 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_section_collection_response.go @@ -0,0 +1,75 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// HorizontalSectionCollectionResponse +type HorizontalSectionCollectionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []HorizontalSectionable +} + +// NewHorizontalSectionCollectionResponse instantiates a new HorizontalSectionCollectionResponse and sets the default values. +func NewHorizontalSectionCollectionResponse() *HorizontalSectionCollectionResponse { + m := &HorizontalSectionCollectionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateHorizontalSectionCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateHorizontalSectionCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHorizontalSectionCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *HorizontalSectionCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateHorizontalSectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]HorizontalSectionable, len(val)) + for i, v := range val { + res[i] = v.(HorizontalSectionable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +func (m *HorizontalSectionCollectionResponse) GetValue() []HorizontalSectionable { + return m.value +} + +// Serialize serializes information the current object +func (m *HorizontalSectionCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *HorizontalSectionCollectionResponse) SetValue(value []HorizontalSectionable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_section_collection_responseable.go b/src/internal/connector/graph/betasdk/models/horizontal_section_collection_responseable.go new file mode 100644 index 000000000..a46d55060 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_section_collection_responseable.go @@ -0,0 +1,14 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// HorizontalSectionCollectionResponseable +type HorizontalSectionCollectionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []HorizontalSectionable + SetValue(value []HorizontalSectionable) +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_section_column.go b/src/internal/connector/graph/betasdk/models/horizontal_section_column.go new file mode 100644 index 000000000..f00261c16 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_section_column.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// HorizontalSectionColumn provides operations to call the remove method. +type HorizontalSectionColumn struct { + msmodel.Entity + // The collection of WebParts in this column. + webparts []WebPartable + // Width of the column. A horizontal section is divided into 12 grids. A column should have a value of 1-12 to represent its range spans. For example, there can be two columns both have a width of 6 in a section. + width *int32 +} + +// NewHorizontalSectionColumn instantiates a new horizontalSectionColumn and sets the default values. +func NewHorizontalSectionColumn() *HorizontalSectionColumn { + m := &HorizontalSectionColumn{ + Entity: *msmodel.NewEntity(), + } + return m +} + +// CreateHorizontalSectionColumnFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateHorizontalSectionColumnFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHorizontalSectionColumn(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *HorizontalSectionColumn) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["webparts"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateWebPartFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]WebPartable, len(val)) + for i, v := range val { + res[i] = v.(WebPartable) + } + m.SetWebparts(res) + } + return nil + } + res["width"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWidth(val) + } + return nil + } + return res +} + +// GetWebparts gets the webparts property value. The collection of WebParts in this column. +func (m *HorizontalSectionColumn) GetWebparts() []WebPartable { + return m.webparts +} + +// GetWidth gets the width property value. Width of the column. A horizontal section is divided into 12 grids. A column should have a value of 1-12 to represent its range spans. For example, there can be two columns both have a width of 6 in a section. +func (m *HorizontalSectionColumn) GetWidth() *int32 { + return m.width +} + +// Serialize serializes information the current object +func (m *HorizontalSectionColumn) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetWebparts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWebparts())) + for i, v := range m.GetWebparts() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("webparts", cast) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("width", m.GetWidth()) + if err != nil { + return err + } + } + return nil +} + +// SetWebparts sets the webparts property value. The collection of WebParts in this column. +func (m *HorizontalSectionColumn) SetWebparts(value []WebPartable) { + m.webparts = value +} + +// SetWidth sets the width property value. Width of the column. A horizontal section is divided into 12 grids. A column should have a value of 1-12 to represent its range spans. For example, there can be two columns both have a width of 6 in a section. +func (m *HorizontalSectionColumn) SetWidth(value *int32) { + m.width = value +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_section_column_collection_response.go b/src/internal/connector/graph/betasdk/models/horizontal_section_column_collection_response.go new file mode 100644 index 000000000..081244d8f --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_section_column_collection_response.go @@ -0,0 +1,75 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// HorizontalSectionColumnCollectionResponse +type HorizontalSectionColumnCollectionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []HorizontalSectionColumnable +} + +// NewHorizontalSectionColumnCollectionResponse instantiates a new HorizontalSectionColumnCollectionResponse and sets the default values. +func NewHorizontalSectionColumnCollectionResponse() *HorizontalSectionColumnCollectionResponse { + m := &HorizontalSectionColumnCollectionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateHorizontalSectionColumnCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateHorizontalSectionColumnCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHorizontalSectionColumnCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *HorizontalSectionColumnCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateHorizontalSectionColumnFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]HorizontalSectionColumnable, len(val)) + for i, v := range val { + res[i] = v.(HorizontalSectionColumnable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +func (m *HorizontalSectionColumnCollectionResponse) GetValue() []HorizontalSectionColumnable { + return m.value +} + +// Serialize serializes information the current object +func (m *HorizontalSectionColumnCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *HorizontalSectionColumnCollectionResponse) SetValue(value []HorizontalSectionColumnable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_section_column_collection_responseable.go b/src/internal/connector/graph/betasdk/models/horizontal_section_column_collection_responseable.go new file mode 100644 index 000000000..b52c33b35 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_section_column_collection_responseable.go @@ -0,0 +1,14 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// HorizontalSectionColumnCollectionResponseable +type HorizontalSectionColumnCollectionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []HorizontalSectionColumnable + SetValue(value []HorizontalSectionColumnable) +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_section_columnable.go b/src/internal/connector/graph/betasdk/models/horizontal_section_columnable.go new file mode 100644 index 000000000..f4f185a4a --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_section_columnable.go @@ -0,0 +1,16 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// HorizontalSectionColumnable +type HorizontalSectionColumnable interface { + msmodel.Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetWebparts() []WebPartable + GetWidth() *int32 + SetWebparts(value []WebPartable) + SetWidth(value *int32) +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_section_layout_type.go b/src/internal/connector/graph/betasdk/models/horizontal_section_layout_type.go new file mode 100644 index 000000000..43c2643a2 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_section_layout_type.go @@ -0,0 +1,52 @@ +package models +import ( + "errors" +) +// Provides operations to call the remove method. +type HorizontalSectionLayoutType int + +const ( + NONE_HORIZONTALSECTIONLAYOUTTYPE HorizontalSectionLayoutType = iota + ONECOLUMN_HORIZONTALSECTIONLAYOUTTYPE + TWOCOLUMNS_HORIZONTALSECTIONLAYOUTTYPE + THREECOLUMNS_HORIZONTALSECTIONLAYOUTTYPE + ONETHIRDLEFTCOLUMN_HORIZONTALSECTIONLAYOUTTYPE + ONETHIRDRIGHTCOLUMN_HORIZONTALSECTIONLAYOUTTYPE + FULLWIDTH_HORIZONTALSECTIONLAYOUTTYPE + UNKNOWNFUTUREVALUE_HORIZONTALSECTIONLAYOUTTYPE +) + +func (i HorizontalSectionLayoutType) String() string { + return []string{"none", "oneColumn", "twoColumns", "threeColumns", "oneThirdLeftColumn", "oneThirdRightColumn", "fullWidth", "unknownFutureValue"}[i] +} +func ParseHorizontalSectionLayoutType(v string) (interface{}, error) { + result := NONE_HORIZONTALSECTIONLAYOUTTYPE + switch v { + case "none": + result = NONE_HORIZONTALSECTIONLAYOUTTYPE + case "oneColumn": + result = ONECOLUMN_HORIZONTALSECTIONLAYOUTTYPE + case "twoColumns": + result = TWOCOLUMNS_HORIZONTALSECTIONLAYOUTTYPE + case "threeColumns": + result = THREECOLUMNS_HORIZONTALSECTIONLAYOUTTYPE + case "oneThirdLeftColumn": + result = ONETHIRDLEFTCOLUMN_HORIZONTALSECTIONLAYOUTTYPE + case "oneThirdRightColumn": + result = ONETHIRDRIGHTCOLUMN_HORIZONTALSECTIONLAYOUTTYPE + case "fullWidth": + result = FULLWIDTH_HORIZONTALSECTIONLAYOUTTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_HORIZONTALSECTIONLAYOUTTYPE + default: + return 0, errors.New("Unknown HorizontalSectionLayoutType value: " + v) + } + return &result, nil +} +func SerializeHorizontalSectionLayoutType(values []HorizontalSectionLayoutType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} diff --git a/src/internal/connector/graph/betasdk/models/horizontal_sectionable.go b/src/internal/connector/graph/betasdk/models/horizontal_sectionable.go new file mode 100644 index 000000000..5ed926080 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/horizontal_sectionable.go @@ -0,0 +1,18 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// HorizontalSectionable +type HorizontalSectionable interface { + msmodel.Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumns() []HorizontalSectionColumnable + GetEmphasis() *SectionEmphasisType + GetLayout() *HorizontalSectionLayoutType + SetColumns(value []HorizontalSectionColumnable) + SetEmphasis(value *SectionEmphasisType) + SetLayout(value *HorizontalSectionLayoutType) +} diff --git a/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair.go b/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair.go new file mode 100644 index 000000000..e7df06165 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair.go @@ -0,0 +1,123 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MetaDataKeyStringPair +type MetaDataKeyStringPair struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // Key of the meta data. + key *string + // The OdataType property + odataType *string + // Value of the meta data. + value *string +} +// NewMetaDataKeyStringPair instantiates a new metaDataKeyStringPair and sets the default values. +func NewMetaDataKeyStringPair()(*MetaDataKeyStringPair) { + m := &MetaDataKeyStringPair{ + } + m.SetAdditionalData(make(map[string]interface{})); + return m +} +// CreateMetaDataKeyStringPairFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMetaDataKeyStringPairFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMetaDataKeyStringPair(), nil +} +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *MetaDataKeyStringPair) GetAdditionalData()(map[string]interface{}) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +func (m *MetaDataKeyStringPair) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["@odata.type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetKey gets the key property value. Key of the meta data. +func (m *MetaDataKeyStringPair) GetKey()(*string) { + return m.key +} +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *MetaDataKeyStringPair) GetOdataType()(*string) { + return m.odataType +} +// GetValue gets the value property value. Value of the meta data. +func (m *MetaDataKeyStringPair) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *MetaDataKeyStringPair) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *MetaDataKeyStringPair) SetAdditionalData(value map[string]interface{})() { + m.additionalData = value +} +// SetKey sets the key property value. Key of the meta data. +func (m *MetaDataKeyStringPair) SetKey(value *string)() { + m.key = value +} +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *MetaDataKeyStringPair) SetOdataType(value *string)() { + m.odataType = value +} +// SetValue sets the value property value. Value of the meta data. +func (m *MetaDataKeyStringPair) SetValue(value *string)() { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair_collection_response.go b/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair_collection_response.go new file mode 100644 index 000000000..b5c88ce49 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair_collection_response.go @@ -0,0 +1,75 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// MetaDataKeyStringPairCollectionResponse +type MetaDataKeyStringPairCollectionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []MetaDataKeyStringPairable +} + +// NewMetaDataKeyStringPairCollectionResponse instantiates a new MetaDataKeyStringPairCollectionResponse and sets the default values. +func NewMetaDataKeyStringPairCollectionResponse() *MetaDataKeyStringPairCollectionResponse { + m := &MetaDataKeyStringPairCollectionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateMetaDataKeyStringPairCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMetaDataKeyStringPairCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMetaDataKeyStringPairCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *MetaDataKeyStringPairCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMetaDataKeyStringPairFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MetaDataKeyStringPairable, len(val)) + for i, v := range val { + res[i] = v.(MetaDataKeyStringPairable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +func (m *MetaDataKeyStringPairCollectionResponse) GetValue() []MetaDataKeyStringPairable { + return m.value +} + +// Serialize serializes information the current object +func (m *MetaDataKeyStringPairCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *MetaDataKeyStringPairCollectionResponse) SetValue(value []MetaDataKeyStringPairable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair_collection_responseable.go b/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair_collection_responseable.go new file mode 100644 index 000000000..ad657d982 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/meta_data_key_string_pair_collection_responseable.go @@ -0,0 +1,14 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// MetaDataKeyStringPairCollectionResponseable +type MetaDataKeyStringPairCollectionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []MetaDataKeyStringPairable + SetValue(value []MetaDataKeyStringPairable) +} diff --git a/src/internal/connector/graph/betasdk/models/meta_data_key_string_pairable.go b/src/internal/connector/graph/betasdk/models/meta_data_key_string_pairable.go new file mode 100644 index 000000000..49908469e --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/meta_data_key_string_pairable.go @@ -0,0 +1,17 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MetaDataKeyStringPairable +type MetaDataKeyStringPairable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetOdataType()(*string) + GetValue()(*string) + SetKey(value *string)() + SetOdataType(value *string)() + SetValue(value *string)() +} diff --git a/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair.go b/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair.go new file mode 100644 index 000000000..a64ebdf0d --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair.go @@ -0,0 +1,135 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// MetaDataKeyValuePair +type MetaDataKeyValuePair struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // Key of the metadata. + key *string + // The OdataType property + odataType *string + // Value of the metadata. Should be an object. + value msmodel.Jsonable +} + +// NewMetaDataKeyValuePair instantiates a new metaDataKeyValuePair and sets the default values. +func NewMetaDataKeyValuePair() *MetaDataKeyValuePair { + m := &MetaDataKeyValuePair{} + m.SetAdditionalData(make(map[string]interface{})) + return m +} + +// CreateMetaDataKeyValuePairFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMetaDataKeyValuePairFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMetaDataKeyValuePair(), nil +} + +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *MetaDataKeyValuePair) GetAdditionalData() map[string]interface{} { + return m.additionalData +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *MetaDataKeyValuePair) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["key"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(msmodel.CreateJsonFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetValue(val.(msmodel.Jsonable)) + } + return nil + } + return res +} + +// GetKey gets the key property value. Key of the metadata. +func (m *MetaDataKeyValuePair) GetKey() *string { + return m.key +} + +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *MetaDataKeyValuePair) GetOdataType() *string { + return m.odataType +} + +// GetValue gets the value property value. Value of the metadata. Should be an object. +func (m *MetaDataKeyValuePair) GetValue() msmodel.Jsonable { + return m.value +} + +// Serialize serializes information the current object +func (m *MetaDataKeyValuePair) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *MetaDataKeyValuePair) SetAdditionalData(value map[string]interface{}) { + m.additionalData = value +} + +// SetKey sets the key property value. Key of the metadata. +func (m *MetaDataKeyValuePair) SetKey(value *string) { + m.key = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *MetaDataKeyValuePair) SetOdataType(value *string) { + m.odataType = value +} + +// SetValue sets the value property value. Value of the metadata. Should be an object. +func (m *MetaDataKeyValuePair) SetValue(value msmodel.Jsonable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair_collection_response.go b/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair_collection_response.go new file mode 100644 index 000000000..747cec59f --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair_collection_response.go @@ -0,0 +1,75 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// MetaDataKeyValuePairCollectionResponse +type MetaDataKeyValuePairCollectionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []MetaDataKeyValuePairable +} + +// NewMetaDataKeyValuePairCollectionResponse instantiates a new MetaDataKeyValuePairCollectionResponse and sets the default values. +func NewMetaDataKeyValuePairCollectionResponse() *MetaDataKeyValuePairCollectionResponse { + m := &MetaDataKeyValuePairCollectionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateMetaDataKeyValuePairCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateMetaDataKeyValuePairCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMetaDataKeyValuePairCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *MetaDataKeyValuePairCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMetaDataKeyValuePairFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MetaDataKeyValuePairable, len(val)) + for i, v := range val { + res[i] = v.(MetaDataKeyValuePairable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +func (m *MetaDataKeyValuePairCollectionResponse) GetValue() []MetaDataKeyValuePairable { + return m.value +} + +// Serialize serializes information the current object +func (m *MetaDataKeyValuePairCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *MetaDataKeyValuePairCollectionResponse) SetValue(value []MetaDataKeyValuePairable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair_collection_responseable.go b/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair_collection_responseable.go new file mode 100644 index 000000000..b2740c217 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/meta_data_key_value_pair_collection_responseable.go @@ -0,0 +1,14 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// MetaDataKeyValuePairCollectionResponseable +type MetaDataKeyValuePairCollectionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []MetaDataKeyValuePairable + SetValue(value []MetaDataKeyValuePairable) +} diff --git a/src/internal/connector/graph/betasdk/models/meta_data_key_value_pairable.go b/src/internal/connector/graph/betasdk/models/meta_data_key_value_pairable.go new file mode 100644 index 000000000..e1bc31e74 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/meta_data_key_value_pairable.go @@ -0,0 +1,18 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// MetaDataKeyValuePairable +type MetaDataKeyValuePairable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey() *string + GetOdataType() *string + GetValue() msmodel.Jsonable + SetKey(value *string) + SetOdataType(value *string) + SetValue(value msmodel.Jsonable) +} diff --git a/src/internal/connector/graph/betasdk/models/page_layout_type.go b/src/internal/connector/graph/betasdk/models/page_layout_type.go new file mode 100644 index 000000000..0338a5c30 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/page_layout_type.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Provides operations to call the remove method. +type PageLayoutType int + +const ( + MICROSOFTRESERVED_PAGELAYOUTTYPE PageLayoutType = iota + ARTICLE_PAGELAYOUTTYPE + HOME_PAGELAYOUTTYPE + UNKNOWNFUTUREVALUE_PAGELAYOUTTYPE +) + +func (i PageLayoutType) String() string { + return []string{"microsoftReserved", "article", "home", "unknownFutureValue"}[i] +} +func ParsePageLayoutType(v string) (interface{}, error) { + result := MICROSOFTRESERVED_PAGELAYOUTTYPE + switch v { + case "microsoftReserved": + result = MICROSOFTRESERVED_PAGELAYOUTTYPE + case "article": + result = ARTICLE_PAGELAYOUTTYPE + case "home": + result = HOME_PAGELAYOUTTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_PAGELAYOUTTYPE + default: + return 0, errors.New("Unknown PageLayoutType value: " + v) + } + return &result, nil +} +func SerializePageLayoutType(values []PageLayoutType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} diff --git a/src/internal/connector/graph/betasdk/models/page_promotion_type.go b/src/internal/connector/graph/betasdk/models/page_promotion_type.go new file mode 100644 index 000000000..a8cbcd058 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/page_promotion_type.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Provides operations to call the remove method. +type PagePromotionType int + +const ( + MICROSOFTRESERVED_PAGEPROMOTIONTYPE PagePromotionType = iota + PAGE_PAGEPROMOTIONTYPE + NEWSPOST_PAGEPROMOTIONTYPE + UNKNOWNFUTUREVALUE_PAGEPROMOTIONTYPE +) + +func (i PagePromotionType) String() string { + return []string{"microsoftReserved", "page", "newsPost", "unknownFutureValue"}[i] +} +func ParsePagePromotionType(v string) (interface{}, error) { + result := MICROSOFTRESERVED_PAGEPROMOTIONTYPE + switch v { + case "microsoftReserved": + result = MICROSOFTRESERVED_PAGEPROMOTIONTYPE + case "page": + result = PAGE_PAGEPROMOTIONTYPE + case "newsPost": + result = NEWSPOST_PAGEPROMOTIONTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_PAGEPROMOTIONTYPE + default: + return 0, errors.New("Unknown PagePromotionType value: " + v) + } + return &result, nil +} +func SerializePagePromotionType(values []PagePromotionType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} diff --git a/src/internal/connector/graph/betasdk/models/publication_facet.go b/src/internal/connector/graph/betasdk/models/publication_facet.go new file mode 100644 index 000000000..87e59d34b --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/publication_facet.go @@ -0,0 +1,123 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PublicationFacet +type PublicationFacet struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // The state of publication for this document. Either published or checkout. Read-only. + level *string + // The OdataType property + odataType *string + // The unique identifier for the version that is visible to the current caller. Read-only. + versionId *string +} +// NewPublicationFacet instantiates a new publicationFacet and sets the default values. +func NewPublicationFacet()(*PublicationFacet) { + m := &PublicationFacet{ + } + m.SetAdditionalData(make(map[string]interface{})); + return m +} +// CreatePublicationFacetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreatePublicationFacetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPublicationFacet(), nil +} +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PublicationFacet) GetAdditionalData()(map[string]interface{}) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +func (m *PublicationFacet) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLevel(val) + } + return nil + } + res["@odata.type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["versionId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersionId(val) + } + return nil + } + return res +} +// GetLevel gets the level property value. The state of publication for this document. Either published or checkout. Read-only. +func (m *PublicationFacet) GetLevel()(*string) { + return m.level +} +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *PublicationFacet) GetOdataType()(*string) { + return m.odataType +} +// GetVersionId gets the versionId property value. The unique identifier for the version that is visible to the current caller. Read-only. +func (m *PublicationFacet) GetVersionId()(*string) { + return m.versionId +} +// Serialize serializes information the current object +func (m *PublicationFacet) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("level", m.GetLevel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("versionId", m.GetVersionId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PublicationFacet) SetAdditionalData(value map[string]interface{})() { + m.additionalData = value +} +// SetLevel sets the level property value. The state of publication for this document. Either published or checkout. Read-only. +func (m *PublicationFacet) SetLevel(value *string)() { + m.level = value +} +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *PublicationFacet) SetOdataType(value *string)() { + m.odataType = value +} +// SetVersionId sets the versionId property value. The unique identifier for the version that is visible to the current caller. Read-only. +func (m *PublicationFacet) SetVersionId(value *string)() { + m.versionId = value +} diff --git a/src/internal/connector/graph/betasdk/models/publication_facetable.go b/src/internal/connector/graph/betasdk/models/publication_facetable.go new file mode 100644 index 000000000..20d82ccf8 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/publication_facetable.go @@ -0,0 +1,17 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PublicationFacetable +type PublicationFacetable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLevel()(*string) + GetOdataType()(*string) + GetVersionId()(*string) + SetLevel(value *string)() + SetOdataType(value *string)() + SetVersionId(value *string)() +} diff --git a/src/internal/connector/graph/betasdk/models/reactions_facet.go b/src/internal/connector/graph/betasdk/models/reactions_facet.go new file mode 100644 index 000000000..b298a9fe1 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/reactions_facet.go @@ -0,0 +1,149 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReactionsFacet +type ReactionsFacet struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // Count of comments. + commentCount *int32 + // Count of likes. + likeCount *int32 + // The OdataType property + odataType *string + // Count of shares. + shareCount *int32 +} +// NewReactionsFacet instantiates a new reactionsFacet and sets the default values. +func NewReactionsFacet()(*ReactionsFacet) { + m := &ReactionsFacet{ + } + m.SetAdditionalData(make(map[string]interface{})); + return m +} +// CreateReactionsFacetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateReactionsFacetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReactionsFacet(), nil +} +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ReactionsFacet) GetAdditionalData()(map[string]interface{}) { + return m.additionalData +} +// GetCommentCount gets the commentCount property value. Count of comments. +func (m *ReactionsFacet) GetCommentCount()(*int32) { + return m.commentCount +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ReactionsFacet) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commentCount"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommentCount(val) + } + return nil + } + res["likeCount"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLikeCount(val) + } + return nil + } + res["@odata.type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["shareCount"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetShareCount(val) + } + return nil + } + return res +} +// GetLikeCount gets the likeCount property value. Count of likes. +func (m *ReactionsFacet) GetLikeCount()(*int32) { + return m.likeCount +} +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *ReactionsFacet) GetOdataType()(*string) { + return m.odataType +} +// GetShareCount gets the shareCount property value. Count of shares. +func (m *ReactionsFacet) GetShareCount()(*int32) { + return m.shareCount +} +// Serialize serializes information the current object +func (m *ReactionsFacet) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("commentCount", m.GetCommentCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("likeCount", m.GetLikeCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("shareCount", m.GetShareCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ReactionsFacet) SetAdditionalData(value map[string]interface{})() { + m.additionalData = value +} +// SetCommentCount sets the commentCount property value. Count of comments. +func (m *ReactionsFacet) SetCommentCount(value *int32)() { + m.commentCount = value +} +// SetLikeCount sets the likeCount property value. Count of likes. +func (m *ReactionsFacet) SetLikeCount(value *int32)() { + m.likeCount = value +} +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ReactionsFacet) SetOdataType(value *string)() { + m.odataType = value +} +// SetShareCount sets the shareCount property value. Count of shares. +func (m *ReactionsFacet) SetShareCount(value *int32)() { + m.shareCount = value +} diff --git a/src/internal/connector/graph/betasdk/models/reactions_facetable.go b/src/internal/connector/graph/betasdk/models/reactions_facetable.go new file mode 100644 index 000000000..4e5086047 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/reactions_facetable.go @@ -0,0 +1,19 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReactionsFacetable +type ReactionsFacetable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommentCount()(*int32) + GetLikeCount()(*int32) + GetOdataType()(*string) + GetShareCount()(*int32) + SetCommentCount(value *int32)() + SetLikeCount(value *int32)() + SetOdataType(value *string)() + SetShareCount(value *int32)() +} diff --git a/src/internal/connector/graph/betasdk/models/section_emphasis_type.go b/src/internal/connector/graph/betasdk/models/section_emphasis_type.go new file mode 100644 index 000000000..0016aec10 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/section_emphasis_type.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// Provides operations to call the remove method. +type SectionEmphasisType int + +const ( + NONE_SECTIONEMPHASISTYPE SectionEmphasisType = iota + NEUTRAL_SECTIONEMPHASISTYPE + SOFT_SECTIONEMPHASISTYPE + STRONG_SECTIONEMPHASISTYPE + UNKNOWNFUTUREVALUE_SECTIONEMPHASISTYPE +) + +func (i SectionEmphasisType) String() string { + return []string{"none", "neutral", "soft", "strong", "unknownFutureValue"}[i] +} +func ParseSectionEmphasisType(v string) (interface{}, error) { + result := NONE_SECTIONEMPHASISTYPE + switch v { + case "none": + result = NONE_SECTIONEMPHASISTYPE + case "neutral": + result = NEUTRAL_SECTIONEMPHASISTYPE + case "soft": + result = SOFT_SECTIONEMPHASISTYPE + case "strong": + result = STRONG_SECTIONEMPHASISTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_SECTIONEMPHASISTYPE + default: + return 0, errors.New("Unknown SectionEmphasisType value: " + v) + } + return &result, nil +} +func SerializeSectionEmphasisType(values []SectionEmphasisType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} diff --git a/src/internal/connector/graph/betasdk/models/server_processed_content.go b/src/internal/connector/graph/betasdk/models/server_processed_content.go new file mode 100644 index 000000000..572a5f87a --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/server_processed_content.go @@ -0,0 +1,294 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ServerProcessedContent +type ServerProcessedContent struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // A key-value map where keys are string identifiers and values are component ids. SharePoint servers might decide to use this hint to preload the script for corresponding components for performance boost. + componentDependencies []MetaDataKeyStringPairable + // A key-value map where keys are string identifier and values are object of custom key-value pair. + customMetadata []MetaDataKeyValuePairable + // A key-value map where keys are string identifiers and values are rich text with HTML format. SharePoint servers treat the values as HTML content and run services like safety checks, search index and link fixup on them. + htmlStrings []MetaDataKeyStringPairable + // A key-value map where keys are string identifiers and values are image sources. SharePoint servers treat the values as image sources and run services like search index and link fixup on them. + imageSources []MetaDataKeyStringPairable + // A key-value map where keys are string identifiers and values are links. SharePoint servers treat the values as links and run services like link fixup on them. + links []MetaDataKeyStringPairable + // The OdataType property + odataType *string + // A key-value map where keys are string identifiers and values are strings that should be search indexed. + searchablePlainTexts []MetaDataKeyStringPairable +} + +// NewServerProcessedContent instantiates a new serverProcessedContent and sets the default values. +func NewServerProcessedContent() *ServerProcessedContent { + m := &ServerProcessedContent{} + m.SetAdditionalData(make(map[string]interface{})) + return m +} + +// CreateServerProcessedContentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateServerProcessedContentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServerProcessedContent(), nil +} + +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ServerProcessedContent) GetAdditionalData() map[string]interface{} { + return m.additionalData +} + +// GetComponentDependencies gets the componentDependencies property value. A key-value map where keys are string identifiers and values are component ids. SharePoint servers might decide to use this hint to preload the script for corresponding components for performance boost. +func (m *ServerProcessedContent) GetComponentDependencies() []MetaDataKeyStringPairable { + return m.componentDependencies +} + +// GetCustomMetadata gets the customMetadata property value. A key-value map where keys are string identifier and values are object of custom key-value pair. +func (m *ServerProcessedContent) GetCustomMetadata() []MetaDataKeyValuePairable { + return m.customMetadata +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *ServerProcessedContent) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["componentDependencies"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMetaDataKeyStringPairFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MetaDataKeyStringPairable, len(val)) + for i, v := range val { + res[i] = v.(MetaDataKeyStringPairable) + } + m.SetComponentDependencies(res) + } + return nil + } + res["customMetadata"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMetaDataKeyValuePairFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MetaDataKeyValuePairable, len(val)) + for i, v := range val { + res[i] = v.(MetaDataKeyValuePairable) + } + m.SetCustomMetadata(res) + } + return nil + } + res["htmlStrings"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMetaDataKeyStringPairFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MetaDataKeyStringPairable, len(val)) + for i, v := range val { + res[i] = v.(MetaDataKeyStringPairable) + } + m.SetHtmlStrings(res) + } + return nil + } + res["imageSources"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMetaDataKeyStringPairFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MetaDataKeyStringPairable, len(val)) + for i, v := range val { + res[i] = v.(MetaDataKeyStringPairable) + } + m.SetImageSources(res) + } + return nil + } + res["links"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMetaDataKeyStringPairFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MetaDataKeyStringPairable, len(val)) + for i, v := range val { + res[i] = v.(MetaDataKeyStringPairable) + } + m.SetLinks(res) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["searchablePlainTexts"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMetaDataKeyStringPairFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MetaDataKeyStringPairable, len(val)) + for i, v := range val { + res[i] = v.(MetaDataKeyStringPairable) + } + m.SetSearchablePlainTexts(res) + } + return nil + } + return res +} + +// GetHtmlStrings gets the htmlStrings property value. A key-value map where keys are string identifiers and values are rich text with HTML format. SharePoint servers treat the values as HTML content and run services like safety checks, search index and link fixup on them. +func (m *ServerProcessedContent) GetHtmlStrings() []MetaDataKeyStringPairable { + return m.htmlStrings +} + +// GetImageSources gets the imageSources property value. A key-value map where keys are string identifiers and values are image sources. SharePoint servers treat the values as image sources and run services like search index and link fixup on them. +func (m *ServerProcessedContent) GetImageSources() []MetaDataKeyStringPairable { + return m.imageSources +} + +// GetLinks gets the links property value. A key-value map where keys are string identifiers and values are links. SharePoint servers treat the values as links and run services like link fixup on them. +func (m *ServerProcessedContent) GetLinks() []MetaDataKeyStringPairable { + return m.links +} + +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *ServerProcessedContent) GetOdataType() *string { + return m.odataType +} + +// GetSearchablePlainTexts gets the searchablePlainTexts property value. A key-value map where keys are string identifiers and values are strings that should be search indexed. +func (m *ServerProcessedContent) GetSearchablePlainTexts() []MetaDataKeyStringPairable { + return m.searchablePlainTexts +} + +// Serialize serializes information the current object +func (m *ServerProcessedContent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetComponentDependencies() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetComponentDependencies())) + for i, v := range m.GetComponentDependencies() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err := writer.WriteCollectionOfObjectValues("componentDependencies", cast) + if err != nil { + return err + } + } + if m.GetCustomMetadata() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCustomMetadata())) + for i, v := range m.GetCustomMetadata() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err := writer.WriteCollectionOfObjectValues("customMetadata", cast) + if err != nil { + return err + } + } + if m.GetHtmlStrings() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetHtmlStrings())) + for i, v := range m.GetHtmlStrings() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err := writer.WriteCollectionOfObjectValues("htmlStrings", cast) + if err != nil { + return err + } + } + if m.GetImageSources() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetImageSources())) + for i, v := range m.GetImageSources() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err := writer.WriteCollectionOfObjectValues("imageSources", cast) + if err != nil { + return err + } + } + if m.GetLinks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLinks())) + for i, v := range m.GetLinks() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err := writer.WriteCollectionOfObjectValues("links", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetSearchablePlainTexts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSearchablePlainTexts())) + for i, v := range m.GetSearchablePlainTexts() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err := writer.WriteCollectionOfObjectValues("searchablePlainTexts", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ServerProcessedContent) SetAdditionalData(value map[string]interface{}) { + m.additionalData = value +} + +// SetComponentDependencies sets the componentDependencies property value. A key-value map where keys are string identifiers and values are component ids. SharePoint servers might decide to use this hint to preload the script for corresponding components for performance boost. +func (m *ServerProcessedContent) SetComponentDependencies(value []MetaDataKeyStringPairable) { + m.componentDependencies = value +} + +// SetCustomMetadata sets the customMetadata property value. A key-value map where keys are string identifier and values are object of custom key-value pair. +func (m *ServerProcessedContent) SetCustomMetadata(value []MetaDataKeyValuePairable) { + m.customMetadata = value +} + +// SetHtmlStrings sets the htmlStrings property value. A key-value map where keys are string identifiers and values are rich text with HTML format. SharePoint servers treat the values as HTML content and run services like safety checks, search index and link fixup on them. +func (m *ServerProcessedContent) SetHtmlStrings(value []MetaDataKeyStringPairable) { + m.htmlStrings = value +} + +// SetImageSources sets the imageSources property value. A key-value map where keys are string identifiers and values are image sources. SharePoint servers treat the values as image sources and run services like search index and link fixup on them. +func (m *ServerProcessedContent) SetImageSources(value []MetaDataKeyStringPairable) { + m.imageSources = value +} + +// SetLinks sets the links property value. A key-value map where keys are string identifiers and values are links. SharePoint servers treat the values as links and run services like link fixup on them. +func (m *ServerProcessedContent) SetLinks(value []MetaDataKeyStringPairable) { + m.links = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ServerProcessedContent) SetOdataType(value *string) { + m.odataType = value +} + +// SetSearchablePlainTexts sets the searchablePlainTexts property value. A key-value map where keys are string identifiers and values are strings that should be search indexed. +func (m *ServerProcessedContent) SetSearchablePlainTexts(value []MetaDataKeyStringPairable) { + m.searchablePlainTexts = value +} diff --git a/src/internal/connector/graph/betasdk/models/server_processed_contentable.go b/src/internal/connector/graph/betasdk/models/server_processed_contentable.go new file mode 100644 index 000000000..5f9faed1a --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/server_processed_contentable.go @@ -0,0 +1,25 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ServerProcessedContentable +type ServerProcessedContentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComponentDependencies() []MetaDataKeyStringPairable + GetCustomMetadata() []MetaDataKeyValuePairable + GetHtmlStrings() []MetaDataKeyStringPairable + GetImageSources() []MetaDataKeyStringPairable + GetLinks() []MetaDataKeyStringPairable + GetOdataType() *string + GetSearchablePlainTexts() []MetaDataKeyStringPairable + SetComponentDependencies(value []MetaDataKeyStringPairable) + SetCustomMetadata(value []MetaDataKeyValuePairable) + SetHtmlStrings(value []MetaDataKeyStringPairable) + SetImageSources(value []MetaDataKeyStringPairable) + SetLinks(value []MetaDataKeyStringPairable) + SetOdataType(value *string) + SetSearchablePlainTexts(value []MetaDataKeyStringPairable) +} diff --git a/src/internal/connector/graph/betasdk/models/site_access_type.go b/src/internal/connector/graph/betasdk/models/site_access_type.go new file mode 100644 index 000000000..052a2efdb --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/site_access_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Provides operations to call the remove method. +type SiteAccessType int + +const ( + BLOCK_SITEACCESSTYPE SiteAccessType = iota + FULL_SITEACCESSTYPE + LIMITED_SITEACCESSTYPE +) + +func (i SiteAccessType) String() string { + return []string{"block", "full", "limited"}[i] +} +func ParseSiteAccessType(v string) (interface{}, error) { + result := BLOCK_SITEACCESSTYPE + switch v { + case "block": + result = BLOCK_SITEACCESSTYPE + case "full": + result = FULL_SITEACCESSTYPE + case "limited": + result = LIMITED_SITEACCESSTYPE + default: + return 0, errors.New("Unknown SiteAccessType value: " + v) + } + return &result, nil +} +func SerializeSiteAccessType(values []SiteAccessType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} diff --git a/src/internal/connector/graph/betasdk/models/site_page.go b/src/internal/connector/graph/betasdk/models/site_page.go new file mode 100644 index 000000000..7555fed52 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/site_page.go @@ -0,0 +1,387 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// SitePage provides operations to call the remove method. +type SitePage struct { + BaseItem + // Indicates the layout of the content in a given SharePoint page, including horizontal sections and vertical section + canvasLayout CanvasLayoutable + // Inherited from baseItem. + contentType msmodel.ContentTypeInfoable + // The name of the page layout of the page. The possible values are: microsoftReserved, article, home, unknownFutureValue. + pageLayout *PageLayoutType + // Indicates the promotion kind of the sitePage. The possible values are: microsoftReserved, page, newsPost, unknownFutureValue. + promotionKind *PagePromotionType + // The publishing status and the MM.mm version of the page. + publishingState PublicationFacetable + // Reactions information for the page. + reactions 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 + thumbnailWebUrl *string + // Title of the sitePage. + title *string + // Title area on the SharePoint page. + titleArea TitleAreaable + // Collection of webparts on the SharePoint page + webParts []WebPartable +} + +// NewSitePage instantiates a new sitePage and sets the default values. +func NewSitePage() *SitePage { + m := &SitePage{ + BaseItem: *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 i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSitePage(), nil +} + +// GetCanvasLayout gets the canvasLayout property value. Indicates the layout of the content in a given SharePoint page, including horizontal sections and vertical section +func (m *SitePage) GetCanvasLayout() CanvasLayoutable { + return m.canvasLayout +} + +// GetContentType gets the contentType property value. Inherited from baseItem. +func (m *SitePage) GetContentType() msmodel.ContentTypeInfoable { + return m.contentType +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *SitePage) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseItem.GetFieldDeserializers() + res["canvasLayout"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCanvasLayoutFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCanvasLayout(val.(CanvasLayoutable)) + } + return nil + } + res["contentType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(msmodel.CreateContentTypeInfoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetContentType(val.(msmodel.ContentTypeInfoable)) + } + return nil + } + res["pageLayout"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePageLayoutType) + if err != nil { + return err + } + if val != nil { + m.SetPageLayout(val.(*PageLayoutType)) + } + return nil + } + res["promotionKind"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePagePromotionType) + if err != nil { + return err + } + if val != nil { + m.SetPromotionKind(val.(*PagePromotionType)) + } + return nil + } + res["publishingState"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePublicationFacetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPublishingState(val.(PublicationFacetable)) + } + return nil + } + res["reactions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionsFacetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionsFacetable)) + } + return nil + } + res["showComments"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetShowComments(val) + } + return nil + } + res["showRecommendedPages"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetShowRecommendedPages(val) + } + return nil + } + res["thumbnailWebUrl"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetThumbnailWebUrl(val) + } + return nil + } + res["title"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["titleArea"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTitleAreaFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTitleArea(val.(TitleAreaable)) + } + return nil + } + res["webParts"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateWebPartFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]WebPartable, len(val)) + for i, v := range val { + res[i] = v.(WebPartable) + } + m.SetWebParts(res) + } + return nil + } + return res +} + +// GetPageLayout gets the pageLayout property value. The name of the page layout of the page. The possible values are: microsoftReserved, article, home, unknownFutureValue. +func (m *SitePage) GetPageLayout() *PageLayoutType { + return m.pageLayout +} + +// GetPromotionKind gets the promotionKind property value. Indicates the promotion kind of the sitePage. The possible values are: microsoftReserved, page, newsPost, unknownFutureValue. +func (m *SitePage) GetPromotionKind() *PagePromotionType { + return m.promotionKind +} + +// GetPublishingState gets the publishingState property value. The publishing status and the MM.mm version of the page. +func (m *SitePage) GetPublishingState() PublicationFacetable { + return m.publishingState +} + +// GetReactions gets the reactions property value. Reactions information for the page. +func (m *SitePage) GetReactions() ReactionsFacetable { + return m.reactions +} + +// 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 +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 +} + +// GetTitleArea gets the titleArea property value. Title area on the SharePoint page. +func (m *SitePage) GetTitleArea() TitleAreaable { + return m.titleArea +} + +// GetWebParts gets the webParts property value. Collection of webparts on the SharePoint page +func (m *SitePage) GetWebParts() []WebPartable { + return m.webParts +} + +// Serialize serializes information the current object +func (m *SitePage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseItem.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("canvasLayout", m.GetCanvasLayout()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("contentType", m.GetContentType()) + if err != nil { + return err + } + } + if m.GetPageLayout() != nil { + cast := (*m.GetPageLayout()).String() + err = writer.WriteStringValue("pageLayout", &cast) + if err != nil { + return err + } + } + if m.GetPromotionKind() != nil { + cast := (*m.GetPromotionKind()).String() + err = writer.WriteStringValue("promotionKind", &cast) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("publishingState", m.GetPublishingState()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("reactions", m.GetReactions()) + 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 + } + } + { + err = writer.WriteObjectValue("titleArea", m.GetTitleArea()) + if err != nil { + return err + } + } + if m.GetWebParts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWebParts())) + for i, v := range m.GetWebParts() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("webParts", cast) + if err != nil { + return err + } + } + return nil +} + +// SetCanvasLayout sets the canvasLayout property value. Indicates the layout of the content in a given SharePoint page, including horizontal sections and vertical section +func (m *SitePage) SetCanvasLayout(value CanvasLayoutable) { + m.canvasLayout = value +} + +// SetContentType sets the contentType property value. Inherited from baseItem. +func (m *SitePage) SetContentType(value msmodel.ContentTypeInfoable) { + m.contentType = value +} + +// SetPageLayout sets the pageLayout property value. The name of the page layout of the page. The possible values are: microsoftReserved, article, home, unknownFutureValue. +func (m *SitePage) SetPageLayout(value *PageLayoutType) { + m.pageLayout = value +} + +// SetPromotionKind sets the promotionKind property value. Indicates the promotion kind of the sitePage. The possible values are: microsoftReserved, page, newsPost, unknownFutureValue. +func (m *SitePage) SetPromotionKind(value *PagePromotionType) { + m.promotionKind = value +} + +// SetPublishingState sets the publishingState property value. The publishing status and the MM.mm version of the page. +func (m *SitePage) SetPublishingState(value PublicationFacetable) { + m.publishingState = value +} + +// SetReactions sets the reactions property value. Reactions information for the page. +func (m *SitePage) SetReactions(value ReactionsFacetable) { + m.reactions = 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 +func (m *SitePage) SetThumbnailWebUrl(value *string) { + m.thumbnailWebUrl = value +} + +// SetTitle sets the title property value. Title of the sitePage. +func (m *SitePage) SetTitle(value *string) { + m.title = value +} + +// SetTitleArea sets the titleArea property value. Title area on the SharePoint page. +func (m *SitePage) SetTitleArea(value TitleAreaable) { + m.titleArea = value +} + +// SetWebParts sets the webParts property value. Collection of webparts on the SharePoint page +func (m *SitePage) SetWebParts(value []WebPartable) { + m.webParts = value +} diff --git a/src/internal/connector/graph/betasdk/models/site_page_collection_response.go b/src/internal/connector/graph/betasdk/models/site_page_collection_response.go new file mode 100644 index 000000000..f66cdafdf --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/site_page_collection_response.go @@ -0,0 +1,76 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// SitePageCollectionResponse provides operations to manage the pages property of the microsoft.graph.site entity. +type SitePageCollectionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []SitePageable +} + +// NewSitePageCollectionResponse instantiates a new SitePageCollectionResponse and sets the default values. +func NewSitePageCollectionResponse() *SitePageCollectionResponse { + m := &SitePageCollectionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateSitePageCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateSitePageCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSitePageCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *SitePageCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSitePageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SitePageable, len(val)) + for i, v := range val { + res[i] = v.(SitePageable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +func (m *SitePageCollectionResponse) GetValue() []SitePageable { + return m.value +} + +// Serialize serializes information the current object +func (m *SitePageCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *SitePageCollectionResponse) SetValue(value []SitePageable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/site_page_collection_responseable.go b/src/internal/connector/graph/betasdk/models/site_page_collection_responseable.go new file mode 100644 index 000000000..30cceeb11 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/site_page_collection_responseable.go @@ -0,0 +1,14 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// SitePageCollectionResponseable +type SitePageCollectionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []SitePageable + SetValue(value []SitePageable) +} diff --git a/src/internal/connector/graph/betasdk/models/site_pageable.go b/src/internal/connector/graph/betasdk/models/site_pageable.go new file mode 100644 index 000000000..1131bfa9d --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/site_pageable.go @@ -0,0 +1,36 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// SitePageable +type SitePageable interface { + msmodel.BaseItemable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanvasLayout() CanvasLayoutable + GetContentType() msmodel.ContentTypeInfoable + GetPageLayout() *PageLayoutType + GetPromotionKind() *PagePromotionType + GetPublishingState() PublicationFacetable + GetReactions() ReactionsFacetable + GetShowComments() *bool + GetShowRecommendedPages() *bool + GetThumbnailWebUrl() *string + GetTitle() *string + GetTitleArea() TitleAreaable + GetWebParts() []WebPartable + SetCanvasLayout(value CanvasLayoutable) + SetContentType(value msmodel.ContentTypeInfoable) + SetPageLayout(value *PageLayoutType) + SetPromotionKind(value *PagePromotionType) + SetPublishingState(value PublicationFacetable) + SetReactions(value ReactionsFacetable) + SetShowComments(value *bool) + SetShowRecommendedPages(value *bool) + SetThumbnailWebUrl(value *string) + SetTitle(value *string) + SetTitleArea(value TitleAreaable) + SetWebParts(value []WebPartable) +} diff --git a/src/internal/connector/graph/betasdk/models/site_security_level.go b/src/internal/connector/graph/betasdk/models/site_security_level.go new file mode 100644 index 000000000..d2733ce47 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/site_security_level.go @@ -0,0 +1,52 @@ +package models +import ( + "errors" +) +// Provides operations to call the add method. +type SiteSecurityLevel int + +const ( + // User Defined, default value, no intent. + USERDEFINED_SITESECURITYLEVEL SiteSecurityLevel = iota + // Low. + LOW_SITESECURITYLEVEL + // Medium-low. + MEDIUMLOW_SITESECURITYLEVEL + // Medium. + MEDIUM_SITESECURITYLEVEL + // Medium-high. + MEDIUMHIGH_SITESECURITYLEVEL + // High. + HIGH_SITESECURITYLEVEL +) + +func (i SiteSecurityLevel) String() string { + return []string{"userDefined", "low", "mediumLow", "medium", "mediumHigh", "high"}[i] +} +func ParseSiteSecurityLevel(v string) (interface{}, error) { + result := USERDEFINED_SITESECURITYLEVEL + switch v { + case "userDefined": + result = USERDEFINED_SITESECURITYLEVEL + case "low": + result = LOW_SITESECURITYLEVEL + case "mediumLow": + result = MEDIUMLOW_SITESECURITYLEVEL + case "medium": + result = MEDIUM_SITESECURITYLEVEL + case "mediumHigh": + result = MEDIUMHIGH_SITESECURITYLEVEL + case "high": + result = HIGH_SITESECURITYLEVEL + default: + return 0, errors.New("Unknown SiteSecurityLevel value: " + v) + } + return &result, nil +} +func SerializeSiteSecurityLevel(values []SiteSecurityLevel) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} diff --git a/src/internal/connector/graph/betasdk/models/site_settings.go b/src/internal/connector/graph/betasdk/models/site_settings.go new file mode 100644 index 000000000..a2a36d94a --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/site_settings.go @@ -0,0 +1,123 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SiteSettings +type SiteSettings struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // The language tag for the language used on this site. + languageTag *string + // The OdataType property + odataType *string + // Indicates the time offset for the time zone of the site from Coordinated Universal Time (UTC). + timeZone *string +} +// NewSiteSettings instantiates a new siteSettings and sets the default values. +func NewSiteSettings()(*SiteSettings) { + m := &SiteSettings{ + } + m.SetAdditionalData(make(map[string]interface{})); + return m +} +// CreateSiteSettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateSiteSettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSiteSettings(), nil +} +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SiteSettings) GetAdditionalData()(map[string]interface{}) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +func (m *SiteSettings) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["languageTag"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguageTag(val) + } + return nil + } + res["@odata.type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["timeZone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimeZone(val) + } + return nil + } + return res +} +// GetLanguageTag gets the languageTag property value. The language tag for the language used on this site. +func (m *SiteSettings) GetLanguageTag()(*string) { + return m.languageTag +} +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *SiteSettings) GetOdataType()(*string) { + return m.odataType +} +// GetTimeZone gets the timeZone property value. Indicates the time offset for the time zone of the site from Coordinated Universal Time (UTC). +func (m *SiteSettings) GetTimeZone()(*string) { + return m.timeZone +} +// Serialize serializes information the current object +func (m *SiteSettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("languageTag", m.GetLanguageTag()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeZone", m.GetTimeZone()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SiteSettings) SetAdditionalData(value map[string]interface{})() { + m.additionalData = value +} +// SetLanguageTag sets the languageTag property value. The language tag for the language used on this site. +func (m *SiteSettings) SetLanguageTag(value *string)() { + m.languageTag = value +} +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *SiteSettings) SetOdataType(value *string)() { + m.odataType = value +} +// SetTimeZone sets the timeZone property value. Indicates the time offset for the time zone of the site from Coordinated Universal Time (UTC). +func (m *SiteSettings) SetTimeZone(value *string)() { + m.timeZone = value +} diff --git a/src/internal/connector/graph/betasdk/models/site_settingsable.go b/src/internal/connector/graph/betasdk/models/site_settingsable.go new file mode 100644 index 000000000..0423550ea --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/site_settingsable.go @@ -0,0 +1,17 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SiteSettingsable +type SiteSettingsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLanguageTag()(*string) + GetOdataType()(*string) + GetTimeZone()(*string) + SetLanguageTag(value *string)() + SetOdataType(value *string)() + SetTimeZone(value *string)() +} diff --git a/src/internal/connector/graph/betasdk/models/standard_web_part.go b/src/internal/connector/graph/betasdk/models/standard_web_part.go new file mode 100644 index 000000000..0b7b4427a --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/standard_web_part.go @@ -0,0 +1,88 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// StandardWebPart +type StandardWebPart struct { + WebPart + // Data of the webPart. + data WebPartDataable + // A Guid which indicates the type of the webParts + webPartType *string +} +// NewStandardWebPart instantiates a new StandardWebPart and sets the default values. +func NewStandardWebPart()(*StandardWebPart) { + m := &StandardWebPart{ + WebPart: *NewWebPart(), + } + odataTypeValue := "#microsoft.graph.standardWebPart"; + m.SetOdataType(&odataTypeValue); + return m +} +// CreateStandardWebPartFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateStandardWebPartFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStandardWebPart(), nil +} +// GetData gets the data property value. Data of the webPart. +func (m *StandardWebPart) GetData()(WebPartDataable) { + return m.data +} +// GetFieldDeserializers the deserialization information for the current model +func (m *StandardWebPart) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.WebPart.GetFieldDeserializers() + res["data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWebPartDataFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetData(val.(WebPartDataable)) + } + return nil + } + res["webPartType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebPartType(val) + } + return nil + } + return res +} +// GetWebPartType gets the webPartType property value. A Guid which indicates the type of the webParts +func (m *StandardWebPart) GetWebPartType()(*string) { + return m.webPartType +} +// Serialize serializes information the current object +func (m *StandardWebPart) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.WebPart.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("data", m.GetData()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("webPartType", m.GetWebPartType()) + if err != nil { + return err + } + } + return nil +} +// SetData sets the data property value. Data of the webPart. +func (m *StandardWebPart) SetData(value WebPartDataable)() { + m.data = value +} +// SetWebPartType sets the webPartType property value. A Guid which indicates the type of the webParts +func (m *StandardWebPart) SetWebPartType(value *string)() { + m.webPartType = value +} diff --git a/src/internal/connector/graph/betasdk/models/standard_web_part_collection_response.go b/src/internal/connector/graph/betasdk/models/standard_web_part_collection_response.go new file mode 100644 index 000000000..084496a8a --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/standard_web_part_collection_response.go @@ -0,0 +1,75 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// StandardWebPartCollectionResponse +type StandardWebPartCollectionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []StandardWebPartable +} + +// NewStandardWebPartCollectionResponse instantiates a new StandardWebPartCollectionResponse and sets the default values. +func NewStandardWebPartCollectionResponse() *StandardWebPartCollectionResponse { + m := &StandardWebPartCollectionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateStandardWebPartCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateStandardWebPartCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStandardWebPartCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *StandardWebPartCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateStandardWebPartFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]StandardWebPartable, len(val)) + for i, v := range val { + res[i] = v.(StandardWebPartable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +func (m *StandardWebPartCollectionResponse) GetValue() []StandardWebPartable { + return m.value +} + +// Serialize serializes information the current object +func (m *StandardWebPartCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *StandardWebPartCollectionResponse) SetValue(value []StandardWebPartable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/standard_web_part_collection_responseable.go b/src/internal/connector/graph/betasdk/models/standard_web_part_collection_responseable.go new file mode 100644 index 000000000..9e1f4d0d7 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/standard_web_part_collection_responseable.go @@ -0,0 +1,14 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// StandardWebPartCollectionResponseable +type StandardWebPartCollectionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []StandardWebPartable + SetValue(value []StandardWebPartable) +} diff --git a/src/internal/connector/graph/betasdk/models/standard_web_partable.go b/src/internal/connector/graph/betasdk/models/standard_web_partable.go new file mode 100644 index 000000000..e09160b2b --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/standard_web_partable.go @@ -0,0 +1,15 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// StandardWebPartable +type StandardWebPartable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + WebPartable + GetData()(WebPartDataable) + GetWebPartType()(*string) + SetData(value WebPartDataable)() + SetWebPartType(value *string)() +} diff --git a/src/internal/connector/graph/betasdk/models/text_web_part.go b/src/internal/connector/graph/betasdk/models/text_web_part.go new file mode 100644 index 000000000..f607ffa31 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/text_web_part.go @@ -0,0 +1,62 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TextWebPart +type TextWebPart struct { + WebPart + // The HTML string in text web part. + innerHtml *string +} +// NewTextWebPart instantiates a new TextWebPart and sets the default values. +func NewTextWebPart()(*TextWebPart) { + m := &TextWebPart{ + WebPart: *NewWebPart(), + } + odataTypeValue := "#microsoft.graph.textWebPart"; + m.SetOdataType(&odataTypeValue); + return m +} +// CreateTextWebPartFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateTextWebPartFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTextWebPart(), nil +} +// GetFieldDeserializers the deserialization information for the current model +func (m *TextWebPart) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.WebPart.GetFieldDeserializers() + res["innerHtml"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInnerHtml(val) + } + return nil + } + return res +} +// GetInnerHtml gets the innerHtml property value. The HTML string in text web part. +func (m *TextWebPart) GetInnerHtml()(*string) { + return m.innerHtml +} +// Serialize serializes information the current object +func (m *TextWebPart) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.WebPart.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("innerHtml", m.GetInnerHtml()) + if err != nil { + return err + } + } + return nil +} +// SetInnerHtml sets the innerHtml property value. The HTML string in text web part. +func (m *TextWebPart) SetInnerHtml(value *string)() { + m.innerHtml = value +} diff --git a/src/internal/connector/graph/betasdk/models/text_web_part_collection_response.go b/src/internal/connector/graph/betasdk/models/text_web_part_collection_response.go new file mode 100644 index 000000000..ea07beae7 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/text_web_part_collection_response.go @@ -0,0 +1,75 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// TextWebPartCollectionResponse +type TextWebPartCollectionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []TextWebPartable +} + +// NewTextWebPartCollectionResponse instantiates a new TextWebPartCollectionResponse and sets the default values. +func NewTextWebPartCollectionResponse() *TextWebPartCollectionResponse { + m := &TextWebPartCollectionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateTextWebPartCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateTextWebPartCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTextWebPartCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *TextWebPartCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTextWebPartFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TextWebPartable, len(val)) + for i, v := range val { + res[i] = v.(TextWebPartable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +func (m *TextWebPartCollectionResponse) GetValue() []TextWebPartable { + return m.value +} + +// Serialize serializes information the current object +func (m *TextWebPartCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *TextWebPartCollectionResponse) SetValue(value []TextWebPartable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/text_web_part_collection_responseable.go b/src/internal/connector/graph/betasdk/models/text_web_part_collection_responseable.go new file mode 100644 index 000000000..785618756 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/text_web_part_collection_responseable.go @@ -0,0 +1,14 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// TextWebPartCollectionResponseable +type TextWebPartCollectionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []TextWebPartable + SetValue(value []TextWebPartable) +} diff --git a/src/internal/connector/graph/betasdk/models/text_web_partable.go b/src/internal/connector/graph/betasdk/models/text_web_partable.go new file mode 100644 index 000000000..45e21d92b --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/text_web_partable.go @@ -0,0 +1,13 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TextWebPartable +type TextWebPartable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + WebPartable + GetInnerHtml()(*string) + SetInnerHtml(value *string)() +} diff --git a/src/internal/connector/graph/betasdk/models/title_area.go b/src/internal/connector/graph/betasdk/models/title_area.go new file mode 100644 index 000000000..77b61ec7c --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/title_area.go @@ -0,0 +1,360 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TitleArea +type TitleArea struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // Alternative text on the title area. + alternativeText *string + // Indicates whether the title area has a gradient effect enabled. + enableGradientEffect *bool + // URL of the image in the title area. + imageWebUrl *string + // Enumeration value that indicates the layout of the title area. The possible values are: imageAndTitle, plain, colorBlock, overlap, unknownFutureValue. + layout *TitleAreaLayoutType + // The OdataType property + odataType *string + // Contains collections of data that can be processed by server side services like search index and link fixup. + serverProcessedContent ServerProcessedContentable + // Indicates whether the author should be shown in title area. + showAuthor *bool + // Indicates whether the published date should be shown in title area. + showPublishedDate *bool + // Indicates whether the text block above title should be shown in title area. + showTextBlockAboveTitle *bool + // The text above title line. + textAboveTitle *string + // Enumeration value that indicates the text alignment of the title area. The possible values are: left, center, unknownFutureValue. + textAlignment *TitleAreaTextAlignmentType +} + +// NewTitleArea instantiates a new titleArea and sets the default values. +func NewTitleArea() *TitleArea { + m := &TitleArea{} + m.SetAdditionalData(make(map[string]interface{})) + return m +} + +// CreateTitleAreaFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateTitleAreaFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTitleArea(), nil +} + +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *TitleArea) GetAdditionalData() map[string]interface{} { + return m.additionalData +} + +// GetAlternativeText gets the alternativeText property value. Alternative text on the title area. +func (m *TitleArea) GetAlternativeText() *string { + return m.alternativeText +} + +// GetEnableGradientEffect gets the enableGradientEffect property value. Indicates whether the title area has a gradient effect enabled. +func (m *TitleArea) GetEnableGradientEffect() *bool { + return m.enableGradientEffect +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *TitleArea) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["alternativeText"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAlternativeText(val) + } + return nil + } + res["enableGradientEffect"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableGradientEffect(val) + } + return nil + } + res["imageWebUrl"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetImageWebUrl(val) + } + return nil + } + res["layout"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTitleAreaLayoutType) + if err != nil { + return err + } + if val != nil { + m.SetLayout(val.(*TitleAreaLayoutType)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["serverProcessedContent"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateServerProcessedContentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetServerProcessedContent(val.(ServerProcessedContentable)) + } + return nil + } + res["showAuthor"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetShowAuthor(val) + } + return nil + } + res["showPublishedDate"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetShowPublishedDate(val) + } + return nil + } + res["showTextBlockAboveTitle"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetShowTextBlockAboveTitle(val) + } + return nil + } + res["textAboveTitle"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTextAboveTitle(val) + } + return nil + } + res["textAlignment"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTitleAreaTextAlignmentType) + if err != nil { + return err + } + if val != nil { + m.SetTextAlignment(val.(*TitleAreaTextAlignmentType)) + } + return nil + } + return res +} + +// GetImageWebUrl gets the imageWebUrl property value. URL of the image in the title area. +func (m *TitleArea) GetImageWebUrl() *string { + return m.imageWebUrl +} + +// GetLayout gets the layout property value. Enumeration value that indicates the layout of the title area. The possible values are: imageAndTitle, plain, colorBlock, overlap, unknownFutureValue. +func (m *TitleArea) GetLayout() *TitleAreaLayoutType { + return m.layout +} + +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *TitleArea) GetOdataType() *string { + return m.odataType +} + +// GetServerProcessedContent gets the serverProcessedContent property value. Contains collections of data that can be processed by server side services like search index and link fixup. +func (m *TitleArea) GetServerProcessedContent() ServerProcessedContentable { + return m.serverProcessedContent +} + +// GetShowAuthor gets the showAuthor property value. Indicates whether the author should be shown in title area. +func (m *TitleArea) GetShowAuthor() *bool { + return m.showAuthor +} + +// GetShowPublishedDate gets the showPublishedDate property value. Indicates whether the published date should be shown in title area. +func (m *TitleArea) GetShowPublishedDate() *bool { + return m.showPublishedDate +} + +// GetShowTextBlockAboveTitle gets the showTextBlockAboveTitle property value. Indicates whether the text block above title should be shown in title area. +func (m *TitleArea) GetShowTextBlockAboveTitle() *bool { + return m.showTextBlockAboveTitle +} + +// GetTextAboveTitle gets the textAboveTitle property value. The text above title line. +func (m *TitleArea) GetTextAboveTitle() *string { + return m.textAboveTitle +} + +// GetTextAlignment gets the textAlignment property value. Enumeration value that indicates the text alignment of the title area. The possible values are: left, center, unknownFutureValue. +func (m *TitleArea) GetTextAlignment() *TitleAreaTextAlignmentType { + return m.textAlignment +} + +// Serialize serializes information the current object +func (m *TitleArea) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("alternativeText", m.GetAlternativeText()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enableGradientEffect", m.GetEnableGradientEffect()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("imageWebUrl", m.GetImageWebUrl()) + if err != nil { + return err + } + } + if m.GetLayout() != nil { + cast := (*m.GetLayout()).String() + err := writer.WriteStringValue("layout", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("serverProcessedContent", m.GetServerProcessedContent()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("showAuthor", m.GetShowAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("showPublishedDate", m.GetShowPublishedDate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("showTextBlockAboveTitle", m.GetShowTextBlockAboveTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("textAboveTitle", m.GetTextAboveTitle()) + if err != nil { + return err + } + } + if m.GetTextAlignment() != nil { + cast := (*m.GetTextAlignment()).String() + err := writer.WriteStringValue("textAlignment", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *TitleArea) SetAdditionalData(value map[string]interface{}) { + m.additionalData = value +} + +// SetAlternativeText sets the alternativeText property value. Alternative text on the title area. +func (m *TitleArea) SetAlternativeText(value *string) { + m.alternativeText = value +} + +// SetEnableGradientEffect sets the enableGradientEffect property value. Indicates whether the title area has a gradient effect enabled. +func (m *TitleArea) SetEnableGradientEffect(value *bool) { + m.enableGradientEffect = value +} + +// SetImageWebUrl sets the imageWebUrl property value. URL of the image in the title area. +func (m *TitleArea) SetImageWebUrl(value *string) { + m.imageWebUrl = value +} + +// SetLayout sets the layout property value. Enumeration value that indicates the layout of the title area. The possible values are: imageAndTitle, plain, colorBlock, overlap, unknownFutureValue. +func (m *TitleArea) SetLayout(value *TitleAreaLayoutType) { + m.layout = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *TitleArea) SetOdataType(value *string) { + m.odataType = value +} + +// SetServerProcessedContent sets the serverProcessedContent property value. Contains collections of data that can be processed by server side services like search index and link fixup. +func (m *TitleArea) SetServerProcessedContent(value ServerProcessedContentable) { + m.serverProcessedContent = value +} + +// SetShowAuthor sets the showAuthor property value. Indicates whether the author should be shown in title area. +func (m *TitleArea) SetShowAuthor(value *bool) { + m.showAuthor = value +} + +// SetShowPublishedDate sets the showPublishedDate property value. Indicates whether the published date should be shown in title area. +func (m *TitleArea) SetShowPublishedDate(value *bool) { + m.showPublishedDate = value +} + +// SetShowTextBlockAboveTitle sets the showTextBlockAboveTitle property value. Indicates whether the text block above title should be shown in title area. +func (m *TitleArea) SetShowTextBlockAboveTitle(value *bool) { + m.showTextBlockAboveTitle = value +} + +// SetTextAboveTitle sets the textAboveTitle property value. The text above title line. +func (m *TitleArea) SetTextAboveTitle(value *string) { + m.textAboveTitle = value +} + +// SetTextAlignment sets the textAlignment property value. Enumeration value that indicates the text alignment of the title area. The possible values are: left, center, unknownFutureValue. +func (m *TitleArea) SetTextAlignment(value *TitleAreaTextAlignmentType) { + m.textAlignment = value +} diff --git a/src/internal/connector/graph/betasdk/models/title_area_layout_type.go b/src/internal/connector/graph/betasdk/models/title_area_layout_type.go new file mode 100644 index 000000000..375b68874 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/title_area_layout_type.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// Provides operations to call the remove method. +type TitleAreaLayoutType int + +const ( + IMAGEANDTITLE_TITLEAREALAYOUTTYPE TitleAreaLayoutType = iota + PLAIN_TITLEAREALAYOUTTYPE + COLORBLOCK_TITLEAREALAYOUTTYPE + OVERLAP_TITLEAREALAYOUTTYPE + UNKNOWNFUTUREVALUE_TITLEAREALAYOUTTYPE +) + +func (i TitleAreaLayoutType) String() string { + return []string{"imageAndTitle", "plain", "colorBlock", "overlap", "unknownFutureValue"}[i] +} +func ParseTitleAreaLayoutType(v string) (interface{}, error) { + result := IMAGEANDTITLE_TITLEAREALAYOUTTYPE + switch v { + case "imageAndTitle": + result = IMAGEANDTITLE_TITLEAREALAYOUTTYPE + case "plain": + result = PLAIN_TITLEAREALAYOUTTYPE + case "colorBlock": + result = COLORBLOCK_TITLEAREALAYOUTTYPE + case "overlap": + result = OVERLAP_TITLEAREALAYOUTTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_TITLEAREALAYOUTTYPE + default: + return 0, errors.New("Unknown TitleAreaLayoutType value: " + v) + } + return &result, nil +} +func SerializeTitleAreaLayoutType(values []TitleAreaLayoutType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} diff --git a/src/internal/connector/graph/betasdk/models/title_area_text_alignment_type.go b/src/internal/connector/graph/betasdk/models/title_area_text_alignment_type.go new file mode 100644 index 000000000..27b1e1dba --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/title_area_text_alignment_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Provides operations to call the remove method. +type TitleAreaTextAlignmentType int + +const ( + LEFT_TITLEAREATEXTALIGNMENTTYPE TitleAreaTextAlignmentType = iota + CENTER_TITLEAREATEXTALIGNMENTTYPE + UNKNOWNFUTUREVALUE_TITLEAREATEXTALIGNMENTTYPE +) + +func (i TitleAreaTextAlignmentType) String() string { + return []string{"left", "center", "unknownFutureValue"}[i] +} +func ParseTitleAreaTextAlignmentType(v string) (interface{}, error) { + result := LEFT_TITLEAREATEXTALIGNMENTTYPE + switch v { + case "left": + result = LEFT_TITLEAREATEXTALIGNMENTTYPE + case "center": + result = CENTER_TITLEAREATEXTALIGNMENTTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_TITLEAREATEXTALIGNMENTTYPE + default: + return 0, errors.New("Unknown TitleAreaTextAlignmentType value: " + v) + } + return &result, nil +} +func SerializeTitleAreaTextAlignmentType(values []TitleAreaTextAlignmentType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} diff --git a/src/internal/connector/graph/betasdk/models/title_areaable.go b/src/internal/connector/graph/betasdk/models/title_areaable.go new file mode 100644 index 000000000..fb36bf576 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/title_areaable.go @@ -0,0 +1,33 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TitleAreaable +type TitleAreaable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAlternativeText() *string + GetEnableGradientEffect() *bool + GetImageWebUrl() *string + GetLayout() *TitleAreaLayoutType + GetOdataType() *string + GetServerProcessedContent() ServerProcessedContentable + GetShowAuthor() *bool + GetShowPublishedDate() *bool + GetShowTextBlockAboveTitle() *bool + GetTextAboveTitle() *string + GetTextAlignment() *TitleAreaTextAlignmentType + SetAlternativeText(value *string) + SetEnableGradientEffect(value *bool) + SetImageWebUrl(value *string) + SetLayout(value *TitleAreaLayoutType) + SetOdataType(value *string) + SetServerProcessedContent(value ServerProcessedContentable) + SetShowAuthor(value *bool) + SetShowPublishedDate(value *bool) + SetShowTextBlockAboveTitle(value *bool) + SetTextAboveTitle(value *string) + SetTextAlignment(value *TitleAreaTextAlignmentType) +} diff --git a/src/internal/connector/graph/betasdk/models/vertical_section.go b/src/internal/connector/graph/betasdk/models/vertical_section.go new file mode 100644 index 000000000..e4e8f6ed5 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/vertical_section.go @@ -0,0 +1,104 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// VerticalSection +type VerticalSection struct { + msmodel.Entity + // Enumeration value that indicates the emphasis of the section background. The possible values are: none, netural, soft, strong, unknownFutureValue. + emphasis *SectionEmphasisType + // The set of web parts in this section. + webparts []WebPartable +} + +// NewVerticalSection instantiates a new verticalSection and sets the default values. +func NewVerticalSection() *VerticalSection { + m := &VerticalSection{ + Entity: *msmodel.NewEntity(), + } + return m +} + +// CreateVerticalSectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateVerticalSectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVerticalSection(), nil +} + +// GetEmphasis gets the emphasis property value. Enumeration value that indicates the emphasis of the section background. The possible values are: none, netural, soft, strong, unknownFutureValue. +func (m *VerticalSection) GetEmphasis() *SectionEmphasisType { + return m.emphasis +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *VerticalSection) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["emphasis"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSectionEmphasisType) + if err != nil { + return err + } + if val != nil { + m.SetEmphasis(val.(*SectionEmphasisType)) + } + return nil + } + res["webparts"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateWebPartFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]WebPartable, len(val)) + for i, v := range val { + res[i] = v.(WebPartable) + } + m.SetWebparts(res) + } + return nil + } + return res +} + +// GetWebparts gets the webparts property value. The set of web parts in this section. +func (m *VerticalSection) GetWebparts() []WebPartable { + return m.webparts +} + +// Serialize serializes information the current object +func (m *VerticalSection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetEmphasis() != nil { + cast := (*m.GetEmphasis()).String() + err = writer.WriteStringValue("emphasis", &cast) + if err != nil { + return err + } + } + if m.GetWebparts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWebparts())) + for i, v := range m.GetWebparts() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("webparts", cast) + if err != nil { + return err + } + } + return nil +} + +// SetEmphasis sets the emphasis property value. Enumeration value that indicates the emphasis of the section background. The possible values are: none, netural, soft, strong, unknownFutureValue. +func (m *VerticalSection) SetEmphasis(value *SectionEmphasisType) { + m.emphasis = value +} + +// SetWebparts sets the webparts property value. The set of web parts in this section. +func (m *VerticalSection) SetWebparts(value []WebPartable) { + m.webparts = value +} diff --git a/src/internal/connector/graph/betasdk/models/vertical_sectionable.go b/src/internal/connector/graph/betasdk/models/vertical_sectionable.go new file mode 100644 index 000000000..f4f0a991b --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/vertical_sectionable.go @@ -0,0 +1,16 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// VerticalSectionable +type VerticalSectionable interface { + msmodel.Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmphasis() *SectionEmphasisType + GetWebparts() []WebPartable + SetEmphasis(value *SectionEmphasisType) + SetWebparts(value []WebPartable) +} diff --git a/src/internal/connector/graph/betasdk/models/web_part.go b/src/internal/connector/graph/betasdk/models/web_part.go new file mode 100644 index 000000000..3287051b1 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/web_part.go @@ -0,0 +1,59 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// WebPart provides operations to call the remove method. +type WebPart struct { + msmodel.Entity +} + +// NewWebPart instantiates a new webPart and sets the default values. +func NewWebPart() *WebPart { + m := &WebPart{ + Entity: *msmodel.NewEntity(), + } + return m +} + +// CreateWebPartFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateWebPartFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("@odata.type") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + switch *mappingValue { + case "#microsoft.graph.standardWebPart": + return NewStandardWebPart(), nil + case "#microsoft.graph.textWebPart": + return NewTextWebPart(), nil + } + } + } + } + return NewWebPart(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *WebPart) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + return res +} + +// Serialize serializes information the current object +func (m *WebPart) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + return nil +} diff --git a/src/internal/connector/graph/betasdk/models/web_part_collection_response.go b/src/internal/connector/graph/betasdk/models/web_part_collection_response.go new file mode 100644 index 000000000..e590431b2 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/web_part_collection_response.go @@ -0,0 +1,75 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// WebPartCollectionResponse provides operations to manage the webParts property of the microsoft.graph.sitePage entity. +type WebPartCollectionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []WebPartable +} + +// NewWebPartCollectionResponse instantiates a new WebPartCollectionResponse and sets the default values. +func NewWebPartCollectionResponse() *WebPartCollectionResponse { + m := &WebPartCollectionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateWebPartCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateWebPartCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWebPartCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *WebPartCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateWebPartFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]WebPartable, len(val)) + for i, v := range val { + res[i] = v.(WebPartable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +func (m *WebPartCollectionResponse) GetValue() []WebPartable { + return m.value +} + +// Serialize serializes information the current object +func (m *WebPartCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *WebPartCollectionResponse) SetValue(value []WebPartable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/models/web_part_collection_responseable.go b/src/internal/connector/graph/betasdk/models/web_part_collection_responseable.go new file mode 100644 index 000000000..63aa0cae2 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/web_part_collection_responseable.go @@ -0,0 +1,14 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// WebPartCollectionResponseable +type WebPartCollectionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []WebPartable + SetValue(value []WebPartable) +} diff --git a/src/internal/connector/graph/betasdk/models/web_part_data.go b/src/internal/connector/graph/betasdk/models/web_part_data.go new file mode 100644 index 000000000..251ed2dc9 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/web_part_data.go @@ -0,0 +1,251 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// WebPartData +type WebPartData struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // Audience information of the web part. By using this property, specific content will be prioritized to specific audiences. + audiences []string + // Data version of the web part. The value is defined by the web part developer. Different dataVersions usually refers to a different property structure. + dataVersion *string + // Description of the web part. + description *string + // The OdataType property + odataType *string + // Properties bag of the web part. + properties msmodel.Jsonable + // Contains collections of data that can be processed by server side services like search index and link fixup. + serverProcessedContent ServerProcessedContentable + // Title of the web part. + title *string +} + +// NewWebPartData instantiates a new webPartData and sets the default values. +func NewWebPartData() *WebPartData { + m := &WebPartData{} + m.SetAdditionalData(make(map[string]interface{})) + return m +} + +// CreateWebPartDataFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateWebPartDataFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWebPartData(), nil +} + +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *WebPartData) GetAdditionalData() map[string]interface{} { + return m.additionalData +} + +// GetAudiences gets the audiences property value. Audience information of the web part. By using this property, specific content will be prioritized to specific audiences. +func (m *WebPartData) GetAudiences() []string { + return m.audiences +} + +// GetDataVersion gets the dataVersion property value. Data version of the web part. The value is defined by the web part developer. Different dataVersions usually refers to a different property structure. +func (m *WebPartData) GetDataVersion() *string { + return m.dataVersion +} + +// GetDescription gets the description property value. Description of the web part. +func (m *WebPartData) GetDescription() *string { + return m.description +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *WebPartData) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["audiences"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + res[i] = *(v.(*string)) + } + m.SetAudiences(res) + } + return nil + } + res["dataVersion"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDataVersion(val) + } + return nil + } + res["description"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["properties"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(msmodel.CreateJsonFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProperties(val.(msmodel.Jsonable)) + } + return nil + } + res["serverProcessedContent"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateServerProcessedContentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetServerProcessedContent(val.(ServerProcessedContentable)) + } + return nil + } + res["title"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *WebPartData) GetOdataType() *string { + return m.odataType +} + +// GetProperties gets the properties property value. Properties bag of the web part. +func (m *WebPartData) GetProperties() msmodel.Jsonable { + return m.properties +} + +// GetServerProcessedContent gets the serverProcessedContent property value. Contains collections of data that can be processed by server side services like search index and link fixup. +func (m *WebPartData) GetServerProcessedContent() ServerProcessedContentable { + return m.serverProcessedContent +} + +// GetTitle gets the title property value. Title of the web part. +func (m *WebPartData) GetTitle() *string { + return m.title +} + +// Serialize serializes information the current object +func (m *WebPartData) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetAudiences() != nil { + err := writer.WriteCollectionOfStringValues("audiences", m.GetAudiences()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dataVersion", m.GetDataVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("properties", m.GetProperties()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("serverProcessedContent", m.GetServerProcessedContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *WebPartData) SetAdditionalData(value map[string]interface{}) { + m.additionalData = value +} + +// SetAudiences sets the audiences property value. Audience information of the web part. By using this property, specific content will be prioritized to specific audiences. +func (m *WebPartData) SetAudiences(value []string) { + m.audiences = value +} + +// SetDataVersion sets the dataVersion property value. Data version of the web part. The value is defined by the web part developer. Different dataVersions usually refers to a different property structure. +func (m *WebPartData) SetDataVersion(value *string) { + m.dataVersion = value +} + +// SetDescription sets the description property value. Description of the web part. +func (m *WebPartData) SetDescription(value *string) { + m.description = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *WebPartData) SetOdataType(value *string) { + m.odataType = value +} + +// SetProperties sets the properties property value. Properties bag of the web part. +func (m *WebPartData) SetProperties(value msmodel.Jsonable) { + m.properties = value +} + +// SetServerProcessedContent sets the serverProcessedContent property value. Contains collections of data that can be processed by server side services like search index and link fixup. +func (m *WebPartData) SetServerProcessedContent(value ServerProcessedContentable) { + m.serverProcessedContent = value +} + +// SetTitle sets the title property value. Title of the web part. +func (m *WebPartData) SetTitle(value *string) { + m.title = value +} diff --git a/src/internal/connector/graph/betasdk/models/web_part_dataable.go b/src/internal/connector/graph/betasdk/models/web_part_dataable.go new file mode 100644 index 000000000..a27a6d158 --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/web_part_dataable.go @@ -0,0 +1,26 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// WebPartDataable +type WebPartDataable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAudiences() []string + GetDataVersion() *string + GetDescription() *string + GetOdataType() *string + GetProperties() msmodel.Jsonable + GetServerProcessedContent() ServerProcessedContentable + GetTitle() *string + SetAudiences(value []string) + SetDataVersion(value *string) + SetDescription(value *string) + SetOdataType(value *string) + SetProperties(value msmodel.Jsonable) + SetServerProcessedContent(value ServerProcessedContentable) + SetTitle(value *string) +} diff --git a/src/internal/connector/graph/betasdk/models/web_part_position.go b/src/internal/connector/graph/betasdk/models/web_part_position.go new file mode 100644 index 000000000..f2f1c3c9e --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/web_part_position.go @@ -0,0 +1,175 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WebPartPosition +type WebPartPosition struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // Indicates the identifier of the column where the web part is located. + columnId *float64 + // Indicates the horizontal section where the web part is located. + horizontalSectionId *float64 + // Indicates whether the web part is located in the vertical section. + isInVerticalSection *bool + // The OdataType property + odataType *string + // Index of the current web part. Represents the order of the web part in this column or section. + webPartIndex *float64 +} +// NewWebPartPosition instantiates a new webPartPosition and sets the default values. +func NewWebPartPosition()(*WebPartPosition) { + m := &WebPartPosition{ + } + m.SetAdditionalData(make(map[string]interface{})); + return m +} +// CreateWebPartPositionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateWebPartPositionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWebPartPosition(), nil +} +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *WebPartPosition) GetAdditionalData()(map[string]interface{}) { + return m.additionalData +} +// GetColumnId gets the columnId property value. Indicates the identifier of the column where the web part is located. +func (m *WebPartPosition) GetColumnId()(*float64) { + return m.columnId +} +// GetFieldDeserializers the deserialization information for the current model +func (m *WebPartPosition) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["columnId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetColumnId(val) + } + return nil + } + res["horizontalSectionId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetHorizontalSectionId(val) + } + return nil + } + res["isInVerticalSection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsInVerticalSection(val) + } + return nil + } + res["@odata.type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["webPartIndex"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetWebPartIndex(val) + } + return nil + } + return res +} +// GetHorizontalSectionId gets the horizontalSectionId property value. Indicates the horizontal section where the web part is located. +func (m *WebPartPosition) GetHorizontalSectionId()(*float64) { + return m.horizontalSectionId +} +// GetIsInVerticalSection gets the isInVerticalSection property value. Indicates whether the web part is located in the vertical section. +func (m *WebPartPosition) GetIsInVerticalSection()(*bool) { + return m.isInVerticalSection +} +// GetOdataType gets the @odata.type property value. The OdataType property +func (m *WebPartPosition) GetOdataType()(*string) { + return m.odataType +} +// GetWebPartIndex gets the webPartIndex property value. Index of the current web part. Represents the order of the web part in this column or section. +func (m *WebPartPosition) GetWebPartIndex()(*float64) { + return m.webPartIndex +} +// Serialize serializes information the current object +func (m *WebPartPosition) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteFloat64Value("columnId", m.GetColumnId()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("horizontalSectionId", m.GetHorizontalSectionId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isInVerticalSection", m.GetIsInVerticalSection()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("webPartIndex", m.GetWebPartIndex()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *WebPartPosition) SetAdditionalData(value map[string]interface{})() { + m.additionalData = value +} +// SetColumnId sets the columnId property value. Indicates the identifier of the column where the web part is located. +func (m *WebPartPosition) SetColumnId(value *float64)() { + m.columnId = value +} +// SetHorizontalSectionId sets the horizontalSectionId property value. Indicates the horizontal section where the web part is located. +func (m *WebPartPosition) SetHorizontalSectionId(value *float64)() { + m.horizontalSectionId = value +} +// SetIsInVerticalSection sets the isInVerticalSection property value. Indicates whether the web part is located in the vertical section. +func (m *WebPartPosition) SetIsInVerticalSection(value *bool)() { + m.isInVerticalSection = value +} +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *WebPartPosition) SetOdataType(value *string)() { + m.odataType = value +} +// SetWebPartIndex sets the webPartIndex property value. Index of the current web part. Represents the order of the web part in this column or section. +func (m *WebPartPosition) SetWebPartIndex(value *float64)() { + m.webPartIndex = value +} diff --git a/src/internal/connector/graph/betasdk/models/web_part_positionable.go b/src/internal/connector/graph/betasdk/models/web_part_positionable.go new file mode 100644 index 000000000..f0939db2e --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/web_part_positionable.go @@ -0,0 +1,21 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WebPartPositionable +type WebPartPositionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnId()(*float64) + GetHorizontalSectionId()(*float64) + GetIsInVerticalSection()(*bool) + GetOdataType()(*string) + GetWebPartIndex()(*float64) + SetColumnId(value *float64)() + SetHorizontalSectionId(value *float64)() + SetIsInVerticalSection(value *bool)() + SetOdataType(value *string)() + SetWebPartIndex(value *float64)() +} diff --git a/src/internal/connector/graph/betasdk/models/web_partable.go b/src/internal/connector/graph/betasdk/models/web_partable.go new file mode 100644 index 000000000..ac8a2a84d --- /dev/null +++ b/src/internal/connector/graph/betasdk/models/web_partable.go @@ -0,0 +1,12 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +// WebPartable +type WebPartable interface { + msmodel.Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/src/internal/connector/graph/betasdk/sites/count_request_builder.go b/src/internal/connector/graph/betasdk/sites/count_request_builder.go new file mode 100644 index 000000000..f36f1c220 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/count_request_builder.go @@ -0,0 +1,116 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// CountRequestBuilder provides operations to count the resources in the collection. +type CountRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// CountRequestBuilderGetQueryParameters get the number of the resource +type CountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` +} + +// CountRequestBuilderGetRequestConfiguration configuration for the request such as headers, +// query parameters, and middleware options. +type CountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *CountRequestBuilderGetQueryParameters +} + +// NewCountRequestBuilderInternal instantiates a new CountRequestBuilder and sets the default values. +func NewCountRequestBuilderInternal( + pathParameters map[string]string, + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, +) *CountRequestBuilder { + m := &CountRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/$count{?%24search,%24filter}" + urlTplParams := make(map[string]string) + + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + + return m +} + +// NewCountRequestBuilder instantiates a new CountRequestBuilder and sets the default values. +func NewCountRequestBuilder( + rawURL string, + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, +) *CountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawURL + + return NewCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation get the number of the resource +func (m *CountRequestBuilder) CreateGetRequestInformation( + ctx context.Context, + requestConfiguration *CountRequestBuilderGetRequestConfiguration, +) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "text/plain") + + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// Get get the number of the resource +// +//nolint:lll +func (m *CountRequestBuilder) Get(ctx context.Context, requestConfiguration *CountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + res, err := m.requestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + + if res == nil { + return nil, nil + } + + return res.(*int32), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_count_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_count_request_builder.go new file mode 100644 index 000000000..284366a30 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_count_request_builder.go @@ -0,0 +1,115 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesCountRequestBuilder provides operations to count the resources in the collection. +type ItemPagesCountRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesCountRequestBuilderGetQueryParameters get the number of the resource +type ItemPagesCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` +} + +// ItemPagesCountRequestBuilderGetRequestConfiguration configuration for the request +// such as headers, query parameters, and middleware options. +type ItemPagesCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesCountRequestBuilderGetQueryParameters +} + +// NewItemPagesCountRequestBuilderInternal instantiates a new CountRequestBuilder and sets the default values. +func NewItemPagesCountRequestBuilderInternal( + pathParameters map[string]string, + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, +) *ItemPagesCountRequestBuilder { + m := &ItemPagesCountRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/$count{?%24search,%24filter}" + urlTplParams := make(map[string]string) + + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + + return m +} + +// NewItemPagesCountRequestBuilder instantiates a new CountRequestBuilder and sets the default values. +func NewItemPagesCountRequestBuilder( + rawURL string, + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, +) *ItemPagesCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawURL + + return NewItemPagesCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation get the number of the resource +// +//nolint:lll +func (m *ItemPagesCountRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "text/plain") + + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// Get get the number of the resource +// +//nolint:lll +func (m *ItemPagesCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + res, err := m.requestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + + if res == nil { + return nil, nil + } + + return res.(*int32), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_count_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_count_request_builder.go new file mode 100644 index 000000000..deec0ca5f --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_count_request_builder.go @@ -0,0 +1,122 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder provides +// operations to count the resources in the collection. +type ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderGetRequestConfiguration configuration for +// the request such as headers, query parameters, and middleware options. +type ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderGetQueryParameters +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderInternal instantiates a +// new CountRequestBuilder and sets the default values. +func NewItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderInternal( + pathParameters map[string]string, + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, +) *ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder{} + //nolint:lll + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/$count{?%24search,%24filter}" + urlTplParams := make(map[string]string) + + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder instantiates a +// new CountRequestBuilder and sets the default values. +func NewItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder( + rawURL string, + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, +) *ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawURL + + return NewItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation get the number of the resource +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder) CreateGetRequestInformation( + ctx context.Context, + requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderGetRequestConfiguration, +) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error, +) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "text/plain") + + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// Get get the number of the resource +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder) Get( + ctx context.Context, + requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderGetRequestConfiguration, +) (*int32, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + res, err := m.requestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + + if res == nil { + return nil, nil + } + + return res.(*int32), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_horizontal_section_item_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_horizontal_section_item_request_builder.go new file mode 100644 index 000000000..0845ecee4 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_horizontal_section_item_request_builder.go @@ -0,0 +1,260 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder +// provides operations to manage the horizontalSections property of the microsoft.graph.canvasLayout entity. +type ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderDeleteRequestConfiguration +// configuration for the request such as headers, query parameters, and middleware options. +type ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderGetQueryParameters +// collection of horizontal sections on the SharePoint page. +type ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderGetRequestConfiguration +// configuration for the request such as headers, query parameters, and middleware options. +type ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderPatchRequestConfiguration +// configuration for the request such as headers, query parameters, and middleware options. +type ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// Columns provides operations to manage the columns property of the microsoft.graph.horizontalSection entity. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder) Columns() *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder { + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// ColumnsById provides operations to manage the columns property of the microsoft.graph.horizontalSection entity. +// +//nolint:revive +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder) ColumnsById(id string, +) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.pathParameters { + urlTplParams[idx] = item + } + + if id != "" { + urlTplParams["horizontalSectionColumn%2Did"] = id + } + //nolint:lll + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderInternal +// instantiates a new HorizontalSectionItemRequestBuilder and sets the default values. +func NewItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderInternal( + pathParameters map[string]string, + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, +) *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder{} + //nolint:lll + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/{horizontalSection%2Did}{?%24select,%24expand}" + urlTplParams := make(map[string]string) + + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder instantiates a +// new HorizontalSectionItemRequestBuilder and sets the default values. +func NewItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder( + rawURL string, + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, +) *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawURL + + return NewItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderInternal( + urlParams, + requestAdapter, + ) +} + +// CreateDeleteRequestInformation delete navigation property horizontalSections for sites +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder) CreateDeleteRequestInformation( + ctx context.Context, + requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderDeleteRequestConfiguration, +) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE + + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// CreateGetRequestInformation collection of horizontal sections on the SharePoint page. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder) CreateGetRequestInformation( + ctx context.Context, + requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderGetRequestConfiguration, +) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// CreatePatchRequestInformation update the navigation property horizontalSections in sites +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + + err := requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if err != nil { + return nil, err + } + + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// Delete delete navigation property horizontalSections for sites +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + + if err != nil { + return err + } + + return nil +} + +// Get collection of horizontal sections on the SharePoint page. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateHorizontalSectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + + if res == nil { + return nil, nil + } + + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable), nil +} + +// Patch update the navigation property horizontalSections in sites +// nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder) Patch(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderPatchRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateHorizontalSectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + + if res == nil { + return nil, nil + } + + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_count_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_count_request_builder.go new file mode 100644 index 000000000..95a2e7314 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_count_request_builder.go @@ -0,0 +1,117 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder +// provides operations to count the resources in the collection. +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderGetQueryParameters get the number of the resource +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderGetQueryParameters +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderInternal instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:lll +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/{horizontalSection%2Did}/columns/$count{?%24search,%24filter}" + urlTplParams := make(map[string]string) + + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:lll +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder(rawURL string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawURL + + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation get the number of the resource +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "text/plain") + + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// Get get the number of the resource +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + res, err := m.requestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + + if res == nil { + return nil, nil + } + + return res.(*int32), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_horizontal_section_column_item_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_horizontal_section_column_item_request_builder.go new file mode 100644 index 000000000..c1a8315ce --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_horizontal_section_column_item_request_builder.go @@ -0,0 +1,247 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder provides operations to manage the columns property of the microsoft.graph.horizontalSection entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderGetQueryParameters the set of vertical columns in this section. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderInternal instantiates a new HorizontalSectionColumnItemRequestBuilder and sets the default values. +// +//nolint:lll +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/{horizontalSection%2Did}/columns/{horizontalSectionColumn%2Did}{?%24select,%24expand}" + urlTplParams := make(map[string]string) + + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder instantiates a new HorizontalSectionColumnItemRequestBuilder and sets the default values. +// +//nolint:lll, revive +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateDeleteRequestInformation delete navigation property columns for sites +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder) CreateDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE + + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// CreateGetRequestInformation the set of vertical columns in this section. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// CreatePatchRequestInformation update the navigation property columns in sites +// +//nolint:lll,errcheck +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// Delete delete navigation property columns for sites +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + + return nil +} + +// Get the set of vertical columns in this section. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateHorizontalSectionColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + + if res == nil { + return nil, nil + } + + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable), nil +} + +// Patch update the navigation property columns in sites +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder) Patch(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilderPatchRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateHorizontalSectionColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + + if res == nil { + return nil, nil + } + + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable), nil +} + +// Webparts provides operations to manage the webparts property of the microsoft.graph.horizontalSectionColumn entity. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder) Webparts() *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder { + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// WebpartsById provides operations to manage the webparts property of the microsoft.graph.horizontalSectionColumn entity. +// +//nolint:lll,revive +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsHorizontalSectionColumnItemRequestBuilder) WebpartsById(id string) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.pathParameters { + urlTplParams[idx] = item + } + + if id != "" { + urlTplParams["webPart%2Did"] = id + } + + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_count_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_count_request_builder.go new file mode 100644 index 000000000..b5c6e3a40 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_count_request_builder.go @@ -0,0 +1,111 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder provides operations to count the resources in the collection. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderGetQueryParameters get the number of the resource +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderGetQueryParameters +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderInternal instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:lll +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/{horizontalSection%2Did}/columns/{horizontalSectionColumn%2Did}/webparts/$count{?%24search,%24filter}" + urlTplParams := make(map[string]string) + + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:lll, revive +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation get the number of the resource +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "text/plain") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get get the number of the resource +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_item_get_position_of_web_part_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_item_get_position_of_web_part_request_builder.go new file mode 100644 index 000000000..14429d80f --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_item_get_position_of_web_part_request_builder.go @@ -0,0 +1,96 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder provides operations to call the getPositionOfWebPart method. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilderInternal instantiates a new GetPositionOfWebPartRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/{horizontalSection%2Did}/columns/{horizontalSectionColumn%2Did}/webparts/{webPart%2Did}/microsoft.graph.getPositionOfWebPart" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder instantiates a new GetPositionOfWebPartRequestBuilder and sets the default values. +// +//nolint:lll,revive,wsl +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreatePostRequestInformation invoke action getPositionOfWebPart +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder) CreatePostRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// nolint:lll,wsl +// Post invoke action getPositionOfWebPart +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/webpart-getposition?view=graph-rest-1.0 +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder) Post(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartPositionable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartPositionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartPositionable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_request_builder.go new file mode 100644 index 000000000..4d2a94186 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_request_builder.go @@ -0,0 +1,180 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder provides operations to manage the webparts property of the microsoft.graph.horizontalSectionColumn entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderGetQueryParameters get the webPart resources from a sitePage. Sort by the order in which they appear on the page. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderGetQueryParameters struct { + // Include count of items + Count *bool `uriparametername:"%24count"` + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Order items by property values + Orderby []string `uriparametername:"%24orderby"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` + // Skip the first n items + Skip *int32 `uriparametername:"%24skip"` + // Show only the first n items + Top *int32 `uriparametername:"%24top"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderInternal instantiates a new WebpartsRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/{horizontalSection%2Did}/columns/{horizontalSectionColumn%2Did}/webparts{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder instantiates a new WebpartsRequestBuilder and sets the default values. +// +//nolint:lll,revive,wsl +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder) Count() *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilder { + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsCountRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// CreateGetRequestInformation get the webPart resources from a sitePage. Sort by the order in which they appear on the page. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePostRequestInformation create new navigation property to webparts for sites +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder) CreatePostRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get get the webPart resources from a sitePage. Sort by the order in which they appear on the page. +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/webpart-list?view=graph-rest-1.0 +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartCollectionResponseable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartCollectionResponseable), nil +} + +// Post create new navigation property to webparts for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilder) Post(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_web_part_item_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_web_part_item_request_builder.go new file mode 100644 index 000000000..0ce7becda --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_item_webparts_web_part_item_request_builder.go @@ -0,0 +1,209 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder provides operations to manage the webparts property of the microsoft.graph.horizontalSectionColumn entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderGetQueryParameters the collection of WebParts in this column. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderInternal instantiates a new WebPartItemRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/{horizontalSection%2Did}/columns/{horizontalSectionColumn%2Did}/webparts/{webPart%2Did}{?%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder instantiates a new WebPartItemRequestBuilder and sets the default values. +// +//nolint:lll,revive,wsl +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateDeleteRequestInformation delete navigation property webparts for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder) CreateDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreateGetRequestInformation the collection of WebParts in this column. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePatchRequestInformation update the navigation property webparts in sites +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Delete delete navigation property webparts for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the collection of WebParts in this column. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} + +// GetPositionOfWebPart provides operations to call the getPositionOfWebPart method. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder) GetPositionOfWebPart() *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilder { + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsItemGetPositionOfWebPartRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// Patch update the navigation property webparts in sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilder) Patch(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsItemWebpartsWebPartItemRequestBuilderPatchRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_request_builder.go new file mode 100644 index 000000000..368738104 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_item_columns_request_builder.go @@ -0,0 +1,180 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder provides operations to manage the columns property of the microsoft.graph.horizontalSection entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderGetQueryParameters get a list of the horizontalSectionColumn objects and their properties. Sort by `id` in ascending order. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderGetQueryParameters struct { + // Include count of items + Count *bool `uriparametername:"%24count"` + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Order items by property values + Orderby []string `uriparametername:"%24orderby"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` + // Skip the first n items + Skip *int32 `uriparametername:"%24skip"` + // Show only the first n items + Top *int32 `uriparametername:"%24top"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderInternal instantiates a new ColumnsRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections/{horizontalSection%2Did}/columns{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder instantiates a new ColumnsRequestBuilder and sets the default values. +// +//nolint:lll,wsl,revive +func NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder) Count() *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilder { + return NewItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsCountRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// CreateGetRequestInformation get a list of the horizontalSectionColumn objects and their properties. Sort by `id` in ascending order. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePostRequestInformation create new navigation property to columns for sites +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder) CreatePostRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get get a list of the horizontalSectionColumn objects and their properties. Sort by `id` in ascending order. +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/horizontalsectioncolumn-list?view=graph-rest-1.0 +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnCollectionResponseable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateHorizontalSectionColumnCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnCollectionResponseable), nil +} + +// Post create new navigation property to columns for sites +// +//nolint:lll, wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilder) Post(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsItemColumnsRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateHorizontalSectionColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionColumnable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_request_builder.go new file mode 100644 index 000000000..829b830f0 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_horizontal_sections_request_builder.go @@ -0,0 +1,179 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder provides operations to manage the horizontalSections property of the microsoft.graph.canvasLayout entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderGetQueryParameters get a list of the horizontalSection objects and their properties. Sort by `id` in ascending order. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderGetQueryParameters struct { + // Include count of items + Count *bool `uriparametername:"%24count"` + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Order items by property values + Orderby []string `uriparametername:"%24orderby"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` + // Skip the first n items + Skip *int32 `uriparametername:"%24skip"` + // Show only the first n items + Top *int32 `uriparametername:"%24top"` +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderInternal instantiates a new HorizontalSectionsRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder { + m := &ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/horizontalSections{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder instantiates a new HorizontalSectionsRequestBuilder and sets the default values. +// +//nolint:lll,wsl,revive +func NewItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder) Count() *ItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilder { + return NewItemPagesItemCanvasLayoutHorizontalSectionsCountRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// CreateGetRequestInformation get a list of the horizontalSection objects and their properties. Sort by `id` in ascending order. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePostRequestInformation create new navigation property to horizontalSections for sites +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder) CreatePostRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get get a list of the horizontalSection objects and their properties. Sort by `id` in ascending order. +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/horizontalsection-list?view=graph-rest-1.0 +// +//nolint:lll, wsl +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionCollectionResponseable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateHorizontalSectionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionCollectionResponseable), nil +} + +// nolint:lll,wsl +// Post create new navigation property to horizontalSections for sites +func (m *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder) Post(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable, requestConfiguration *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateHorizontalSectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.HorizontalSectionable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_request_builder.go new file mode 100644 index 000000000..bbca05a9b --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_request_builder.go @@ -0,0 +1,230 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutRequestBuilder provides operations to manage the canvasLayout property of the microsoft.graph.sitePage entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPagesItemCanvasLayoutRequestBuilderGetQueryParameters indicates the layout of the content in a given SharePoint page, including horizontal sections and vertical section +// +//nolint:lll +type ItemPagesItemCanvasLayoutRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemPagesItemCanvasLayoutRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutRequestBuilderInternal instantiates a new CanvasLayoutRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutRequestBuilder { + m := &ItemPagesItemCanvasLayoutRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout{?%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutRequestBuilder instantiates a new CanvasLayoutRequestBuilder and sets the default values. +// +//nolint:lll,revive,wsl +func NewItemPagesItemCanvasLayoutRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateDeleteRequestInformation delete navigation property canvasLayout for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutRequestBuilder) CreateDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreateGetRequestInformation indicates the layout of the content in a given SharePoint page, including horizontal sections and vertical section +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePatchRequestInformation update the navigation property canvasLayout in sites +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemCanvasLayoutRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CanvasLayoutable, requestConfiguration *ItemPagesItemCanvasLayoutRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Delete delete navigation property canvasLayout for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get indicates the layout of the content in a given SharePoint page, including horizontal sections and vertical section +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CanvasLayoutable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateCanvasLayoutFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CanvasLayoutable), nil +} + +// HorizontalSections provides operations to manage the horizontalSections property of the microsoft.graph.canvasLayout entity. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutRequestBuilder) HorizontalSections() *ItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilder { + return NewItemPagesItemCanvasLayoutHorizontalSectionsRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// HorizontalSectionsById provides operations to manage the horizontalSections property of the microsoft.graph.canvasLayout entity. +// +//nolint:lll,wsl,revive +func (m *ItemPagesItemCanvasLayoutRequestBuilder) HorizontalSectionsById(id string) *ItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.pathParameters { + urlTplParams[idx] = item + } + if id != "" { + urlTplParams["horizontalSection%2Did"] = id + } + return NewItemPagesItemCanvasLayoutHorizontalSectionsHorizontalSectionItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +} + +// Patch update the navigation property canvasLayout in sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutRequestBuilder) Patch(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CanvasLayoutable, requestConfiguration *ItemPagesItemCanvasLayoutRequestBuilderPatchRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CanvasLayoutable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateCanvasLayoutFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CanvasLayoutable), nil +} + +// VerticalSection provides operations to manage the verticalSection property of the microsoft.graph.canvasLayout entity. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutRequestBuilder) VerticalSection() *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder { + return NewItemPagesItemCanvasLayoutVerticalSectionRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_request_builder.go new file mode 100644 index 000000000..3fbb916ca --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_request_builder.go @@ -0,0 +1,226 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder provides operations to manage the verticalSection property of the microsoft.graph.canvasLayout entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderGetQueryParameters read the properties and relationships of a verticalSection object. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutVerticalSectionRequestBuilderInternal instantiates a new VerticalSectionRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutVerticalSectionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder { + m := &ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/verticalSection{?%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutVerticalSectionRequestBuilder instantiates a new VerticalSectionRequestBuilder and sets the default values. +// +//nolint:lll,revive,wsl +func NewItemPagesItemCanvasLayoutVerticalSectionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutVerticalSectionRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateDeleteRequestInformation delete navigation property verticalSection for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder) CreateDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreateGetRequestInformation read the properties and relationships of a verticalSection object. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePatchRequestInformation update the navigation property verticalSection in sites +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.VerticalSectionable, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Delete delete navigation property verticalSection for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get read the properties and relationships of a verticalSection object. +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/verticalsection-get?view=graph-rest-1.0 +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.VerticalSectionable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateVerticalSectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.VerticalSectionable), nil +} + +// Patch update the navigation property verticalSection in sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder) Patch(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.VerticalSectionable, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilderPatchRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.VerticalSectionable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateVerticalSectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.VerticalSectionable), nil +} + +// Webparts provides operations to manage the webparts property of the microsoft.graph.verticalSection entity. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder) Webparts() *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder { + return NewItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// WebpartsById provides operations to manage the webparts property of the microsoft.graph.verticalSection entity. +// +//nolint:lll,wsl,revive +func (m *ItemPagesItemCanvasLayoutVerticalSectionRequestBuilder) WebpartsById(id string) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.pathParameters { + urlTplParams[idx] = item + } + if id != "" { + urlTplParams["webPart%2Did"] = id + } + return NewItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_count_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_count_request_builder.go new file mode 100644 index 000000000..774c55f28 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_count_request_builder.go @@ -0,0 +1,107 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder provides operations to count the resources in the collection. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderGetQueryParameters get the number of the resource +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderGetQueryParameters +} + +// NewItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderInternal instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder { + m := &ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/verticalSection/webparts/$count{?%24search,%24filter}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:lll,wsl,revive +func NewItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation get the number of the resource +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "text/plain") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get get the number of the resource +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_item_get_position_of_web_part_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_item_get_position_of_web_part_request_builder.go new file mode 100644 index 000000000..d63ff729a --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_item_get_position_of_web_part_request_builder.go @@ -0,0 +1,97 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder provides operations to call the getPositionOfWebPart method. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilderInternal instantiates a new GetPositionOfWebPartRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder { + m := &ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/verticalSection/webparts/{webPart%2Did}/microsoft.graph.getPositionOfWebPart" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder instantiates a new GetPositionOfWebPartRequestBuilder and sets the default values. +// +//nolint:lll,wsl,revive +func NewItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreatePostRequestInformation invoke action getPositionOfWebPart +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder) CreatePostRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Post invoke action getPositionOfWebPart +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/webpart-getposition?view=graph-rest-1.0 +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder) Post(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartPositionable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartPositionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartPositionable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_request_builder.go new file mode 100644 index 000000000..bd1885be1 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_request_builder.go @@ -0,0 +1,177 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder provides operations to manage the webparts property of the microsoft.graph.verticalSection entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderGetQueryParameters the set of web parts in this section. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderGetQueryParameters struct { + // Include count of items + Count *bool `uriparametername:"%24count"` + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Order items by property values + Orderby []string `uriparametername:"%24orderby"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` + // Skip the first n items + Skip *int32 `uriparametername:"%24skip"` + // Show only the first n items + Top *int32 `uriparametername:"%24top"` +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderInternal instantiates a new WebpartsRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder { + m := &ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/verticalSection/webparts{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder instantiates a new WebpartsRequestBuilder and sets the default values. +// +//nolint:lll,wsl,revive +func NewItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder) Count() *ItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilder { + return NewItemPagesItemCanvasLayoutVerticalSectionWebpartsCountRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// CreateGetRequestInformation the set of web parts in this section. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePostRequestInformation create new navigation property to webparts for sites +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder) CreatePostRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get the set of web parts in this section. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartCollectionResponseable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartCollectionResponseable), nil +} + +// Post create new navigation property to webparts for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilder) Post(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_web_part_item_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_web_part_item_request_builder.go new file mode 100644 index 000000000..fdb5025c5 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_canvas_layout_vertical_section_webparts_web_part_item_request_builder.go @@ -0,0 +1,209 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder provides operations to manage the webparts property of the microsoft.graph.verticalSection entity. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderGetQueryParameters the set of web parts in this section. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderGetQueryParameters +} + +// ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderInternal instantiates a new WebPartItemRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder { + m := &ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/canvasLayout/verticalSection/webparts/{webPart%2Did}{?%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder instantiates a new WebPartItemRequestBuilder and sets the default values. +// +//nolint:lll,wsl,revive +func NewItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateDeleteRequestInformation delete navigation property webparts for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder) CreateDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreateGetRequestInformation the set of web parts in this section. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePatchRequestInformation update the navigation property webparts in sites +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Delete delete navigation property webparts for sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the set of web parts in this section. +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} + +// GetPositionOfWebPart provides operations to call the getPositionOfWebPart method. +// +//nolint:lll +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder) GetPositionOfWebPart() *ItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilder { + return NewItemPagesItemCanvasLayoutVerticalSectionWebpartsItemGetPositionOfWebPartRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// Patch update the navigation property webparts in sites +// +//nolint:lll,wsl +func (m *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilder) Patch(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemCanvasLayoutVerticalSectionWebpartsWebPartItemRequestBuilderPatchRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_post_request_body.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_post_request_body.go new file mode 100644 index 000000000..5150584d8 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_post_request_body.go @@ -0,0 +1,182 @@ +package sites + +import i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + +// ItemPagesItemGetWebPartsByPositionPostRequestBody provides operations to call the getWebPartsByPosition method. +// +//nolint:lll,revive +type ItemPagesItemGetWebPartsByPositionPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]interface{} + // The columnId property + columnId *float64 + // The horizontalSectionId property + horizontalSectionId *float64 + // The isInVerticalSection property + isInVerticalSection *bool + // The webPartIndex property + webPartIndex *float64 +} + +// NewItemPagesItemGetWebPartsByPositionPostRequestBody instantiates a new ItemPagesItemGetWebPartsByPositionPostRequestBody and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemGetWebPartsByPositionPostRequestBody() *ItemPagesItemGetWebPartsByPositionPostRequestBody { + m := &ItemPagesItemGetWebPartsByPositionPostRequestBody{} + m.SetAdditionalData(make(map[string]interface{})) + return m +} + +// CreateItemPagesItemGetWebPartsByPositionPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// +//nolint:lll +func CreateItemPagesItemGetWebPartsByPositionPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPagesItemGetWebPartsByPositionPostRequestBody(), nil +} + +// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// +//nolint:lll +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) GetAdditionalData() map[string]interface{} { + return m.additionalData +} + +// GetColumnId gets the columnId property value. The columnId property +// +//nolint:lll,revive +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) GetColumnId() *float64 { + return m.columnId +} + +// GetFieldDeserializers the deserialization information for the current model +// +//nolint:lll,wsl,revive +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["columnId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetColumnId(val) + } + return nil + } + res["horizontalSectionId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetHorizontalSectionId(val) + } + return nil + } + res["isInVerticalSection"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsInVerticalSection(val) + } + return nil + } + res["webPartIndex"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetWebPartIndex(val) + } + return nil + } + return res +} + +// GetHorizontalSectionId gets the horizontalSectionId property value. The horizontalSectionId property +// +//nolint:lll,revive +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) GetHorizontalSectionId() *float64 { + return m.horizontalSectionId +} + +// GetIsInVerticalSection gets the isInVerticalSection property value. The isInVerticalSection property +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) GetIsInVerticalSection() *bool { + return m.isInVerticalSection +} + +// GetWebPartIndex gets the webPartIndex property value. The webPartIndex property +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) GetWebPartIndex() *float64 { + return m.webPartIndex +} + +// Serialize serializes information the current object +// +//nolint:lll,wsl +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteFloat64Value("columnId", m.GetColumnId()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("horizontalSectionId", m.GetHorizontalSectionId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isInVerticalSection", m.GetIsInVerticalSection()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("webPartIndex", m.GetWebPartIndex()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// +//nolint:lll +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) SetAdditionalData(value map[string]interface{}) { + m.additionalData = value +} + +// SetColumnId sets the columnId property value. The columnId property +// +//nolint:lll,revive +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) SetColumnId(value *float64) { + m.columnId = value +} + +// SetHorizontalSectionId sets the horizontalSectionId property value. The horizontalSectionId property +// +//nolint:revive +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) SetHorizontalSectionId(value *float64) { + m.horizontalSectionId = value +} + +// SetIsInVerticalSection sets the isInVerticalSection property value. The isInVerticalSection property +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) SetIsInVerticalSection(value *bool) { + m.isInVerticalSection = value +} + +// SetWebPartIndex sets the webPartIndex property value. The webPartIndex property +func (m *ItemPagesItemGetWebPartsByPositionPostRequestBody) SetWebPartIndex(value *float64) { + m.webPartIndex = value +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_post_request_bodyable.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_post_request_bodyable.go new file mode 100644 index 000000000..9cad4e760 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_post_request_bodyable.go @@ -0,0 +1,17 @@ +package sites + +import i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + +// ItemPagesItemGetWebPartsByPositionPostRequestBodyable +type ItemPagesItemGetWebPartsByPositionPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnId() *float64 + GetHorizontalSectionId() *float64 + GetIsInVerticalSection() *bool + GetWebPartIndex() *float64 + SetColumnId(value *float64) + SetHorizontalSectionId(value *float64) + SetIsInVerticalSection(value *bool) + SetWebPartIndex(value *float64) +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_request_builder.go new file mode 100644 index 000000000..29ff2090b --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_request_builder.go @@ -0,0 +1,91 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemGetWebPartsByPositionRequestBuilder provides operations to call the getWebPartsByPosition method. +type ItemPagesItemGetWebPartsByPositionRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemGetWebPartsByPositionRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemGetWebPartsByPositionRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemGetWebPartsByPositionRequestBuilderInternal instantiates a new GetWebPartsByPositionRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemGetWebPartsByPositionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemGetWebPartsByPositionRequestBuilder { + m := &ItemPagesItemGetWebPartsByPositionRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/microsoft.graph.getWebPartsByPosition" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemGetWebPartsByPositionRequestBuilder instantiates a new GetWebPartsByPositionRequestBuilder and sets the default values. +// +//nolint:lll,wsl,revive +func NewItemPagesItemGetWebPartsByPositionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemGetWebPartsByPositionRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemGetWebPartsByPositionRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreatePostRequestInformation invoke action getWebPartsByPosition +// +//nolint:lll,wsl,errcheck +func (m *ItemPagesItemGetWebPartsByPositionRequestBuilder) CreatePostRequestInformation(ctx context.Context, body ItemPagesItemGetWebPartsByPositionPostRequestBodyable, requestConfiguration *ItemPagesItemGetWebPartsByPositionRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Post invoke action getWebPartsByPosition +// +//nolint:lll,wsl +func (m *ItemPagesItemGetWebPartsByPositionRequestBuilder) Post(ctx context.Context, body ItemPagesItemGetWebPartsByPositionPostRequestBodyable, requestConfiguration *ItemPagesItemGetWebPartsByPositionRequestBuilderPostRequestConfiguration) (ItemPagesItemGetWebPartsByPositionResponseable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, CreateItemPagesItemGetWebPartsByPositionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemPagesItemGetWebPartsByPositionResponseable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_response.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_response.go new file mode 100644 index 000000000..fa89d8855 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_response.go @@ -0,0 +1,89 @@ +package sites + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemGetWebPartsByPositionResponse provides operations to call the getWebPartsByPosition method. +type ItemPagesItemGetWebPartsByPositionResponse struct { + msmodel.BaseCollectionPaginationCountResponse + // The value property + value []ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable +} + +// NewItemPagesItemGetWebPartsByPositionResponse instantiates a new ItemPagesItemGetWebPartsByPositionResponse and sets the default values. +// +//nolint:wsl,lll +func NewItemPagesItemGetWebPartsByPositionResponse() *ItemPagesItemGetWebPartsByPositionResponse { + m := &ItemPagesItemGetWebPartsByPositionResponse{ + BaseCollectionPaginationCountResponse: *msmodel.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateItemPagesItemGetWebPartsByPositionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// +//nolint:lll +func CreateItemPagesItemGetWebPartsByPositionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPagesItemGetWebPartsByPositionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// +//nolint:lll,wsl +func (m *ItemPagesItemGetWebPartsByPositionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, len(val)) + for i, v := range val { + res[i] = v.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable) + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// +//nolint:lll +func (m *ItemPagesItemGetWebPartsByPositionResponse) GetValue() []ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable { + return m.value +} + +// Serialize serializes information the current object +// +//nolint:lll,wsl +func (m *ItemPagesItemGetWebPartsByPositionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +// +//nolint:lll +func (m *ItemPagesItemGetWebPartsByPositionResponse) SetValue(value []ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable) { + m.value = value +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_responseable.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_responseable.go new file mode 100644 index 000000000..f862929ab --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_get_web_parts_by_position_responseable.go @@ -0,0 +1,16 @@ +package sites + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesItemGetWebPartsByPositionResponseable +type ItemPagesItemGetWebPartsByPositionResponseable interface { + msmodel.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable + SetValue(value []ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable) +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_publish_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_publish_request_builder.go new file mode 100644 index 000000000..56197e940 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_publish_request_builder.go @@ -0,0 +1,82 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemPublishRequestBuilder provides operations to call the publish method. +type ItemPagesItemPublishRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// nolint:lll +// ItemPagesItemPublishRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPagesItemPublishRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// nolint:lll,wsl +// NewItemPagesItemPublishRequestBuilderInternal instantiates a new PublishRequestBuilder and sets the default values. +func NewItemPagesItemPublishRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemPublishRequestBuilder { + m := &ItemPagesItemPublishRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/microsoft.graph.publish" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemPublishRequestBuilder instantiates a new PublishRequestBuilder and sets the default values. +// +//nolint:lll,wsl,revive +func NewItemPagesItemPublishRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemPublishRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemPublishRequestBuilderInternal(urlParams, requestAdapter) +} + +// //nolint:wsl,revive,lll +// CreatePostRequestInformation invoke action publish +func (m *ItemPagesItemPublishRequestBuilder) CreatePostRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemPublishRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// //nolint:wsl,revive,lll +// Post invoke action publish +func (m *ItemPagesItemPublishRequestBuilder) Post(ctx context.Context, requestConfiguration *ItemPagesItemPublishRequestBuilderPostRequestConfiguration) error { + requestInfo, err := m.CreatePostRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_count_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_count_request_builder.go new file mode 100644 index 000000000..57c875179 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_count_request_builder.go @@ -0,0 +1,103 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemWebPartsCountRequestBuilder provides operations to count the resources in the collection. +type ItemPagesItemWebPartsCountRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemWebPartsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemPagesItemWebPartsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` +} + +// ItemPagesItemWebPartsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemWebPartsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemWebPartsCountRequestBuilderGetQueryParameters +} + +// NewItemPagesItemWebPartsCountRequestBuilderInternal instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesItemWebPartsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemWebPartsCountRequestBuilder { + m := &ItemPagesItemWebPartsCountRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/webParts/$count{?%24search,%24filter}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemWebPartsCountRequestBuilder instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesItemWebPartsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemWebPartsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemWebPartsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation get the number of the resource +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsCountRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "text/plain") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get get the number of the resource +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_item_get_position_of_web_part_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_item_get_position_of_web_part_request_builder.go new file mode 100644 index 000000000..4bb325673 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_item_get_position_of_web_part_request_builder.go @@ -0,0 +1,96 @@ +package sites + +import ( + "context" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder provides operations to call the getPositionOfWebPart method. +// +//nolint:lll +type ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilderInternal instantiates a new GetPositionOfWebPartRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder { + m := &ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/webParts/{webPart%2Did}/microsoft.graph.getPositionOfWebPart" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder instantiates a new GetPositionOfWebPartRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreatePostRequestInformation invoke action getPositionOfWebPart +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder) CreatePostRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Post invoke action getPositionOfWebPart +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/webpart-getposition?view=graph-rest-1.0 +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder) Post(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartPositionable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartPositionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartPositionable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_request_builder.go new file mode 100644 index 000000000..0e349df74 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_request_builder.go @@ -0,0 +1,172 @@ +package sites + +import ( + "context" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemWebPartsRequestBuilder provides operations to manage the webParts property of the microsoft.graph.sitePage entity. +// +//nolint:lll +type ItemPagesItemWebPartsRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemWebPartsRequestBuilderGetQueryParameters collection of webparts on the SharePoint page +type ItemPagesItemWebPartsRequestBuilderGetQueryParameters struct { + // Include count of items + Count *bool `uriparametername:"%24count"` + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Order items by property values + Orderby []string `uriparametername:"%24orderby"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` + // Skip the first n items + Skip *int32 `uriparametername:"%24skip"` + // Show only the first n items + Top *int32 `uriparametername:"%24top"` +} + +// ItemPagesItemWebPartsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemWebPartsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemWebPartsRequestBuilderGetQueryParameters +} + +// ItemPagesItemWebPartsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesItemWebPartsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemWebPartsRequestBuilderInternal instantiates a new WebPartsRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewItemPagesItemWebPartsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemWebPartsRequestBuilder { + m := &ItemPagesItemWebPartsRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/webParts{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemWebPartsRequestBuilder instantiates a new WebPartsRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesItemWebPartsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemWebPartsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemWebPartsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +func (m *ItemPagesItemWebPartsRequestBuilder) Count() *ItemPagesItemWebPartsCountRequestBuilder { + return NewItemPagesItemWebPartsCountRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// CreateGetRequestInformation collection of webparts on the SharePoint page +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePostRequestInformation create new navigation property to webParts for sites +// +//nolint:wsl,revive,lll,errcheck +func (m *ItemPagesItemWebPartsRequestBuilder) CreatePostRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemWebPartsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get collection of webparts on the SharePoint page +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartCollectionResponseable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartCollectionResponseable), nil +} + +// Post create new navigation property to webParts for sites +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsRequestBuilder) Post(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemWebPartsRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_web_part_item_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_web_part_item_request_builder.go new file mode 100644 index 000000000..25dba98cf --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_item_web_parts_web_part_item_request_builder.go @@ -0,0 +1,209 @@ +package sites + +import ( + "context" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesItemWebPartsWebPartItemRequestBuilder provides operations to manage the webParts property of the microsoft.graph.sitePage entity. +// +//nolint:wsl,revive,lll +type ItemPagesItemWebPartsWebPartItemRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesItemWebPartsWebPartItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:wsl,revive,lll +type ItemPagesItemWebPartsWebPartItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPagesItemWebPartsWebPartItemRequestBuilderGetQueryParameters collection of webparts on the SharePoint page +// +//nolint:wsl,revive,lll +type ItemPagesItemWebPartsWebPartItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemPagesItemWebPartsWebPartItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:wsl,revive,lll +type ItemPagesItemWebPartsWebPartItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesItemWebPartsWebPartItemRequestBuilderGetQueryParameters +} + +// ItemPagesItemWebPartsWebPartItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:wsl,revive,lll +type ItemPagesItemWebPartsWebPartItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesItemWebPartsWebPartItemRequestBuilderInternal instantiates a new WebPartItemRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesItemWebPartsWebPartItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemWebPartsWebPartItemRequestBuilder { + m := &ItemPagesItemWebPartsWebPartItemRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}/webParts/{webPart%2Did}{?%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesItemWebPartsWebPartItemRequestBuilder instantiates a new WebPartItemRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesItemWebPartsWebPartItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesItemWebPartsWebPartItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesItemWebPartsWebPartItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateDeleteRequestInformation delete navigation property webParts for sites +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsWebPartItemRequestBuilder) CreateDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsWebPartItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreateGetRequestInformation collection of webparts on the SharePoint page +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsWebPartItemRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsWebPartItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePatchRequestInformation update the navigation property webParts in sites +// +//nolint:wsl,revive,lll,errcheck +func (m *ItemPagesItemWebPartsWebPartItemRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemWebPartsWebPartItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Delete delete navigation property webParts for sites +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsWebPartItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsWebPartItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get collection of webparts on the SharePoint page +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsWebPartItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesItemWebPartsWebPartItemRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} + +// GetPositionOfWebPart provides operations to call the getPositionOfWebPart method. +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsWebPartItemRequestBuilder) GetPositionOfWebPart() *ItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilder { + return NewItemPagesItemWebPartsItemGetPositionOfWebPartRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// Patch update the navigation property webParts in sites +// +//nolint:wsl,revive,lll +func (m *ItemPagesItemWebPartsWebPartItemRequestBuilder) Patch(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, requestConfiguration *ItemPagesItemWebPartsWebPartItemRequestBuilderPatchRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateWebPartFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.WebPartable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_request_builder.go new file mode 100644 index 000000000..43f503439 --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_request_builder.go @@ -0,0 +1,176 @@ +package sites + +import ( + "context" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemPagesRequestBuilder provides operations to manage the pages property of the microsoft.graph.site entity. +type ItemPagesRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesRequestBuilderGetQueryParameters get the collection of [sitePage][] objects from the site pages [list][] in a site [site][]. All pages in the site are returned (with pagination). Sort alphabetically by `name` in ascending order. +// +//nolint:lll +type ItemPagesRequestBuilderGetQueryParameters struct { + // Include count of items + Count *bool `uriparametername:"%24count"` + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Order items by property values + Orderby []string `uriparametername:"%24orderby"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` + // Skip the first n items + Skip *int32 `uriparametername:"%24skip"` + // Show only the first n items + Top *int32 `uriparametername:"%24top"` +} + +// ItemPagesRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:wsl,revive,lll +type ItemPagesRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesRequestBuilderGetQueryParameters +} + +// ItemPagesRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:wsl,revive,lll +type ItemPagesRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPagesRequestBuilderInternal instantiates a new PagesRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesRequestBuilder { + m := &ItemPagesRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesRequestBuilder instantiates a new PagesRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +func (m *ItemPagesRequestBuilder) Count() *ItemPagesCountRequestBuilder { + return NewItemPagesCountRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// CreateGetRequestInformation get the collection of [sitePage][] objects from the site pages [list][] in a site [site][]. All pages in the site are returned (with pagination). Sort alphabetically by `name` in ascending order. +// +//nolint:wsl,revive,lll +func (m *ItemPagesRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePostRequestInformation create a new [sitePage][] in the site pages [list][] in a [site][]. +// +//nolint:errcheck,lll,wsl +func (m *ItemPagesRequestBuilder) CreatePostRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable, requestConfiguration *ItemPagesRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get get the collection of [sitePage][] objects from the site pages [list][] in a site [site][]. All pages in the site are returned (with pagination). Sort alphabetically by `name` in ascending order. +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/sitepage-list?view=graph-rest-1.0 +// //nolint:wsl,revive,lll +func (m *ItemPagesRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageCollectionResponseable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateSitePageCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageCollectionResponseable), nil +} + +// Post create a new [sitePage][] in the site pages [list][] in a [site][]. +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/sitepage-create?view=graph-rest-1.0 +// nolint:wsl,revive,lll +func (m *ItemPagesRequestBuilder) Post(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable, requestConfiguration *ItemPagesRequestBuilderPostRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable, error) { + requestInfo, err := m.CreatePostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateSitePageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_pages_site_page_item_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_pages_site_page_item_request_builder.go new file mode 100644 index 000000000..29fda72bd --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_pages_site_page_item_request_builder.go @@ -0,0 +1,237 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" + + ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354 "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" +) + +// ItemPagesSitePageItemRequestBuilder provides operations to manage the pages property of the microsoft.graph.site entity. +// +//nolint:lll +type ItemPagesSitePageItemRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemPagesSitePageItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesSitePageItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPagesSitePageItemRequestBuilderGetQueryParameters the collection of pages in the SitePages list in this site. +type ItemPagesSitePageItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemPagesSitePageItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemPagesSitePageItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPagesSitePageItemRequestBuilderGetQueryParameters +} + +// ItemPagesSitePageItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:wsl,revive,lll +type ItemPagesSitePageItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// CanvasLayout provides operations to manage the canvasLayout property of the microsoft.graph.sitePage entity. +func (m *ItemPagesSitePageItemRequestBuilder) CanvasLayout() *ItemPagesItemCanvasLayoutRequestBuilder { + return NewItemPagesItemCanvasLayoutRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// NewItemPagesSitePageItemRequestBuilderInternal instantiates a new SitePageItemRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesSitePageItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesSitePageItemRequestBuilder { + m := &ItemPagesSitePageItemRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/pages/{sitePage%2Did}{?%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemPagesSitePageItemRequestBuilder instantiates a new SitePageItemRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemPagesSitePageItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPagesSitePageItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPagesSitePageItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateDeleteRequestInformation delete navigation property pages for sites +// +//nolint:wsl,revive,lll +func (m *ItemPagesSitePageItemRequestBuilder) CreateDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPagesSitePageItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreateGetRequestInformation the collection of pages in the SitePages list in this site. +// +//nolint:wsl,revive,lll +func (m *ItemPagesSitePageItemRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemPagesSitePageItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePatchRequestInformation update the navigation property pages in sites +// +//nolint:errcheck,lll,wsl +func (m *ItemPagesSitePageItemRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable, requestConfiguration *ItemPagesSitePageItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Delete delete navigation property pages for sites +// +//nolint:wsl,revive,lll +func (m *ItemPagesSitePageItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPagesSitePageItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.CreateDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the collection of pages in the SitePages list in this site. +// +//nolint:wsl,revive,lll +func (m *ItemPagesSitePageItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPagesSitePageItemRequestBuilderGetRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateSitePageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable), nil +} + +// GetWebPartsByPosition provides operations to call the getWebPartsByPosition method. +// +//nolint:wsl,revive,lll +func (m *ItemPagesSitePageItemRequestBuilder) GetWebPartsByPosition() *ItemPagesItemGetWebPartsByPositionRequestBuilder { + return NewItemPagesItemGetWebPartsByPositionRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// Patch update the navigation property pages in sites +// +//nolint:wsl,revive,lll +func (m *ItemPagesSitePageItemRequestBuilder) Patch(ctx context.Context, body ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable, requestConfiguration *ItemPagesSitePageItemRequestBuilderPatchRequestConfiguration) (ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.CreateSitePageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ifda19816f54f079134d70c11e75d6b26799300cf72079e282f1d3bb9a6750354.SitePageable), nil +} + +// Publish provides operations to call the publish method. +func (m *ItemPagesSitePageItemRequestBuilder) Publish() *ItemPagesItemPublishRequestBuilder { + return NewItemPagesItemPublishRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// WebParts provides operations to manage the webParts property of the microsoft.graph.sitePage entity. +func (m *ItemPagesSitePageItemRequestBuilder) WebParts() *ItemPagesItemWebPartsRequestBuilder { + return NewItemPagesItemWebPartsRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// WebPartsById provides operations to manage the webParts property of the microsoft.graph.sitePage entity. +// +//nolint:revive,wsl +func (m *ItemPagesSitePageItemRequestBuilder) WebPartsById(id string) *ItemPagesItemWebPartsWebPartItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.pathParameters { + urlTplParams[idx] = item + } + if id != "" { + urlTplParams["webPart%2Did"] = id + } + return NewItemPagesItemWebPartsWebPartItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +} diff --git a/src/internal/connector/graph/betasdk/sites/item_sites_count_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_sites_count_request_builder.go new file mode 100644 index 000000000..5a83c959c --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_sites_count_request_builder.go @@ -0,0 +1,103 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemSitesCountRequestBuilder provides operations to count the resources in the collection. +type ItemSitesCountRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemSitesCountRequestBuilderGetQueryParameters get the number of the resource +type ItemSitesCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string `uriparametername:"%24filter"` + // Search items by search phrases + Search *string `uriparametername:"%24search"` +} + +// ItemSitesCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemSitesCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemSitesCountRequestBuilderGetQueryParameters +} + +// NewItemSitesCountRequestBuilderInternal instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:wsl,lll +func NewItemSitesCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemSitesCountRequestBuilder { + m := &ItemSitesCountRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/sites/$count{?%24search,%24filter}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemSitesCountRequestBuilder instantiates a new CountRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemSitesCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemSitesCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSitesCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation get the number of the resource +// +//nolint:wsl,revive,lll +func (m *ItemSitesCountRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemSitesCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "text/plain") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get get the number of the resource +// +//nolint:wsl,revive,lll +func (m *ItemSitesCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemSitesCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/item_sites_site_item_request_builder.go b/src/internal/connector/graph/betasdk/sites/item_sites_site_item_request_builder.go new file mode 100644 index 000000000..c5959b0ff --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/item_sites_site_item_request_builder.go @@ -0,0 +1,104 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// ItemSitesSiteItemRequestBuilder provides operations to manage the sites property of the microsoft.graph.site entity. +type ItemSitesSiteItemRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// ItemSitesSiteItemRequestBuilderGetQueryParameters the collection of the sub-sites under this site. +type ItemSitesSiteItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// ItemSitesSiteItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type ItemSitesSiteItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemSitesSiteItemRequestBuilderGetQueryParameters +} + +// NewItemSitesSiteItemRequestBuilderInternal instantiates a new SiteItemRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemSitesSiteItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemSitesSiteItemRequestBuilder { + m := &ItemSitesSiteItemRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}/sites/{site%2Did1}{?%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewItemSitesSiteItemRequestBuilder instantiates a new SiteItemRequestBuilder and sets the default values. +// +//nolint:wsl,revive,lll +func NewItemSitesSiteItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemSitesSiteItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSitesSiteItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// CreateGetRequestInformation the collection of the sub-sites under this site. +// +//nolint:wsl,revive,lll +func (m *ItemSitesSiteItemRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *ItemSitesSiteItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// Get the collection of the sub-sites under this site. +// +//nolint:wsl,revive,lll +func (m *ItemSitesSiteItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemSitesSiteItemRequestBuilderGetRequestConfiguration) (msmodel.Siteable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, msmodel.CreateSiteFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(msmodel.Siteable), nil +} diff --git a/src/internal/connector/graph/betasdk/sites/site_item_request_builder.go b/src/internal/connector/graph/betasdk/sites/site_item_request_builder.go new file mode 100644 index 000000000..3746a736c --- /dev/null +++ b/src/internal/connector/graph/betasdk/sites/site_item_request_builder.go @@ -0,0 +1,249 @@ +package sites + +import ( + "context" + + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + msmodel "github.com/microsoftgraph/msgraph-sdk-go/models" + i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0 "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" +) + +// SiteItemRequestBuilder provides operations to manage the collection of site entities. +type SiteItemRequestBuilder struct { + // Path parameters for the request + pathParameters map[string]string + // The request adapter to use to execute the requests. + requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter + // Url template to use to build the URL for the current request builder + urlTemplate string +} + +// SiteItemRequestBuilderGetQueryParameters retrieve properties and relationships for a [site][] resource.A **site** resource represents a team site in SharePoint. +// +//nolint:lll +type SiteItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string `uriparametername:"%24expand"` + // Select properties to be returned + Select []string `uriparametername:"%24select"` +} + +// SiteItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type SiteItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *SiteItemRequestBuilderGetQueryParameters +} + +// SiteItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +// +//nolint:lll +type SiteItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// Analytics provides operations to manage the analytics property of the microsoft.graph.site entity. +// REMOVED Analytics for minimial + +// Columns provides operations to manage the columns property of the microsoft.graph.site entity. + +// ColumnsById provides operations to manage the columns property of the microsoft.graph.site entity. + +// NewSiteItemRequestBuilderInternal instantiates a new SiteItemRequestBuilder and sets the default values. +// +//nolint:lll,wsl +func NewSiteItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *SiteItemRequestBuilder { + m := &SiteItemRequestBuilder{} + m.urlTemplate = "{+baseurl}/sites/{site%2Did}{?%24select,%24expand}" + urlTplParams := make(map[string]string) + for idx, item := range pathParameters { + urlTplParams[idx] = item + } + m.pathParameters = urlTplParams + m.requestAdapter = requestAdapter + return m +} + +// NewSiteItemRequestBuilder instantiates a new SiteItemRequestBuilder and sets the default values. +// +//nolint:lll,revive,wsl +func NewSiteItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *SiteItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSiteItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// ContentTypes provides operations to manage the contentTypes property of the microsoft.graph.site entity. + +// ContentTypesById provides operations to manage the contentTypes property of the microsoft.graph.site entity. +// CreateGetRequestInformation retrieve properties and relationships for a [site][] resource.A **site** resource represents a team site in SharePoint. +// +//nolint:lll,wsl +func (m *SiteItemRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *SiteItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET + requestInfo.Headers.Add("Accept", "application/json") + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + return requestInfo, nil +} + +// CreatePatchRequestInformation update entity in sites by key (id) +// +//nolint:lll,errcheck,wsl +func (m *SiteItemRequestBuilder) CreatePatchRequestInformation(ctx context.Context, body msmodel.Siteable, requestConfiguration *SiteItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation() + requestInfo.UrlTemplate = m.urlTemplate + requestInfo.PathParameters = m.pathParameters + requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH + requestInfo.Headers.Add("Accept", "application/json") + requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body) + + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + + return requestInfo, nil +} + +// Drive provides operations to manage the drive property of the microsoft.graph.site entity. +// Removed Drive() for minimial connector + +// Drives provides operations to manage the drives property of the microsoft.graph.site entity. +// Removed Drives() + +// DrivesById provides operations to manage the drives property of the microsoft.graph.site entity. + +// ExternalColumns provides operations to manage the externalColumns property of the microsoft.graph.site entity. + +// // ExternalColumnsById provides operations to manage the externalColumns property of the microsoft.graph.site entity. +// +// func (m *SiteItemRequestBuilder) ExternalColumnsById(id string) *ItemExternalColumnsColumnDefinitionItemRequestBuilder { +// urlTplParams := make(map[string]string) +// for idx, item := range m.pathParameters { +// urlTplParams[idx] = item +// } +// if id != "" { +// urlTplParams["columnDefinition%2Did"] = id +// } +// return NewItemExternalColumnsColumnDefinitionItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +// } +// +// Get retrieve properties and relationships for a [site][] resource.A **site** resource represents a team site in SharePoint. +// [Find more info here] +// +// [Find more info here]: https://docs.microsoft.com/graph/api/site-get?view=graph-rest-1.0 +// +//nolint:wsl,revive,lll +func (m *SiteItemRequestBuilder) Get(ctx context.Context, requestConfiguration *SiteItemRequestBuilderGetRequestConfiguration) (msmodel.Siteable, error) { + requestInfo, err := m.CreateGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, msmodel.CreateSiteFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(msmodel.Siteable), nil +} + +//nolint:lll +// GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval provides operations to call the getActivitiesByInterval method. +// GetApplicableContentTypesForListWithListId provides operations to call the getApplicableContentTypesForList method. +// GetByPathWithPath provides operations to call the getByPath method. +// InformationProtection provides operations to manage the informationProtection property of the microsoft.graph.site entity. +// Items provides operations to manage the items property of the microsoft.graph.site entity. +// ItemsById provides operations to manage the items property of the microsoft.graph.site entity. +// Lists provides operations to manage the lists property of the microsoft.graph.site entity. +// ListsById provides operations to manage the lists property of the microsoft.graph.site entity. +// Onenote provides operations to manage the onenote property of the microsoft.graph.site entity. +// Operations provides operations to manage the operations property of the microsoft.graph.site entity. +// OperationsById provides operations to manage the operations property of the microsoft.graph.site entity. + +// Pages provides operations to manage the pages property of the microsoft.graph.site entity. +func (m *SiteItemRequestBuilder) Pages() *ItemPagesRequestBuilder { + return NewItemPagesRequestBuilderInternal(m.pathParameters, m.requestAdapter) +} + +// PagesById provides operations to manage the pages property of the microsoft.graph.site entity. +// +//nolint:revive,wsl +func (m *SiteItemRequestBuilder) PagesById(id string) *ItemPagesSitePageItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.pathParameters { + urlTplParams[idx] = item + } + if id != "" { + urlTplParams["sitePage%2Did"] = id + } + return NewItemPagesSitePageItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +} + +// Patch update entity in sites by key (id) +// +//nolint:wsl,revive,lll +func (m *SiteItemRequestBuilder) Patch( + ctx context.Context, + body msmodel.Siteable, + requestConfiguration *SiteItemRequestBuilderPatchRequestConfiguration, +) (msmodel.Siteable, error) { + requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "4XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + "5XX": i7ad325c11fbf3db4d761c429267362d8b24daa1eda0081f914ebc3cdc85181a0.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.requestAdapter.Send(ctx, requestInfo, msmodel.CreateSiteFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(msmodel.Siteable), nil +} + +// Permissions provides operations to manage the permissions property of the microsoft.graph.site entity. +// PermissionsById provides operations to manage the permissions property of the microsoft.graph.site entity. +// Sites provides operations to manage the sites property of the microsoft.graph.site entity. +// func (m *SiteItemRequestBuilder) Sites() +// SitesById provides operations to manage the sites property of the microsoft.graph.site entity. +// +//nolint:revive,wsl +func (m *SiteItemRequestBuilder) SitesById(id string) *ItemSitesSiteItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.pathParameters { + urlTplParams[idx] = item + } + if id != "" { + urlTplParams["site%2Did1"] = id + } + return NewItemSitesSiteItemRequestBuilderInternal(urlTplParams, m.requestAdapter) +} + +// TermStore provides operations to manage the termStore property of the microsoft.graph.site entity. diff --git a/src/internal/connector/graph_connector_helper_test.go b/src/internal/connector/graph_connector_helper_test.go index ce16a5a4d..698ee8527 100644 --- a/src/internal/connector/graph_connector_helper_test.go +++ b/src/internal/connector/graph_connector_helper_test.go @@ -336,12 +336,12 @@ func checkContact( testEmptyOrEqual(t, expected.GetAssistantName(), got.GetAssistantName(), "AssistantName") testEmptyOrEqual(t, expected.GetBirthday(), got.GetBirthday(), "Birthday") - - assert.Equal(t, expected.GetBusinessAddress(), got.GetBusinessAddress()) - - testEmptyOrEqual(t, expected.GetBusinessHomePage(), got.GetBusinessHomePage(), "BusinessHomePage") - - assert.Equal(t, expected.GetBusinessPhones(), got.GetBusinessPhones()) + // Not present in msgraph-beta-sdk/models + // assert.Equal(t, expected.GetBusinessAddress(), got.GetBusinessAddress()) + // Not present in msgraph-beta-sdk/models + // testEmptyOrEqual(t, expected.GetBusinessHomePage(), got.GetBusinessHomePage(), "BusinessHomePage") + // Not present in msgraph-beta-sdk/models + // assert.Equal(t, expected.GetBusinessPhones(), got.GetBusinessPhones()) assert.Equal(t, expected.GetCategories(), got.GetCategories()) @@ -365,9 +365,10 @@ func checkContact( testEmptyOrEqual(t, expected.GetGivenName(), got.GetGivenName(), "GivenName") - assert.Equal(t, expected.GetHomeAddress(), got.GetHomeAddress()) - - assert.Equal(t, expected.GetHomePhones(), got.GetHomePhones()) + // Not present in msgraph-beta-sdk/models + // assert.Equal(t, expected.GetHomeAddress(), got.GetHomeAddress()) + // Not present in msgraph-beta-sdk/models + // assert.Equal(t, expected.GetHomePhones(), got.GetHomePhones()) // Skip CreatedDateTime as it's tied to this specific instance of the item. @@ -383,13 +384,14 @@ func checkContact( testEmptyOrEqual(t, expected.GetMiddleName(), got.GetMiddleName(), "MiddleName") - testEmptyOrEqual(t, expected.GetMobilePhone(), got.GetMobilePhone(), "MobilePhone") + // Not present in msgraph-beta-sdk/models + // testEmptyOrEqual(t, expected.GetMobilePhone(), got.GetMobilePhone(), "MobilePhone") testEmptyOrEqual(t, expected.GetNickName(), got.GetNickName(), "NickName") testEmptyOrEqual(t, expected.GetOfficeLocation(), got.GetOfficeLocation(), "OfficeLocation") - - assert.Equal(t, expected.GetOtherAddress(), got.GetOtherAddress()) + // Not present in msgraph-beta-sdk/models + // assert.Equal(t, expected.GetOtherAddress(), got.GetOtherAddress()) // Skip ParentFolderId as it's tied to this specific instance of the item. diff --git a/src/internal/connector/sharepoint/pageInfo.go b/src/internal/connector/sharepoint/pageInfo.go index 2c11863cb..40fd69404 100644 --- a/src/internal/connector/sharepoint/pageInfo.go +++ b/src/internal/connector/sharepoint/pageInfo.go @@ -3,13 +3,14 @@ package sharepoint import ( "time" + "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" "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 { +func sharePointPageInfo(page models.SitePageable, size int64) *details.SharePointInfo { var ( name, webURL string created, modified time.Time diff --git a/src/internal/connector/sharepoint/pageInfo_test.go b/src/internal/connector/sharepoint/pageInfo_test.go index 6ea070fbe..81b9f27fb 100644 --- a/src/internal/connector/sharepoint/pageInfo_test.go +++ b/src/internal/connector/sharepoint/pageInfo_test.go @@ -5,26 +5,27 @@ import ( "github.com/stretchr/testify/assert" + "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" "github.com/alcionai/corso/src/pkg/backup/details" ) func (suite *SharePointInfoSuite) TestSharePointInfo_Pages() { tests := []struct { name string - pageAndDeets func() (SitePageable, *details.SharePointInfo) + pageAndDeets func() (models.SitePageable, *details.SharePointInfo) }{ { name: "Empty Page", - pageAndDeets: func() (SitePageable, *details.SharePointInfo) { + pageAndDeets: func() (models.SitePageable, *details.SharePointInfo) { deets := &details.SharePointInfo{ItemType: details.SharePointItem} - return NewSitePage(), deets + return models.NewSitePage(), deets }, }, { name: "Only Name", - pageAndDeets: func() (SitePageable, *details.SharePointInfo) { + pageAndDeets: func() (models.SitePageable, *details.SharePointInfo) { title := "Blank Page" - sPage := NewSitePage() + sPage := models.NewSitePage() sPage.SetTitle(&title) deets := &details.SharePointInfo{ ItemType: details.SharePointItem, diff --git a/src/internal/connector/sharepoint/site_page.go b/src/internal/connector/sharepoint/site_page.go deleted file mode 100644 index 56bf7ad27..000000000 --- a/src/internal/connector/sharepoint/site_page.go +++ /dev/null @@ -1,187 +0,0 @@ -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 -} diff --git a/src/internal/connector/sharepoint/site_pageable.go b/src/internal/connector/sharepoint/site_pageable.go deleted file mode 100644 index d0626321b..000000000 --- a/src/internal/connector/sharepoint/site_pageable.go +++ /dev/null @@ -1,24 +0,0 @@ -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) -} From c270536f731472ab24ab7a74f6a16ade6f421367 Mon Sep 17 00:00:00 2001 From: Keepers Date: Tue, 31 Jan 2023 13:21:01 -0700 Subject: [PATCH 34/36] add version to clues, log cli command and flags (#2331) ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :broom: Tech Debt/Cleanup ## Issue(s) * #2329 ## Test Plan - [x] :muscle: Manual --- src/cli/cli.go | 28 +++++++++++++++++++++++++--- src/cli/config/config.go | 24 +++++++++++------------- src/go.mod | 4 ++-- src/internal/version/version.go | 26 ++++++++++++++++++++++++++ src/pkg/logger/logger.go | 3 ++- 5 files changed, 66 insertions(+), 19 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index f06354f0b..b67663d06 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -15,6 +15,7 @@ import ( "github.com/alcionai/corso/src/cli/print" "github.com/alcionai/corso/src/cli/repo" "github.com/alcionai/corso/src/cli/restore" + "github.com/alcionai/corso/src/cli/utils" "github.com/alcionai/corso/src/internal/observe" "github.com/alcionai/corso/src/internal/version" "github.com/alcionai/corso/src/pkg/logger" @@ -31,7 +32,27 @@ var corsoCmd = &cobra.Command{ Short: "Free, Secure, Open-Source Backup for M365.", Long: `Free, Secure, and Open-Source Backup for Microsoft 365.`, RunE: handleCorsoCmd, - PersistentPreRunE: config.InitFunc(), + PersistentPreRunE: preRun, +} + +func preRun(cc *cobra.Command, args []string) error { + if err := config.InitFunc(cc, args); err != nil { + return err + } + + log := logger.Ctx(cc.Context()) + + flags := utils.GetPopulatedFlags(cc) + flagSl := make([]string, 0, len(flags)) + + // currently only tracking flag names to avoid pii leakage. + for f := range flags { + flagSl = append(flagSl, f) + } + + log.Infow("cli command", "command", cc.CommandPath(), "flags", flagSl, "version", version.CurrentVersion()) + + return nil } // Handler for flat calls to `corso`. @@ -39,7 +60,7 @@ var corsoCmd = &cobra.Command{ func handleCorsoCmd(cmd *cobra.Command, args []string) error { v, _ := cmd.Flags().GetBool("version") if v { - print.Outf(cmd.Context(), "Corso version: "+version.Version) + print.Outf(cmd.Context(), "Corso version: "+version.CurrentVersion()) return nil } @@ -62,7 +83,7 @@ func BuildCommandTree(cmd *cobra.Command) { cmd.PersistentFlags().SortFlags = false cmd.Flags().BoolP("version", "v", false, "current version info") - cmd.PersistentPostRunE = config.InitFunc() + cmd.PersistentPreRunE = preRun config.AddConfigFlags(cmd) logger.AddLoggingFlags(cmd) observe.AddProgressBarFlags(cmd) @@ -85,6 +106,7 @@ func BuildCommandTree(cmd *cobra.Command) { // Handle builds and executes the cli processor. func Handle() { + //nolint:forbidigo ctx := config.Seed(context.Background()) ctx = print.SetRootCmd(ctx, corsoCmd) observe.SeedWriter(ctx, print.StderrWriter(ctx), observe.PreloadFlags()) diff --git a/src/cli/config/config.go b/src/cli/config/config.go index dbcd21422..8f532abb6 100644 --- a/src/cli/config/config.go +++ b/src/cli/config/config.go @@ -77,20 +77,18 @@ func AddConfigFlags(cmd *cobra.Command) { // InitFunc provides a func that lazily initializes viper and // verifies that the configuration was able to read a file. -func InitFunc() func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - fp := configFilePathFlag - if len(fp) == 0 || fp == displayDefaultFP { - fp = configFilePath - } - - err := initWithViper(GetViper(cmd.Context()), fp) - if err != nil { - return err - } - - return Read(cmd.Context()) +func InitFunc(cmd *cobra.Command, args []string) error { + fp := configFilePathFlag + if len(fp) == 0 || fp == displayDefaultFP { + fp = configFilePath } + + err := initWithViper(GetViper(cmd.Context()), fp) + if err != nil { + return err + } + + return Read(cmd.Context()) } // initWithViper implements InitConfig, but takes in a viper diff --git a/src/go.mod b/src/go.mod index 1b05ec06b..a8054ab0e 100644 --- a/src/go.mod +++ b/src/go.mod @@ -13,6 +13,7 @@ require ( github.com/microsoft/kiota-abstractions-go v0.16.0 github.com/microsoft/kiota-authentication-azure-go v0.6.0 github.com/microsoft/kiota-http-go v0.13.0 + github.com/microsoft/kiota-serialization-form-go v0.2.0 github.com/microsoft/kiota-serialization-json-go v0.7.2 github.com/microsoftgraph/msgraph-sdk-go v0.53.0 github.com/microsoftgraph/msgraph-sdk-go-core v0.33.0 @@ -40,7 +41,6 @@ require ( github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/microsoft/kiota-serialization-form-go v0.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/spf13/afero v1.9.3 // indirect @@ -84,7 +84,7 @@ require ( github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect - github.com/microsoft/kiota-serialization-text-go v0.6.0 // indirect + github.com/microsoft/kiota-serialization-text-go v0.6.0 github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/minio-go/v7 v7.0.45 // indirect github.com/minio/sha256-simd v1.0.0 // indirect diff --git a/src/internal/version/version.go b/src/internal/version/version.go index 4a07d07ba..6b1859a80 100644 --- a/src/internal/version/version.go +++ b/src/internal/version/version.go @@ -1,3 +1,29 @@ package version +import ( + "os/exec" + "strings" +) + var Version = "dev" + +func CurrentVersion() string { + if len(Version) == 0 || Version == "dev" { + c, b := exec.Command("git", "describe", "--tag"), new(strings.Builder) + c.Stdout = b + + if err := c.Run(); err != nil { + return "dev" + } + + s := strings.TrimRight(b.String(), "\n") + + if len(s) != 0 { + return "dev-" + s + } + + return "dev" + } + + return Version +} diff --git a/src/pkg/logger/logger.go b/src/pkg/logger/logger.go index f64febe2e..0d5ffe250 100644 --- a/src/pkg/logger/logger.go +++ b/src/pkg/logger/logger.go @@ -6,6 +6,7 @@ import ( "path/filepath" "time" + "github.com/alcionai/clues" "github.com/spf13/cobra" "github.com/spf13/pflag" "go.uber.org/zap" @@ -264,7 +265,7 @@ func Ctx(ctx context.Context) *zap.SugaredLogger { return singleton(levelOf(llFlag), defaultLogLocation()) } - return l.(*zap.SugaredLogger) + return l.(*zap.SugaredLogger).With(clues.Slice(ctx)...) } // transforms the llevel flag value to a logLevel enum From 013eeab7cb7a872c50b181811b05d2fe339ecf72 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 31 Jan 2023 15:46:31 -0500 Subject: [PATCH 35/36] GC: Add Service to `graph/betasdk` package (#2298) ## Description Creates Beta Service for betasdk package. Abstraction loosely complies with the methods found in `graph.Servicer()`. Will aid when Sharepoint functionality is supported in v1.0 and `betasdk` package is removed. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :sunflower: Feature ## Issue(s) - related to * #2174 ## Test Plan - [x] :muscle: Manual --- .../connector/discovery/api/beta_service.go | 43 ++++++++++++++++ .../discovery/api/beta_service_test.go | 49 +++++++++++++++++++ .../connector/graph/betasdk/beta_client.go | 5 ++ 3 files changed, 97 insertions(+) create mode 100644 src/internal/connector/discovery/api/beta_service.go create mode 100644 src/internal/connector/discovery/api/beta_service_test.go diff --git a/src/internal/connector/discovery/api/beta_service.go b/src/internal/connector/discovery/api/beta_service.go new file mode 100644 index 000000000..df2b1533b --- /dev/null +++ b/src/internal/connector/discovery/api/beta_service.go @@ -0,0 +1,43 @@ +package api + +import ( + "github.com/alcionai/corso/src/internal/connector/graph/betasdk" + absser "github.com/microsoft/kiota-abstractions-go/serialization" + msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" + "github.com/pkg/errors" +) + +// Service wraps BetaClient's functionality. +// Abstraction created to comply loosely with graph.Servicer +// methods for ease of switching between v1.0 and beta connnectors +type Service struct { + client *betasdk.BetaClient +} + +func (s Service) Client() *betasdk.BetaClient { + return s.client +} + +func NewBetaService(adpt *msgraphsdk.GraphRequestAdapter) *Service { + return &Service{ + client: betasdk.NewBetaClient(adpt), + } +} + +// Seraialize writes an M365 parsable object into a byte array using the built-in +// application/json writer within the adapter. +func (s Service) Serialize(object absser.Parsable) ([]byte, error) { + writer, err := s.client.Adapter(). + GetSerializationWriterFactory(). + GetSerializationWriter("application/json") + if err != nil || writer == nil { + return nil, errors.Wrap(err, "creating json serialization writer") + } + + err = writer.WriteObjectValue("", object) + if err != nil { + return nil, errors.Wrap(err, "writeObjecValue serialization") + } + + return writer.GetSerializedContent() +} diff --git a/src/internal/connector/discovery/api/beta_service_test.go b/src/internal/connector/discovery/api/beta_service_test.go new file mode 100644 index 000000000..ad67b3877 --- /dev/null +++ b/src/internal/connector/discovery/api/beta_service_test.go @@ -0,0 +1,49 @@ +package api + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/graph/betasdk/models" + "github.com/alcionai/corso/src/internal/tester" +) + +type BetaUnitSuite struct { + suite.Suite +} + +func TestBetaUnitSuite(t *testing.T) { + suite.Run(t, new(BetaUnitSuite)) +} + +func (suite *BetaUnitSuite) TestBetaService_Adapter() { + t := suite.T() + a := tester.NewM365Account(t) + m365, err := a.M365Config() + require.NoError(t, err) + + adpt, err := graph.CreateAdapter( + m365.AzureTenantID, + m365.AzureClientID, + m365.AzureClientSecret, + ) + require.NoError(t, err) + + service := NewBetaService(adpt) + require.NotNil(t, service) + + testPage := models.NewSitePage() + name := "testFile" + desc := "working with parsing" + + testPage.SetName(&name) + testPage.SetDescription(&desc) + + byteArray, err := service.Serialize(testPage) + assert.NotEmpty(t, byteArray) + assert.NoError(t, err) +} diff --git a/src/internal/connector/graph/betasdk/beta_client.go b/src/internal/connector/graph/betasdk/beta_client.go index 515e1de95..ef77b8169 100644 --- a/src/internal/connector/graph/betasdk/beta_client.go +++ b/src/internal/connector/graph/betasdk/beta_client.go @@ -84,3 +84,8 @@ func (m *BetaClient) SitesById(id string) *i1a3c1a5501c5e41b7fd169f2d4c768dce9b0 } return i1a3c1a5501c5e41b7fd169f2d4c768dce9b096ac28fb5431bf02afcc57295411.NewSiteItemRequestBuilderInternal(urlTplParams, m.requestAdapter) } + +// Adapter() helper method to export Adapter for iterating +func (m *BetaClient) Adapter() *msgraphsdk.GraphRequestAdapter { + return m.requestAdapter +} From 498fc325a9149e22617515a06b6a0c0e36827613 Mon Sep 17 00:00:00 2001 From: Keepers Date: Tue, 31 Jan 2023 14:22:53 -0700 Subject: [PATCH 36/36] store errors in operation (#2237) ## Description Adds the fault.Errors struct (now exported) to the operations base. stats.Errs is retained in the backup and restore wrappers to avoid breaking changes and allow for deserialization. We will continue to use the current error return until dependencies are fully updated to use Errors. ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :broom: Tech Debt/Cleanup ## Issue(s) * #1970 ## Test Plan - [x] :zap: Unit test - [x] :green_heart: E2E --- src/internal/operations/backup.go | 3 +- .../operations/backup_integration_test.go | 6 ++++ src/internal/operations/backup_test.go | 2 +- src/internal/operations/operation.go | 20 +++++++---- src/internal/operations/restore.go | 2 +- src/internal/operations/restore_test.go | 8 +++-- src/pkg/backup/backup.go | 33 ++++++++++++++++--- src/pkg/backup/backup_test.go | 4 +++ src/pkg/repository/repository_load_test.go | 12 ++++--- 9 files changed, 69 insertions(+), 21 deletions(-) diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 247f9859b..b2a0c552c 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -44,7 +44,7 @@ type BackupOperation struct { // BackupResults aggregate the details of the result of the operation. type BackupResults struct { - stats.Errs + stats.Errs // deprecated in place of fault.Errors in the base operation. stats.ReadWrites stats.StartAndEndTime BackupID model.StableID `json:"backupID"` @@ -609,6 +609,7 @@ func (op *BackupOperation) createBackupModels( op.Selectors, op.Results.ReadWrites, op.Results.StartAndEndTime, + op.Errors, ) err = op.store.Put(ctx, model.BackupSchema, b) diff --git a/src/internal/operations/backup_integration_test.go b/src/internal/operations/backup_integration_test.go index c28159c1a..21d4009e0 100644 --- a/src/internal/operations/backup_integration_test.go +++ b/src/internal/operations/backup_integration_test.go @@ -153,6 +153,8 @@ func runAndCheckBackup( assert.Less(t, int64(0), bo.Results.BytesRead, "bytes read") assert.Less(t, int64(0), bo.Results.BytesUploaded, "bytes uploaded") assert.Equal(t, 1, bo.Results.ResourceOwners, "count of resource owners") + assert.NoError(t, bo.Errors.Err(), "incremental non-recoverable error") + assert.Empty(t, bo.Errors.Errs(), "incremental recoverable/iteration errors") assert.NoError(t, bo.Results.ReadErrors, "errors reading data") assert.NoError(t, bo.Results.WriteErrors, "errors writing data") assert.Equal(t, 1, mb.TimesCalled[events.BackupStart], "backup-start events") @@ -616,6 +618,8 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchange() { assert.Greater(t, bo.Results.BytesRead, incBO.Results.BytesRead, "incremental bytes read") assert.Greater(t, bo.Results.BytesUploaded, incBO.Results.BytesUploaded, "incremental bytes uploaded") assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner") + assert.NoError(t, incBO.Errors.Err(), "incremental non-recoverable error") + assert.Empty(t, incBO.Errors.Errs(), "count incremental recoverable/iteration errors") assert.NoError(t, incBO.Results.ReadErrors, "incremental read errors") assert.NoError(t, incBO.Results.WriteErrors, "incremental write errors") assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events") @@ -1039,6 +1043,8 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchangeIncrementals() { // +4 on read/writes to account for metadata: 1 delta and 1 path for each type. assert.Equal(t, test.itemsWritten+4, incBO.Results.ItemsWritten, "incremental items written") assert.Equal(t, test.itemsRead+4, incBO.Results.ItemsRead, "incremental items read") + assert.NoError(t, incBO.Errors.Err(), "incremental non-recoverable error") + assert.Empty(t, incBO.Errors.Errs(), "incremental recoverable/iteration errors") assert.NoError(t, incBO.Results.ReadErrors, "incremental read errors") assert.NoError(t, incBO.Results.WriteErrors, "incremental write errors") assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events") diff --git a/src/internal/operations/backup_test.go b/src/internal/operations/backup_test.go index 2a7a1ecce..f867e2a11 100644 --- a/src/internal/operations/backup_test.go +++ b/src/internal/operations/backup_test.go @@ -420,11 +420,11 @@ func (suite *BackupOpSuite) TestBackupOperation_PersistResults() { assert.Equal(t, test.expectStatus.String(), op.Status.String(), "status") assert.Equal(t, test.stats.gc.Successful, op.Results.ItemsRead, "items read") - assert.Equal(t, test.stats.readErr, op.Results.ReadErrors, "read errors") assert.Equal(t, test.stats.k.TotalFileCount, op.Results.ItemsWritten, "items written") assert.Equal(t, test.stats.k.TotalHashedBytes, op.Results.BytesRead, "bytes read") assert.Equal(t, test.stats.k.TotalUploadedBytes, op.Results.BytesUploaded, "bytes written") assert.Equal(t, test.stats.resourceCount, op.Results.ResourceOwners, "resource owners") + assert.Equal(t, test.stats.readErr, op.Results.ReadErrors, "read errors") assert.Equal(t, test.stats.writeErr, op.Results.WriteErrors, "write errors") assert.Equal(t, now, op.Results.StartedAt, "started at") assert.Less(t, now, op.Results.CompletedAt, "completed at") diff --git a/src/internal/operations/operation.go b/src/internal/operations/operation.go index 24391997e..32122d682 100644 --- a/src/internal/operations/operation.go +++ b/src/internal/operations/operation.go @@ -13,6 +13,7 @@ import ( "github.com/alcionai/corso/src/internal/observe" "github.com/alcionai/corso/src/pkg/account" "github.com/alcionai/corso/src/pkg/control" + "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/selectors" "github.com/alcionai/corso/src/pkg/store" ) @@ -52,9 +53,11 @@ const ( // Specific processes (eg: backups, restores, etc) are expected to wrap operation // with process specific details. type operation struct { - CreatedAt time.Time `json:"createdAt"` // datetime of the operation's creation - Options control.Options `json:"options"` - Status opStatus `json:"status"` + CreatedAt time.Time `json:"createdAt"` + + Errors *fault.Errors `json:"errors"` + Options control.Options `json:"options"` + Status opStatus `json:"status"` bus events.Eventer kopia *kopia.Wrapper @@ -69,11 +72,14 @@ func newOperation( ) operation { return operation{ CreatedAt: time.Now(), + Errors: fault.New(opts.FailFast), Options: opts, - bus: bus, - kopia: kw, - store: sw, - Status: InProgress, + + bus: bus, + kopia: kw, + store: sw, + + Status: InProgress, } } diff --git a/src/internal/operations/restore.go b/src/internal/operations/restore.go index 8ddaa8d29..db5ca9a93 100644 --- a/src/internal/operations/restore.go +++ b/src/internal/operations/restore.go @@ -44,7 +44,7 @@ type RestoreOperation struct { // RestoreResults aggregate the details of the results of the operation. type RestoreResults struct { - stats.Errs + stats.Errs // deprecated in place of fault.Errors in the base operation. stats.ReadWrites stats.StartAndEndTime } diff --git a/src/internal/operations/restore_test.go b/src/internal/operations/restore_test.go index 973a178b4..9bf21b806 100644 --- a/src/internal/operations/restore_test.go +++ b/src/internal/operations/restore_test.go @@ -104,10 +104,10 @@ func (suite *RestoreOpSuite) TestRestoreOperation_PersistResults() { assert.Equal(t, test.expectStatus.String(), op.Status.String(), "status") assert.Equal(t, len(test.stats.cs), op.Results.ItemsRead, "items read") - assert.Equal(t, test.stats.readErr, op.Results.ReadErrors, "read errors") assert.Equal(t, test.stats.gc.Successful, op.Results.ItemsWritten, "items written") assert.Equal(t, test.stats.bytesRead.NumBytes, op.Results.BytesRead, "resource owners") assert.Equal(t, test.stats.resourceCount, op.Results.ResourceOwners, "resource owners") + assert.Equal(t, test.stats.readErr, op.Results.ReadErrors, "read errors") assert.Equal(t, test.stats.writeErr, op.Results.WriteErrors, "write errors") assert.Equal(t, now, op.Results.StartedAt, "started at") assert.Less(t, now, op.Results.CompletedAt, "completed at") @@ -293,8 +293,10 @@ func (suite *RestoreOpIntegrationSuite) TestRestore_Run() { assert.Less(t, 0, ro.Results.ItemsWritten, "restored items written") assert.Less(t, int64(0), ro.Results.BytesRead, "bytes read") assert.Equal(t, 1, ro.Results.ResourceOwners, "resource Owners") - assert.Zero(t, ro.Results.ReadErrors, "errors while reading restore data") - assert.Zero(t, ro.Results.WriteErrors, "errors while writing restore data") + assert.NoError(t, ro.Errors.Err(), "non-recoverable error") + assert.Empty(t, ro.Errors.Errs(), "recoverable errors") + assert.NoError(t, ro.Results.ReadErrors, "errors while reading restore data") + assert.NoError(t, ro.Results.WriteErrors, "errors while writing restore data") assert.Equal(t, suite.numItems, ro.Results.ItemsWritten, "backup and restore wrote the same num of items") assert.Equal(t, 1, mb.TimesCalled[events.RestoreStart], "restore-start events") assert.Equal(t, 1, mb.TimesCalled[events.RestoreEnd], "restore-end events") diff --git a/src/pkg/backup/backup.go b/src/pkg/backup/backup.go index 6d73498eb..d0d9ddffd 100644 --- a/src/pkg/backup/backup.go +++ b/src/pkg/backup/backup.go @@ -10,6 +10,7 @@ import ( "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/internal/model" "github.com/alcionai/corso/src/internal/stats" + "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/selectors" ) @@ -31,8 +32,11 @@ type Backup struct { // Selector used in this operation Selector selectors.Selector `json:"selectors"` + // Errors contains all errors aggregated during a backup operation. + Errors fault.ErrorsData `json:"errors"` + // stats are embedded so that the values appear as top-level properties - stats.Errs + stats.Errs // Deprecated, replaced with Errors. stats.ReadWrites stats.StartAndEndTime } @@ -46,6 +50,7 @@ func New( selector selectors.Selector, rw stats.ReadWrites, se stats.StartAndEndTime, + errs *fault.Errors, ) *Backup { return &Backup{ BaseModel: model.BaseModel{ @@ -59,6 +64,7 @@ func New( DetailsID: detailsID, Status: status, Selector: selector, + Errors: errs.Data(), ReadWrites: rw, StartAndEndTime: se, } @@ -102,7 +108,7 @@ type Printable struct { func (b Backup) MinimumPrintable() any { return Printable{ ID: b.ID, - ErrorCount: support.GetNumberOfErrors(b.ReadErrors) + support.GetNumberOfErrors(b.WriteErrors), + ErrorCount: b.errorCount(), StartedAt: b.StartedAt, Status: b.Status, Version: "0", @@ -125,8 +131,7 @@ func (b Backup) Headers() []string { // Values returns the values matching the Headers list for printing // out to a terminal in a columnar display. func (b Backup) Values() []string { - errCount := support.GetNumberOfErrors(b.ReadErrors) + support.GetNumberOfErrors(b.WriteErrors) - status := fmt.Sprintf("%s (%d errors)", b.Status, errCount) + status := fmt.Sprintf("%s (%d errors)", b.Status, b.errorCount()) return []string{ common.FormatTabularDisplayTime(b.StartedAt), @@ -135,3 +140,23 @@ func (b Backup) Values() []string { b.Selector.DiscreteOwner, } } + +func (b Backup) errorCount() int { + var errCount int + + // current tracking + if b.ReadErrors != nil || b.WriteErrors != nil { + return support.GetNumberOfErrors(b.ReadErrors) + support.GetNumberOfErrors(b.WriteErrors) + } + + // future tracking + if b.Errors.Err != nil || len(b.Errors.Errs) > 0 { + if b.Errors.Err != nil { + errCount++ + } + + errCount += len(b.Errors.Errs) + } + + return errCount +} diff --git a/src/pkg/backup/backup_test.go b/src/pkg/backup/backup_test.go index 1ddf4f4a2..8fbf8c62f 100644 --- a/src/pkg/backup/backup_test.go +++ b/src/pkg/backup/backup_test.go @@ -13,6 +13,7 @@ import ( "github.com/alcionai/corso/src/internal/model" "github.com/alcionai/corso/src/internal/stats" "github.com/alcionai/corso/src/pkg/backup" + "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/selectors" ) @@ -40,6 +41,9 @@ func stubBackup(t time.Time) backup.Backup { DetailsID: "details", Status: "status", Selector: sel.Selector, + Errors: fault.ErrorsData{ + Errs: []error{errors.New("read"), errors.New("write")}, + }, Errs: stats.Errs{ ReadErrors: errors.New("1"), WriteErrors: errors.New("1"), diff --git a/src/pkg/repository/repository_load_test.go b/src/pkg/repository/repository_load_test.go index 744b57449..36714df71 100644 --- a/src/pkg/repository/repository_load_test.go +++ b/src/pkg/repository/repository_load_test.go @@ -184,8 +184,10 @@ func runBackupLoadTest( assert.Less(t, 0, b.Results.ItemsWritten, "items written") assert.Less(t, int64(0), b.Results.BytesUploaded, "bytes uploaded") assert.Equal(t, len(users), b.Results.ResourceOwners, "resource owners") - assert.Zero(t, b.Results.ReadErrors, "read errors") - assert.Zero(t, b.Results.WriteErrors, "write errors") + assert.NoError(t, b.Errors.Err(), "non-recoverable error") + assert.Empty(t, b.Errors.Errs(), "recoverable errors") + assert.NoError(t, b.Results.ReadErrors, "read errors") + assert.NoError(t, b.Results.WriteErrors, "write errors") }) } @@ -290,8 +292,10 @@ func doRestoreLoadTest( assert.Less(t, 0, r.Results.ItemsRead, "items read") assert.Less(t, 0, r.Results.ItemsWritten, "items written") assert.Equal(t, len(users), r.Results.ResourceOwners, "resource owners") - assert.Zero(t, r.Results.ReadErrors, "read errors") - assert.Zero(t, r.Results.WriteErrors, "write errors") + assert.NoError(t, r.Errors.Err(), "non-recoverable error") + assert.Empty(t, r.Errors.Errs(), "recoverable errors") + assert.NoError(t, r.Results.ReadErrors, "read errors") + assert.NoError(t, r.Results.WriteErrors, "write errors") assert.Equal(t, expectItemCount, r.Results.ItemsWritten, "backup and restore wrote the same count of items") ensureAllUsersInDetails(t, users, ds, "restore", name)