Updates to /internal/connector/exchange/attachment.go
Adds helper function to display the internal object type that is included as an attachment.
This commit is contained in:
parent
46d584ec75
commit
57d37c70ce
@ -58,6 +58,7 @@ func uploadAttachment(
|
|||||||
logger.Ctx(ctx).Infow("item attachment uploads are not supported ",
|
logger.Ctx(ctx).Infow("item attachment uploads are not supported ",
|
||||||
"attachment_name", *attachment.GetName(), // TODO: Update to support PII protection
|
"attachment_name", *attachment.GetName(), // TODO: Update to support PII protection
|
||||||
"attachment_type", attachmentType,
|
"attachment_type", attachmentType,
|
||||||
|
"internal_item_type", getItemAttachmentItemType(attachment),
|
||||||
"attachment_id", *attachment.GetId(),
|
"attachment_id", *attachment.GetId(),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -101,3 +102,19 @@ func uploadLargeAttachment(ctx context.Context, uploader attachmentUploadable,
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getItemAttachmentItemType(query models.Attachmentable) string {
|
||||||
|
empty := ""
|
||||||
|
attachment, ok := query.(models.ItemAttachmentable)
|
||||||
|
|
||||||
|
if !ok {
|
||||||
|
return empty
|
||||||
|
}
|
||||||
|
|
||||||
|
item := attachment.GetItem()
|
||||||
|
if item.GetOdataType() == nil {
|
||||||
|
return empty
|
||||||
|
}
|
||||||
|
|
||||||
|
return *item.GetOdataType()
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user