Added the following option to <EventMatchProperty>

```
matchfield attendeesonlydomainlist <DomainNameList>
```
This commit is contained in:
Ross Scroggs
2024-04-16 18:34:13 -07:00
parent 842e46d060
commit b00077151b
8 changed files with 46 additions and 12 deletions

View File

@@ -1597,6 +1597,7 @@ gam calendar <CalendarEntity> printacl [todrive <ToDriveAttribute>*]
<EventMatchProperty> ::=
(matchfield attendees <EmailAddressEntity>)|
(matchfield attendeesonlydomainlist <DomainNameList>)|
(matchfield attendeesdomainlist <DomainNameList>)|
(matchfield attendeesnotdomainlist <DomainNameList>)|
(matchfield attendeespattern <RegularExpression>)|

View File

@@ -2,6 +2,16 @@
Merged GAM-Team version
6.72.13
Added the following option to `<EventMatchProperty>` that can be used to select
events based on the domains of the attendees.
```
matchfield attendeesonlydomainlist <DomainNameList>
```
This returns true if all attendee's email address are in a domain in `<DomainNameList>`;
for example this lets you look for events with attendees only in your internal domains.
6.72.12
Added the following options to `<EventMatchProperty>` that can be used to select

View File

@@ -36164,6 +36164,7 @@ LIST_EVENTS_SELECT_PROPERTIES = {
LIST_EVENTS_MATCH_FIELDS = {
'attendees': ['attendees', 'email'],
'attendeesonlydomainlist': ['attendees', 'onlydomainlist'],
'attendeesdomainlist': ['attendees', 'domainlist'],
'attendeesnotdomainlist': ['attendees', 'notdomainlist'],
'attendeespattern': ['attendees', 'match'],
@@ -36237,7 +36238,7 @@ def getCalendarEventEntity():
calendarEventEntity['matches'].append((matchField, getBoolean()))
elif matchField[0] != 'attendees' or matchField[1] == 'match':
calendarEventEntity['matches'].append((matchField, getREPattern(re.IGNORECASE)))
elif matchField[0] == 'attendees' and matchField[1] in {'domainlist', 'notdomainlist'}:
elif matchField[0] == 'attendees' and matchField[1] in {'onlydomainlist', 'domainlist', 'notdomainlist'}:
calendarEventEntity['matches'].append((matchField, set(getString(Cmd.OB_DOMAIN_NAME_LIST).replace(',', ' ').split())))
elif matchField[1] == 'email':
calendarEventEntity['matches'].append((matchField, getNormalizedEmailAddressEntity()))
@@ -36513,6 +36514,12 @@ def _eventMatches(event, match):
if match[1].search(attendee) is not None:
return True
return False
if match[0][1] == 'onlydomainlist':
for attendee in attendees:
_, domain = attendee.lower().split('@', 1)
if domain not in match[1]:
return False
return True
if match[0][1] == 'domainlist':
for attendee in attendees:
_, domain = attendee.lower().split('@', 1)