From 8d4277b1c7035722f708d98cd462a3c5136ebabd Mon Sep 17 00:00:00 2001 From: neha-Gupta1 Date: Thu, 17 Aug 2023 16:24:38 +0530 Subject: [PATCH] add handers for channels --- .../m365/collection/groups/handler.go | 23 +++++++++++ src/pkg/services/m365/api/channels.go | 1 + src/pkg/services/m365/api/channels_pager.go | 39 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 src/internal/m365/collection/groups/handler.go create mode 100644 src/pkg/services/m365/api/channels.go create mode 100644 src/pkg/services/m365/api/channels_pager.go diff --git a/src/internal/m365/collection/groups/handler.go b/src/internal/m365/collection/groups/handler.go new file mode 100644 index 000000000..0dea1ebb3 --- /dev/null +++ b/src/internal/m365/collection/groups/handler.go @@ -0,0 +1,23 @@ +package groups + +import ( + "context" + + "github.com/alcionai/corso/src/pkg/services/m365/api" + "github.com/microsoft/kiota-abstractions-go/serialization" + "github.com/microsoftgraph/msgraph-sdk-go/models" +) + +type BackupChannelHandler interface { + GetChannel(ctx context.Context, teamID, channelID string) (models.Channelable, error) + NewChannelPager(teamID, channelID string) api.ChannelItemDeltaEnumerator +} + +type BackupMessagesHandler interface { + GetItem(ctx context.Context, teamID, channelID, itemID string) (models.ChatMessageable, error) + NewItemPager(teamID, channelID string) api.MessageItemDeltaEnumerator +} + +type BackupReplyHandler interface { + GetItem(ctx context.Context, teamID, channelID, messageID string) (serialization.Parsable, error) +} diff --git a/src/pkg/services/m365/api/channels.go b/src/pkg/services/m365/api/channels.go new file mode 100644 index 000000000..778f64ec1 --- /dev/null +++ b/src/pkg/services/m365/api/channels.go @@ -0,0 +1 @@ +package api diff --git a/src/pkg/services/m365/api/channels_pager.go b/src/pkg/services/m365/api/channels_pager.go new file mode 100644 index 000000000..599c09649 --- /dev/null +++ b/src/pkg/services/m365/api/channels_pager.go @@ -0,0 +1,39 @@ +package api + +import ( + "context" +) + +// --------------------------------------------------------------------------- +// item pager +// --------------------------------------------------------------------------- + +type MessageItemDeltaEnumerator interface { + GetPage(context.Context) (DeltaPageLinker, error) +} + +// TODO: implement +// var _ MessageItemDeltaEnumerator = &messagePageCtrl{} + +// type messagePageCtrl struct { +// gs graph.Servicer +// builder *teams.ItemChannelsItemMessagesRequestBuilder +// options *teams.ItemChannelsItemMessagesRequestBuilderGetRequestConfiguration +// } + +// --------------------------------------------------------------------------- +// channel pager +// --------------------------------------------------------------------------- + +type ChannelItemDeltaEnumerator interface { + GetPage(context.Context) (DeltaPageLinker, error) +} + +// TODO: implement +// var _ ChannelsItemDeltaEnumerator = &channelsPageCtrl{} + +// type channelsPageCtrl struct { +// gs graph.Servicer +// builder *teams.ItemChannelsChannelItemRequestBuilder +// options *teams.ItemChannelsChannelItemRequestBuilderGetRequestConfiguration +// }