From b00077151bbcfaa7bbf55bd548d70fc0f3179858 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Tue, 16 Apr 2024 18:34:13 -0700 Subject: [PATCH] Added the following option to `` ``` matchfield attendeesonlydomainlist ``` --- docs/Calendars-Events.md | 7 +++++-- docs/GamUpdates.md | 10 ++++++++++ docs/How-to-Upgrade-from-Standard-GAM.md | 4 ++-- docs/Users-Calendars-Events.md | 5 ++++- docs/Version-and-Help.md | 12 ++++++------ src/GamCommands.txt | 1 + src/GamUpdate.txt | 10 ++++++++++ src/gam/__init__.py | 9 ++++++++- 8 files changed, 46 insertions(+), 12 deletions(-) diff --git a/docs/Calendars-Events.md b/docs/Calendars-Events.md index a2d762f5..9bb4e660 100644 --- a/docs/Calendars-Events.md +++ b/docs/Calendars-Events.md @@ -196,6 +196,7 @@ Client access works when accessing Resource calendars. ::= (matchfield attendees )| + (matchfield attendeesonlydomainlist )| (matchfield attendeesdomainlist )| (matchfield attendeesnotdomainlist )| (matchfield attendeespattern )| @@ -218,7 +219,6 @@ Client access works when accessing Resource calendars. (event|events | | | | | ) See: https://github.com/taers232c/GAMADV-XTD3/wiki/Collections-of-Items - ::= (+ *) @@ -231,6 +231,7 @@ Client access works when accessing Resource calendars. lavender|peacock|sage|tangerine|tomato ::= ::= + ::= ::= (allday )| @@ -358,10 +359,12 @@ The Google Calendar API processes `*`; you may specify none GAM processes `*`; you may specify none or multiple properties. * `matchfield attendees ` - All of the attendees in `` must be present +* `matchfield attendeesonlydomainlist ` - All attendee's email addresses must be in a domain in `` + * For example, this lets you look for events with all attendees in your internal domains * `matchfield attendeesdomainlist ` - Some attendee's email address must be in a domain in `` * For example, this lets you look for events with attendees in specific external domains * `matchfield attendeesnotdomainlist ` - Some attendee's email address must be in a domain not in `` - * For example, this let you look for events with attendees not in your internal domains + * For example, this lets you look for events with attendees not in your internal domains * `matchfield attendeespattern ` - Some attendee's email address must match `` * `matchfield attendeesstatus [] [] ` - All of the attendees in `` must be present and must have the specified values. diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 1b9411e3..ed253514 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,16 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation +### 6.72.13 + +Added the following option to `` that can be used to select +events based on the domains of the attendees. +``` +matchfield attendeesonlydomainlist +``` +This returns true if all attendee's email address are in a domain in ``; +for example this lets you look for events with attendees only in your internal domains. + ### 6.72.12 Added the following options to `` that can be used to select diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index 9b77b434..9845e33b 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAMADV-XTD3 6.72.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.72.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.2 64-bit final MacOS Sonoma 14.2.1 x86_64 @@ -1006,7 +1006,7 @@ writes the credentials into the file oauth2.txt. C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt C:\GAMADV-XTD3>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.72.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.72.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.2 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Users-Calendars-Events.md b/docs/Users-Calendars-Events.md index a0b4711d..2fe060e2 100644 --- a/docs/Users-Calendars-Events.md +++ b/docs/Users-Calendars-Events.md @@ -261,6 +261,7 @@ ::= (matchfield attendees )| + (matchfield attendeesonlydomainlist )| (matchfield attendeesdomainlist )| (matchfield attendeesnotdomainlist )| (matchfield attendeespattern )| @@ -440,10 +441,12 @@ The Google Calendar API processes `*`; you may specify none GAM processes `*`; you may specify none or multiple properties. * `matchfield attendees ` - All of the attendees in `` must be present +* `matchfield attendeesonlydomainlist ` - All attendee's email addresses must be in a domain in `` + * For example, this lets you look for events with all attendees in your internal domains * `matchfield attendeesdomainlist ` - Some attendee's email address must be in a domain in `` * For example, this lets you look for events with attendees in specific external domains * `matchfield attendeesnotdomainlist ` - Some attendee's email address must be in a domain not in `` - * For example, this let you look for events with attendees not in your internal domains + * For example, this lets you look for events with attendees not in your internal domains * `matchfield attendeespattern ` - Some attendee's email address must match `` * `matchfield attendeesstatus [] [] ` - All of the attendees in `` must be present and must have the specified values. diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index af796dbc..7aa84f6c 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 6.72.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.72.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.2 64-bit final MacOS Sonoma 14.2.1 x86_64 @@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00 Print the current version of Gam with details and time offset information ``` gam version timeoffset -GAMADV-XTD3 6.72.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.72.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.2 64-bit final MacOS Sonoma 14.2.1 x86_64 @@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second Print the current version of Gam with extended details and SSL information ``` gam version extended -GAMADV-XTD3 6.72.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.72.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.2 64-bit final MacOS Sonoma 14.2.1 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.72.11 + Latest: 6.72.13 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -6.72.11 +6.72.13 ``` In Linux/MacOS you can do: ``` @@ -82,7 +82,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 6.72.11 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.72.13 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.2 64-bit final MacOS Sonoma 14.2.1 x86_64 diff --git a/src/GamCommands.txt b/src/GamCommands.txt index c4ee1c2b..1c0964e0 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -1597,6 +1597,7 @@ gam calendar printacl [todrive *] ::= (matchfield attendees )| + (matchfield attendeesonlydomainlist )| (matchfield attendeesdomainlist )| (matchfield attendeesnotdomainlist )| (matchfield attendeespattern )| diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 13f5cd8d..d53f573e 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,16 @@ Merged GAM-Team version +6.72.13 + +Added the following option to `` that can be used to select +events based on the domains of the attendees. +``` +matchfield attendeesonlydomainlist +``` +This returns true if all attendee's email address are in a domain in ``; +for example this lets you look for events with attendees only in your internal domains. + 6.72.12 Added the following options to `` that can be used to select diff --git a/src/gam/__init__.py b/src/gam/__init__.py index afbeb1cc..c3a5f76b 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -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)