ashmrtn 4a9951b876
Fetch mod time when getting added and removed items (#4266)
Also return mod time when available if
getting the set of added and removed
items. This will be leveraged in later
PRs to implement kopia assisted
incrementals for exchange

Does not change any logic in
collections right now, just adds the
fields to be returned

Also adds an additional return value
denoting if the mod times are expected
to be valid. This is required because
events delta cannot return mod time

---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [x] 🧹 Tech Debt/Cleanup

#### Issue(s)

* #2023

#### Test Plan

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2023-09-18 22:30:56 +00:00

54 lines
1.3 KiB
Go

package groups
import (
"context"
"time"
"github.com/microsoftgraph/msgraph-sdk-go/models"
"github.com/alcionai/corso/src/internal/m365/graph"
"github.com/alcionai/corso/src/pkg/backup/details"
"github.com/alcionai/corso/src/pkg/path"
"github.com/alcionai/corso/src/pkg/selectors"
"github.com/alcionai/corso/src/pkg/services/m365/api"
)
type backupHandler interface {
getChannelMessager
// gets all channels for the group
getChannels(
ctx context.Context,
) ([]models.Channelable, error)
// gets all message IDs (by delta, if possible) in the channel
getChannelMessageIDs(
ctx context.Context,
channelID, prevDelta string,
canMakeDeltaQueries bool,
) (map[string]time.Time, bool, []string, api.DeltaUpdate, error)
// includeContainer evaluates whether the channel is included
// in the provided scope.
includeContainer(
ctx context.Context,
qp graph.QueryParams,
ch models.Channelable,
scope selectors.GroupsScope,
) bool
// canonicalPath constructs the service and category specific path for
// the given builder.
canonicalPath(
folders *path.Builder,
tenantID string,
) (path.Path, error)
}
type getChannelMessager interface {
GetChannelMessage(
ctx context.Context,
teamID, channelID, itemID string,
) (models.ChatMessageable, *details.GroupsInfo, error)
}