Added option showdeleted [<Boolean>]' to gam <UserTypeEntity> print|show chatmessages`.

Updated commands that call the Reports API (including `gam info domain`) to handle a change
in the Reports API that generated the following warning:
```
WARNING: End date greater than LastReportedDate.
This commit is contained in:
Ross Scroggs
2023-09-07 09:03:00 -07:00
parent ed62abe464
commit c30931545f
6 changed files with 54 additions and 21 deletions

View File

@@ -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.63.12
Updated commands that call the Reports API (including `gam info domain`) to handle a change
in the Reports API that generated the following warning:
```
WARNING: End date greater than LastReportedDate.
```
Added option `showdeleted [<Boolean>]' to `gam <UserTypeEntity> print|show chatmessages`.
### 6.63.11
Added option `ou_and_children <OrgUnitItem>` to `gam print|show crostelemetry` to simplify getting

View File

@@ -330,7 +330,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.63.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.63.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64
@@ -972,7 +972,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.63.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.63.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
Windows-10-10.0.17134 AMD64

View File

@@ -3,7 +3,7 @@
Print the current version of Gam with details
```
gam version
GAMADV-XTD3 6.63.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.63.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
MacOS Monterey 12.6.6 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.63.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.63.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
MacOS Monterey 12.6.6 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.63.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.63.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
MacOS Monterey 12.6.6 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.63.11
Latest: 6.63.12
echo $?
1
```
@@ -72,7 +72,7 @@ echo $?
Print the current version number without details
```
gam version simple
6.63.11
6.63.12
```
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.63.11 - https://github.com/taers232c/GAMADV-XTD3
GAM 6.63.12 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
MacOS Monterey 12.6.6 x86_64

View File

@@ -5780,10 +5780,10 @@ gam <UserTypeEntity> delete chatmessage name <ChatMessage>
gam <UserTypeEntity> info chatmessage name <ChatMessage>
[formatjson]
gam <UserTypeEntity> show chatmessages <ChatSpace>
[filter <String>]
[showdeleted [<Boolean>]] [filter <String>]
[formatjson]
gam <UserTypeEntity> print chatmessages [todrive <ToDriveAttribute>*] <ChatSpace>
[filter <String>]
[showdeleted [<Boolean>]] [filter <String>]
[formatjson [quotechar <Character>]]
# Users - Data Studuo

View File

@@ -2,6 +2,16 @@
Merged GAM-Team version
6.63.12
Updated commands that call the Reports API (including `gam info domain`) to handle a change
in the Reports API that generated the following warning:
```
WARNING: End date greater than LastReportedDate.
```
Added option `showdeleted [<Boolean>]' to `gam <UserTypeEntity> print|show chatmessages`.
6.63.11
Added option `ou_and_children <OrgUnitItem>` to `gam print|show crostelemetry` to simplify getting

View File

@@ -12479,14 +12479,23 @@ def doWhatIs():
entityUnknownWarning(Ent.EMAIL, email)
setSysExitRC(ENTITY_IS_UKNOWN_RC)
def _adjustTryDate(errMsg, noDateChange):
def _adjustTryDate(errMsg, noDateChange, prevTryDate):
match_date = re.match('Data for dates later than (.*) is not yet available. Please check back later', errMsg)
if not match_date:
if match_date:
tryDate = match_date.group(1)
else:
match_date = re.match('Start date can not be later than (.*)', errMsg)
if match_date:
tryDate = match_date.group(1)
else:
match_date = re.match('End date greater than LastReportedDate.', errMsg)
if match_date:
tryDateTime = datetime.datetime.strptime(prevTryDate, YYYYMMDD_FORMAT)-datetime.timedelta(days=1)
tryDate = tryDateTime.strftime(YYYYMMDD_FORMAT)
if (not match_date) or noDateChange:
printWarningMessage(DATA_NOT_AVALIABLE_RC, errMsg)
return None
return match_date.group(1)
return tryDate
def _checkDataRequiredServices(result, tryDate, dataRequiredServices, parameterServices=None, checkUserEmail=False):
# -1: Data not available:
@@ -12594,7 +12603,7 @@ def doReportUsageParameters():
printErrorMessage(BAD_REQUEST_RC, Msg.BAD_REQUEST)
return
except GAPI.invalid as e:
tryDate = _adjustTryDate(str(e), False)
tryDate = _adjustTryDate(str(e), False, tryDate)
if not tryDate:
break
for parameter in sorted(allParameters):
@@ -13373,7 +13382,7 @@ def doReport():
if not status:
break
except GAPI.invalid as e:
tryDate = _adjustTryDate(str(e), noDateChange)
tryDate = _adjustTryDate(str(e), noDateChange, tryDate)
if not tryDate:
break
startDateTime = endDateTime = datetime.datetime.strptime(tryDate, YYYYMMDD_FORMAT)
@@ -13450,7 +13459,7 @@ def doReport():
if not status:
break
except GAPI.invalid as e:
tryDate = _adjustTryDate(str(e), noDateChange)
tryDate = _adjustTryDate(str(e), noDateChange, tryDate)
if not tryDate:
break
startDateTime = endDateTime = datetime.datetime.strptime(tryDate, YYYYMMDD_FORMAT)
@@ -15338,7 +15347,7 @@ def _showCustomerLicenseInfo(customerInfo, FJQC):
continue
break
except GAPI.invalid as e:
tryDate = _adjustTryDate(str(e), False)
tryDate = _adjustTryDate(str(e), False, tryDate)
if not tryDate:
return
continue
@@ -25265,10 +25274,10 @@ def doInfoChatMessage():
infoChatMessage([None])
# gam <UserTypeEntity> show chatmessages <ChatSpace>
# [filter <String>]
# [showdeleted [<Boolean>]] [filter <String>]
# [formatjson]
# gam <UserTypeEntity> print chatmessages [todrive <ToDriveAttribute>*] <ChatSpace>i
# [filter <String>]
# [showdeleted [<Boolean>]] [filter <String>]
# [formatjson [quotechar <Character>]]
def printShowChatMessages(users):
def _printChatMessage(user, message):
@@ -25289,12 +25298,15 @@ def printShowChatMessages(users):
csvPF = CSVPrintFile(['User', 'name'] if not isinstance(users, list) else ['name']) if Act.csvFormat() else None
FJQC = FormatJSONQuoteChar(csvPF)
parent = pfilter = None
showDeleted = False
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if csvPF and myarg == 'todrive':
csvPF.GetTodriveParameters()
elif myarg == 'space' or myarg.startswith('spaces/'):
parent = getChatSpace(myarg)
elif myarg == 'showdeleted':
showDeleted = getBoolean()
elif myarg =='filter':
pfilter = getString(Cmd.OB_STRING)
else:
@@ -25314,9 +25326,10 @@ def printShowChatMessages(users):
messages = callGAPIpages(chat.spaces().messages(), 'list', 'messages',
pageMessage=_getChatPageMessage(Ent.CHAT_MESSAGE, user, i, count, qfilter),
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
pageSize=CHAT_PAGE_SIZE, parent=parent, filter=pfilter)
pageSize=CHAT_PAGE_SIZE, parent=parent, filter=pfilter, showDeleted=showDeleted)
for message in messages:
_getChatSenderEmail(cd, message['sender'])
if 'sender' in message:
_getChatSenderEmail(cd, message['sender'])
except (GAPI.notFound, GAPI.invalidArgument, GAPI.permissionDenied) as e:
exitIfChatNotConfigured(chat, kvList, str(e), i, count)
continue