Skip to content

Commit 5fb188b

Browse files
committed
Add mapping for complex attributes
#684
1 parent 4e95447 commit 5fb188b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

O365/utils/utils.py

+8
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,9 @@ class Query:
636636
'flag': 'flag/flagStatus',
637637
'body': 'body/content'
638638
}
639+
_select_mapping = {
640+
"meetingMessageType": "microsoft.graph.eventMessage/meetingMessageType",
641+
}
639642

640643
def __init__(self, attribute=None, *, protocol):
641644
""" Build a query to apply OData filters
@@ -685,6 +688,7 @@ def select(self, *attributes):
685688
if '/' in attribute:
686689
# only parent attribute can be selected
687690
attribute = attribute.split('/')[0]
691+
attribute = self._get_select_mapping(attribute)
688692
self._selects.add(attribute)
689693
else:
690694
if self._attribute:
@@ -860,6 +864,10 @@ def _get_mapping(self, attribute):
860864
return attribute
861865
return None
862866

867+
def _get_select_mapping(self, attribute):
868+
mapping = self._select_mapping.get(attribute)
869+
return mapping or attribute
870+
863871
@fluent
864872
def new(self, attribute, operation=ChainOperator.AND):
865873
""" Combine with a new query

0 commit comments

Comments
 (0)