From 9f9ce34add7075ee2a218f05753d57f76eeaa755 Mon Sep 17 00:00:00 2001 From: neha_gupta Date: Tue, 22 Aug 2023 22:03:59 +0530 Subject: [PATCH] add handlers for channels (#4050) add Handlers interface for Channels. #### Does this PR need a docs update or release note? - [ ] :no_entry: No #### Type of change - [ ] :sunflower: Feature #### Issue(s) * # #### Test Plan --- .../m365/collection/groups/handler.go | 18 +++++++++ src/pkg/services/m365/api/channels.go | 1 + src/pkg/services/m365/api/channels_pager.go | 39 +++++++++++++++++++ 3 files changed, 58 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..d4a382149 --- /dev/null +++ b/src/internal/m365/collection/groups/handler.go @@ -0,0 +1,18 @@ +package groups + +import ( + "context" + + "github.com/microsoft/kiota-abstractions-go/serialization" + "github.com/microsoftgraph/msgraph-sdk-go/models" + + "github.com/alcionai/corso/src/pkg/services/m365/api" +) + +type BackupMessagesHandler interface { + GetMessageByID(ctx context.Context, teamID, channelID, itemID string) (models.ChatMessageable, error) + NewMessagePager(teamID, channelID string) api.MessageItemDeltaEnumerator + GetChannelByID(ctx context.Context, teamID, channelID string) (models.Channelable, error) + NewChannelPager(teamID, channelID string) api.ChannelItemDeltaEnumerator + GetReplyByID(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 +// }