Updates to api/mail.go
Ensures that item.Attachment information is stored within the backup.
This commit is contained in:
parent
52572f9e88
commit
a7c56a7d24
@ -130,13 +130,18 @@ func (c Mail) GetItem(
|
|||||||
var errs *multierror.Error
|
var errs *multierror.Error
|
||||||
|
|
||||||
if *mail.GetHasAttachments() || HasAttachments(mail.GetBody()) {
|
if *mail.GetHasAttachments() || HasAttachments(mail.GetBody()) {
|
||||||
|
options := &users.ItemMessagesItemAttachmentsRequestBuilderGetRequestConfiguration{
|
||||||
|
QueryParameters: &users.ItemMessagesItemAttachmentsRequestBuilderGetQueryParameters{
|
||||||
|
Expand: []string{"microsoft.graph.itemattachment/item"},
|
||||||
|
},
|
||||||
|
}
|
||||||
for count := 0; count < numberOfRetries; count++ {
|
for count := 0; count < numberOfRetries; count++ {
|
||||||
attached, err := c.largeItem.
|
attached, err := c.largeItem.
|
||||||
Client().
|
Client().
|
||||||
UsersById(user).
|
UsersById(user).
|
||||||
MessagesById(itemID).
|
MessagesById(itemID).
|
||||||
Attachments().
|
Attachments().
|
||||||
Get(ctx, nil)
|
Get(ctx, options)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
mail.SetAttachments(attached.GetValue())
|
mail.SetAttachments(attached.GetValue())
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user