-
Notifications
You must be signed in to change notification settings - Fork 23
/
contacts_backup.go
64 lines (52 loc) · 1.25 KB
/
contacts_backup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package exchange
import (
"github.com/alcionai/corso/src/pkg/control"
"github.com/alcionai/corso/src/pkg/fault"
"github.com/alcionai/corso/src/pkg/services/m365/api"
"github.com/alcionai/corso/src/pkg/services/m365/api/graph"
)
var _ backupHandler = &contactBackupHandler{}
type contactBackupHandler struct {
ac api.Contacts
}
func newContactBackupHandler(
ac api.Client,
) contactBackupHandler {
acc := ac.Contacts()
return contactBackupHandler{
ac: acc,
}
}
func (h contactBackupHandler) itemEnumerator() addedAndRemovedItemGetter {
return h.ac
}
func (h contactBackupHandler) itemHandler() itemGetterSerializer {
return h.ac
}
func (h contactBackupHandler) folderGetter() containerGetter {
return h.ac
}
func (h contactBackupHandler) previewIncludeContainers() []string {
return []string{
"contacts",
}
}
func (h contactBackupHandler) previewExcludeContainers() []string {
return nil
}
func (h contactBackupHandler) NewContainerCache(
userID string,
) (string, graph.ContainerResolver) {
return api.DefaultContacts, &contactContainerCache{
userID: userID,
enumer: h.ac,
getter: h.ac,
}
}
func (h contactBackupHandler) CanSkipItemFailure(
err error,
resourceID string,
opts control.Options,
) (fault.SkipCause, bool) {
return "", false
}