Revert "Made serviceNotAvailable retryable"

This reverts commit d5eef1faf5.
This commit is contained in:
Ross Scroggs
2023-08-23 21:39:23 -07:00
parent d5eef1faf5
commit d47268f45c
6 changed files with 129 additions and 41 deletions

View File

@ -10,13 +10,6 @@ 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. See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation.
### 6.64.00
Made the following error retryable.
```
ERROR: 503: serviceNotAvailable - The service is currently unavailable.
```
### 6.63.04 ### 6.63.04
Added option `ignorerole` to `gam update groups|cigroups <GroupEntity> sync [<GroupRole>|ignorerole] ... <UserTypeEntity>` that causes GAM Added option `ignorerole` to `gam update groups|cigroups <GroupEntity> sync [<GroupRole>|ignorerole] ... <UserTypeEntity>` that causes GAM

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$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version 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 WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
GAMADV-XTD3 6.64.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.10.8 64-bit final Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64 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>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version C:\GAMADV-XTD3>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAMADV-XTD3 6.64.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final Python 3.11.4 64-bit final
Windows-10-10.0.17134 AMD64 Windows-10-10.0.17134 AMD64

View File

@ -3,7 +3,7 @@
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAMADV-XTD3 6.64.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64 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 Print the current version of Gam with details and time offset information
``` ```
gam version timeoffset gam version timeoffset
GAMADV-XTD3 6.64.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64 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 Print the current version of Gam with extended details and SSL information
``` ```
gam version extended gam version extended
GAMADV-XTD3 6.64.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64 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 Path: /Users/Admin/bin/gamadv-xtd3
Version Check: Version Check:
Current: 5.35.08 Current: 5.35.08
Latest: 6.64.00 Latest: 6.63.04
echo $? echo $?
1 1
``` ```
@ -72,7 +72,7 @@ echo $?
Print the current version number without details Print the current version number without details
``` ```
gam version simple gam version simple
6.64.00 6.63.04
``` ```
In Linux/MacOS you can do: In Linux/MacOS you can do:
``` ```
@ -82,7 +82,7 @@ echo $VER
Print the current version of Gam and address of this Wiki Print the current version of Gam and address of this Wiki
``` ```
gam help gam help
GAM 6.64.00 - https://github.com/taers232c/GAMADV-XTD3 GAM 6.63.04 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64 MacOS Monterey 12.6.6 x86_64

View File

@ -2,13 +2,6 @@
Merged GAM-Team version Merged GAM-Team version
6.64.00
Made the following error retryable.
```
ERROR: 503: serviceNotAvailable - The service is currently unavailable.
```
6.63.04 6.63.04
Added option `ignorerole` to `gam update groups|cigroups <GroupEntity> sync [<GroupRole>|ignorerole] ... <UserTypeEntity>` that causes GAM Added option `ignorerole` to `gam update groups|cigroups <GroupEntity> sync [<GroupRole>|ignorerole] ... <UserTypeEntity>` that causes GAM

View File

@ -6305,6 +6305,7 @@ def getItemsToModify(entityType, entity, memberRoles=None, isSuspended=None, isA
result = callGAPIpages(croom.courses().teachers(), 'list', 'teachers', result = callGAPIpages(croom.courses().teachers(), 'list', 'teachers',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, fields='nextPageToken,teachers/profile/emailAddress', courseId=courseId, fields='nextPageToken,teachers/profile/emailAddress',
pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for teacher in result: for teacher in result:
@ -6317,6 +6318,7 @@ def getItemsToModify(entityType, entity, memberRoles=None, isSuspended=None, isA
result = callGAPIpages(croom.courses().students(), 'list', 'students', result = callGAPIpages(croom.courses().students(), 'list', 'students',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, fields='nextPageToken,students/profile/emailAddress', courseId=courseId, fields='nextPageToken,students/profile/emailAddress',
pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for student in result: for student in result:
@ -15850,6 +15852,7 @@ def doCreateAdmin():
throwReasons=[GAPI.INTERNAL_ERROR, GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, throwReasons=[GAPI.INTERNAL_ERROR, GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND,
GAPI.FORBIDDEN, GAPI.CUSTOMER_EXCEEDED_ROLE_ASSIGNMENTS_LIMIT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.FORBIDDEN, GAPI.CUSTOMER_EXCEEDED_ROLE_ASSIGNMENTS_LIMIT, GAPI.SERVICE_NOT_AVAILABLE,
GAPI.INVALID_ORGUNIT, GAPI.DUPLICATE], GAPI.INVALID_ORGUNIT, GAPI.DUPLICATE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='roleAssignmentId,assigneeType') customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='roleAssignmentId,assigneeType')
assigneeType = result.get('assigneeType') assigneeType = result.get('assigneeType')
if assigneeType == 'user': if assigneeType == 'user':
@ -15881,6 +15884,7 @@ def doDeleteAdmin():
throwReasons=[GAPI.NOT_FOUND, GAPI.OPERATION_NOT_SUPPORTED, GAPI.FORBIDDEN, throwReasons=[GAPI.NOT_FOUND, GAPI.OPERATION_NOT_SUPPORTED, GAPI.FORBIDDEN,
GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE,
GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND], GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=GC.Values[GC.CUSTOMER_ID], roleAssignmentId=roleAssignmentId) customer=GC.Values[GC.CUSTOMER_ID], roleAssignmentId=roleAssignmentId)
entityActionPerformed([Ent.ADMIN_ROLE_ASSIGNMENT, roleAssignmentId]) entityActionPerformed([Ent.ADMIN_ROLE_ASSIGNMENT, roleAssignmentId])
except (GAPI.notFound, GAPI.operationNotSupported, GAPI.forbidden, except (GAPI.notFound, GAPI.operationNotSupported, GAPI.forbidden,
@ -20157,6 +20161,7 @@ def _getPeopleOtherContacts(people, entityType, user, i=0, count=0):
results = callGAPIpages(people.otherContacts(), 'list', 'otherContacts', results = callGAPIpages(people.otherContacts(), 'list', 'otherContacts',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageSize=1000, pageSize=1000,
readMask='emailAddresses', fields='nextPageToken,otherContacts(etag,resourceName,emailAddresses(value,type))') readMask='emailAddresses', fields='nextPageToken,otherContacts(etag,resourceName,emailAddresses(value,type))')
otherContacts = {} otherContacts = {}
@ -20179,6 +20184,7 @@ def queryPeopleContacts(people, contactQuery, fields, sortOrder, entityType, use
results = callGAPIpages(people.people().connections(), 'list', 'connections', results = callGAPIpages(people.people().connections(), 'list', 'connections',
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS], pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS],
resourceName='people/me', sources=sources, personFields=fields, resourceName='people/me', sources=sources, personFields=fields,
sortOrder=sortOrder, fields='nextPageToken,connections') sortOrder=sortOrder, fields='nextPageToken,connections')
@ -20211,6 +20217,7 @@ def queryPeopleContacts(people, contactQuery, fields, sortOrder, entityType, use
resourceName=contactQuery['group'], maxMembers=totalItems, groupFields='name') resourceName=contactQuery['group'], maxMembers=totalItems, groupFields='name')
for resourceName in results.get('memberResourceNames', []): for resourceName in results.get('memberResourceNames', []):
result = callGAPI(people.people(), 'get', result = callGAPI(people.people(), 'get',
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=resourceName, sources=sources, personFields=fields) resourceName=resourceName, sources=sources, personFields=fields)
entityList.append(result) entityList.append(result)
@ -20231,6 +20238,7 @@ def queryPeopleOtherContacts(people, contactQuery, fields, entityType, user, i=0
entityList = callGAPIpages(people.otherContacts(), 'list', 'otherContacts', entityList = callGAPIpages(people.otherContacts(), 'list', 'otherContacts',
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS], pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS],
readMask=fields, fields='nextPageToken,otherContacts', sources=sources) readMask=fields, fields='nextPageToken,otherContacts', sources=sources)
else: else:
@ -20347,6 +20355,7 @@ def createUserPeopleContact(users):
try: try:
result = callGAPI(people.people(), 'createContact', result = callGAPI(people.people(), 'createContact',
throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS+[GAPI.INVALID_ARGUMENT], throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS+[GAPI.INVALID_ARGUMENT],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
personFields=','.join(personFields), body=body, sources=sources) personFields=','.join(personFields), body=body, sources=sources)
resourceName = result['resourceName'] resourceName = result['resourceName']
if returnIdOnly: if returnIdOnly:
@ -20465,6 +20474,7 @@ def _clearUpdatePeopleContacts(users, updateContacts):
contact = callGAPI(people.people(), 'get', contact = callGAPI(people.people(), 'get',
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=contact, sources=sources, personFields='emailAddresses,memberships') resourceName=contact, sources=sources, personFields='emailAddresses,memberships')
else: else:
if not localPeopleContactSelects(contactQuery, contact): if not localPeopleContactSelects(contactQuery, contact):
@ -20506,6 +20516,7 @@ def _clearUpdatePeopleContacts(users, updateContacts):
callGAPI(people.people(), 'deleteContact', callGAPI(people.people(), 'deleteContact',
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=resourceName) resourceName=resourceName)
entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount) entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount)
continue continue
@ -20513,6 +20524,7 @@ def _clearUpdatePeopleContacts(users, updateContacts):
updatePersonFields = [PEOPLE_EMAIL_ADDRESSES] updatePersonFields = [PEOPLE_EMAIL_ADDRESSES]
person = callGAPI(people.people(), 'updateContact', person = callGAPI(people.people(), 'updateContact',
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=resourceName, resourceName=resourceName,
updatePersonFields=','.join(updatePersonFields), body=body, sources=sources) updatePersonFields=','.join(updatePersonFields), body=body, sources=sources)
entityActionPerformed([entityType, user, peopleEntityType, person['resourceName']], j, jcount) entityActionPerformed([entityType, user, peopleEntityType, person['resourceName']], j, jcount)
@ -20645,6 +20657,7 @@ def dedupReplaceDomainUserPeopleContacts(users):
contact = callGAPI(people.people(), 'get', contact = callGAPI(people.people(), 'get',
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=contact, sources=sources, personFields='emailAddresses,memberships') resourceName=contact, sources=sources, personFields='emailAddresses,memberships')
else: else:
if action == Act.DEDUP and not localPeopleContactSelects(contactQuery, contact): if action == Act.DEDUP and not localPeopleContactSelects(contactQuery, contact):
@ -20659,6 +20672,7 @@ def dedupReplaceDomainUserPeopleContacts(users):
Act.Set(Act.UPDATE) Act.Set(Act.UPDATE)
callGAPI(people.people(), 'updateContact', callGAPI(people.people(), 'updateContact',
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=resourceName, resourceName=resourceName,
updatePersonFields='emailAddresses', body=contact) updatePersonFields='emailAddresses', body=contact)
entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount) entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount)
@ -20714,6 +20728,7 @@ def deleteUserPeopleContacts(users):
callGAPI(people.people(), 'deleteContact', callGAPI(people.people(), 'deleteContact',
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=resourceName) resourceName=resourceName)
entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount) entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount)
except (GAPI.notFound, GAPI.internalError): except (GAPI.notFound, GAPI.internalError):
@ -20989,6 +21004,7 @@ def _infoPeople(users, entityType, source):
result = callGAPI(people.people(), 'get', result = callGAPI(people.people(), 'get',
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR, GAPI.INVALID_ARGUMENT]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR, GAPI.INVALID_ARGUMENT]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=resourceName, sources=sources, personFields=fields) resourceName=resourceName, sources=sources, personFields=fields)
except (GAPI.notFound, GAPI.internalError): except (GAPI.notFound, GAPI.internalError):
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount) entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
@ -21261,6 +21277,7 @@ def processUserPeopleOtherContacts(users):
try: try:
callGAPI(upeople.people(), 'updateContact', callGAPI(upeople.people(), 'updateContact',
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=peopleResourceName, resourceName=peopleResourceName,
updatePersonFields=','.join(updatePersonFields), body=body, sources=sources) updatePersonFields=','.join(updatePersonFields), body=body, sources=sources)
if action != Act.DELETE: if action != Act.DELETE:
@ -21273,6 +21290,7 @@ def processUserPeopleOtherContacts(users):
callGAPI(upeople.people(), 'deleteContact', callGAPI(upeople.people(), 'deleteContact',
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=peopleResourceName) resourceName=peopleResourceName)
entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount) entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount)
break break
@ -21519,6 +21537,7 @@ def printShowUserPeopleProfiles(users):
try: try:
result = callGAPI(people.people(), 'get', result = callGAPI(people.people(), 'get',
throwReasons=[GAPI.NOT_FOUND]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName='people/me', sources=sources, personFields=fields) resourceName='people/me', sources=sources, personFields=fields)
except GAPI.notFound: except GAPI.notFound:
entityUnknownWarning(Ent.PEOPLE_PROFILE, user, i, count) entityUnknownWarning(Ent.PEOPLE_PROFILE, user, i, count)
@ -21612,6 +21631,7 @@ def _processPeopleContactPhotos(users, function):
result = callGAPI(people.people(), 'get', result = callGAPI(people.people(), 'get',
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=resourceName, sources=sources, personFields='emailAddresses') resourceName=resourceName, sources=sources, personFields='emailAddresses')
if function == 'updateContactPhoto': if function == 'updateContactPhoto':
if subForContactId or subForEmail: if subForContactId or subForEmail:
@ -21630,6 +21650,7 @@ def _processPeopleContactPhotos(users, function):
filename = os.path.join(targetFolder, filename) filename = os.path.join(targetFolder, filename)
result = callGAPI(people.people(), 'get', result = callGAPI(people.people(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=resourceName, personFields='photos') resourceName=resourceName, personFields='photos')
url = None url = None
for photo in result.get('photos', []): for photo in result.get('photos', []):
@ -25372,6 +25393,7 @@ def buildChromeSchemas(cp=None, sfilter=None):
cp = buildGAPIObject(API.CHROMEPOLICY) cp = buildGAPIObject(API.CHROMEPOLICY)
parent = _getCustomersCustomerIdWithC() parent = _getCustomersCustomerIdWithC()
schemas = callGAPIpages(cp.customers().policySchemas(), 'list', 'policySchemas', schemas = callGAPIpages(cp.customers().policySchemas(), 'list', 'policySchemas',
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
parent=parent, filter=sfilter) parent=parent, filter=sfilter)
schema_objects = {} schema_objects = {}
for schema in schemas: for schema in schemas:
@ -25429,6 +25451,7 @@ def doDeleteChromePolicy():
callGAPI(cp.customers().policies().orgunits(), 'batchInherit', callGAPI(cp.customers().policies().orgunits(), 'batchInherit',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED,
GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.QUOTA_EXCEEDED], GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.QUOTA_EXCEEDED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customer, body=body) customer=customer, body=body)
entityActionPerformed(kvList) entityActionPerformed(kvList)
except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable, GAPI.quotaExceeded) as e: except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable, GAPI.quotaExceeded) as e:
@ -25673,6 +25696,7 @@ def doUpdateChromePolicy():
callGAPI(cp.customers().policies().orgunits(), 'batchModify', callGAPI(cp.customers().policies().orgunits(), 'batchModify',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.INVALID_ARGUMENT, throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.INVALID_ARGUMENT,
GAPI.SERVICE_NOT_AVAILABLE, GAPI.QUOTA_EXCEEDED], GAPI.SERVICE_NOT_AVAILABLE, GAPI.QUOTA_EXCEEDED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customer, body=body) customer=customer, body=body)
entityActionPerformed(kvList) entityActionPerformed(kvList)
except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable, GAPI.quotaExceeded) as e: except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable, GAPI.quotaExceeded) as e:
@ -26108,6 +26132,7 @@ def doCreateChromeNetwork():
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.ALREADY_EXISTS, GAPI.PERMISSION_DENIED, GAPI.INVALID_ARGUMENT, throwReasons=[GAPI.ALREADY_EXISTS, GAPI.PERMISSION_DENIED, GAPI.INVALID_ARGUMENT,
GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customer, body=body) customer=customer, body=body)
entityActionPerformed(kvList+[Ent.CHROME_NETWORK_ID, result['networkId']]) entityActionPerformed(kvList+[Ent.CHROME_NETWORK_ID, result['networkId']])
except (GAPI.alreadyExists, GAPI.permissionDenied, GAPI.invalidArgument, except (GAPI.alreadyExists, GAPI.permissionDenied, GAPI.invalidArgument,
@ -26128,6 +26153,7 @@ def doDeleteChromeNetwork():
callGAPI(cp.customers().policies().networks(), 'removeNetwork', callGAPI(cp.customers().policies().networks(), 'removeNetwork',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED,
GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE], GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customer, body=body) customer=customer, body=body)
entityActionPerformed(kvList) entityActionPerformed(kvList)
except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable) as e: except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable) as e:
@ -26185,6 +26211,7 @@ def getCIDeviceEntity():
try: try:
devices = callGAPIpages(ci.devices(), 'list', 'devices', devices = callGAPIpages(ci.devices(), 'list', 'devices',
throwReasons=[GAPI.INVALID, GAPI.PERMISSION_DENIED], throwReasons=[GAPI.INVALID, GAPI.PERMISSION_DENIED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageMessage=pageMessage, pageMessage=pageMessage,
customer=customer, filter=query, customer=customer, filter=query,
fields='nextPageToken,devices(name)', pageSize=100) fields='nextPageToken,devices(name)', pageSize=100)
@ -26219,6 +26246,7 @@ def getCIDeviceUserEntity():
try: try:
deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers', deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers',
throwReasons=[GAPI.INVALID, GAPI.PERMISSION_DENIED], throwReasons=[GAPI.INVALID, GAPI.PERMISSION_DENIED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageMessage=pageMessage, pageMessage=pageMessage,
customer=customer, filter=query, parent='devices/-', customer=customer, filter=query, parent='devices/-',
fields='nextPageToken,deviceUsers(name)', pageSize=20) fields='nextPageToken,deviceUsers(name)', pageSize=20)
@ -26418,6 +26446,7 @@ def doSyncCIDevices():
try: try:
result = callGAPIpages(ci.devices(), 'list', 'devices', result = callGAPIpages(ci.devices(), 'list', 'devices',
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageMessage=pageMessage, pageMessage=pageMessage,
customer=customer, filter=query, view='COMPANY_INVENTORY', customer=customer, filter=query, view='COMPANY_INVENTORY',
fields=fields, pageSize=100) fields=fields, pageSize=100)
@ -26686,6 +26715,7 @@ def doPrintCIDevices():
devices = callGAPIpages(ci.devices(), 'list', 'devices', devices = callGAPIpages(ci.devices(), 'list', 'devices',
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customer, filter=query, customer=customer, filter=query,
orderBy=OBY.orderBy, view=view, fields=fields, pageSize=100) orderBy=OBY.orderBy, view=view, fields=fields, pageSize=100)
except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied) as e: except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied) as e:
@ -26702,6 +26732,7 @@ def doPrintCIDevices():
deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers', deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers',
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customer, filter=query, parent=parent, customer=customer, filter=query, parent=parent,
orderBy=OBY.orderBy, fields=userFields, pageSize=20) orderBy=OBY.orderBy, fields=userFields, pageSize=20)
for deviceUser in deviceUsers: for deviceUser in deviceUsers:
@ -26863,6 +26894,7 @@ def doPrintCIDeviceUsers():
deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers', deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers',
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customer, filter=query, customer=customer, filter=query,
orderBy=OBY.orderBy, parent=parent, fields=userFields, pageSize=20) orderBy=OBY.orderBy, parent=parent, fields=userFields, pageSize=20)
for deviceUser in deviceUsers: for deviceUser in deviceUsers:
@ -27493,6 +27525,7 @@ def doPrintShowChromeApps():
try: try:
apps = callGAPIpages(cm.customers().reports(), 'countInstalledApps', 'installedApps', apps = callGAPIpages(cm.customers().reports(), 'countInstalledApps', 'installedApps',
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageMessage=pageMessage, pageMessage=pageMessage,
customer=customerId, orgUnitId=orgUnitId, filter=pfilter, orderBy=orderBy) customer=customerId, orgUnitId=orgUnitId, filter=pfilter, orderBy=orderBy)
except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e: except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e:
@ -27640,6 +27673,7 @@ def doPrintShowChromeAppDevices():
try: try:
devices = callGAPIpages(cm.customers().reports(), 'findInstalledAppDevices', 'devices', devices = callGAPIpages(cm.customers().reports(), 'findInstalledAppDevices', 'devices',
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageMessage=pageMessage, pageMessage=pageMessage,
appId=appId, appType=appType, appId=appId, appType=appType,
customer=customerId, orgUnitId=orgUnitId, filter=pfilter, orderBy=orderBy) customer=customerId, orgUnitId=orgUnitId, filter=pfilter, orderBy=orderBy)
@ -27758,6 +27792,7 @@ def doPrintShowChromeAues():
try: try:
aues = callGAPI(cm.customers().reports(), 'countChromeDevicesReachingAutoExpirationDate', aues = callGAPI(cm.customers().reports(), 'countChromeDevicesReachingAutoExpirationDate',
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customerId, orgUnitId=orgUnitId, minAueDate=minAueDate, maxAueDate=maxAueDate).get('deviceAueCountReports', []) customer=customerId, orgUnitId=orgUnitId, minAueDate=minAueDate, maxAueDate=maxAueDate).get('deviceAueCountReports', [])
except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e: except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e:
entityActionFailedWarning([Ent.CHROME_MODEL, None], str(e)) entityActionFailedWarning([Ent.CHROME_MODEL, None], str(e))
@ -27863,6 +27898,7 @@ def doPrintShowChromeNeedsAttn():
try: try:
result = callGAPI(cm.customers().reports(), 'countChromeDevicesThatNeedAttention', result = callGAPI(cm.customers().reports(), 'countChromeDevicesThatNeedAttention',
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=customerId, orgUnitId=orgUnitId, readMask=','.join(CHROME_NEEDSATTN_TITLES)) customer=customerId, orgUnitId=orgUnitId, readMask=','.join(CHROME_NEEDSATTN_TITLES))
for field in CHROME_NEEDSATTN_TITLES: for field in CHROME_NEEDSATTN_TITLES:
result.setdefault(field, 0) result.setdefault(field, 0)
@ -27988,6 +28024,7 @@ def doPrintShowChromeVersions():
try: try:
versions = callGAPIpages(cm.customers().reports(), 'countChromeVersions', 'browserVersions', versions = callGAPIpages(cm.customers().reports(), 'countChromeVersions', 'browserVersions',
throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
pageMessage=pageMessage, pageMessage=pageMessage,
customer=customerId, orgUnitId=orgUnitId, filter=pfilter) customer=customerId, orgUnitId=orgUnitId, filter=pfilter)
except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e: except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e:
@ -31286,6 +31323,7 @@ def doPrintGroupMembers():
try: try:
info = callGAPI(people.people(), 'get', info = callGAPI(people.people(), 'get',
throwReasons=[GAPI.NOT_FOUND]+GAPI.PEOPLE_ACCESS_THROW_REASONS, throwReasons=[GAPI.NOT_FOUND]+GAPI.PEOPLE_ACCESS_THROW_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName=f'people/{memberId}', personFields='names') resourceName=f'people/{memberId}', personFields='names')
if 'names' in info: if 'names' in info:
for sourceType in ['PROFILE', 'CONTACT']: for sourceType in ['PROFILE', 'CONTACT']:
@ -31451,6 +31489,7 @@ def doPrintGroupMembers():
try: try:
mbinfo = callGAPI(cd.users(), 'get', mbinfo = callGAPI(cd.users(), 'get',
throwReasons=GAPI.USER_GET_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.USER_GET_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
userKey=memberId, fields=userFields) userKey=memberId, fields=userFields)
if memberOptions[MEMBEROPTION_MEMBERNAMES]: if memberOptions[MEMBEROPTION_MEMBERNAMES]:
row['name'] = mbinfo['name'].pop('fullName') row['name'] = mbinfo['name'].pop('fullName')
@ -34132,6 +34171,7 @@ def doCreateResourceCalendar():
callGAPI(cd.resources().calendars(), 'insert', callGAPI(cd.resources().calendars(), 'insert',
throwReasons=[GAPI.INVALID, GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE, throwReasons=[GAPI.INVALID, GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE,
GAPI.REQUIRED, GAPI.DUPLICATE, GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN], GAPI.REQUIRED, GAPI.DUPLICATE, GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='') customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='')
entityActionPerformed([Ent.RESOURCE_CALENDAR, body['resourceId']]) entityActionPerformed([Ent.RESOURCE_CALENDAR, body['resourceId']])
except (GAPI.invalid, GAPI.invalidInput, GAPI.serviceNotAvailable) as e: except (GAPI.invalid, GAPI.invalidInput, GAPI.serviceNotAvailable) as e:
@ -34160,6 +34200,7 @@ def _doUpdateResourceCalendars(entityList):
if featureChanges['add'] or featureChanges['remove']: if featureChanges['add'] or featureChanges['remove']:
features = callGAPI(cd.resources().calendars(), 'get', features = callGAPI(cd.resources().calendars(), 'get',
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.SERVICE_NOT_AVAILABLE, GAPI.FORBIDDEN], throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.SERVICE_NOT_AVAILABLE, GAPI.FORBIDDEN],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId, fields='featureInstances(feature(name))') customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId, fields='featureInstances(feature(name))')
bodyFeatures = body.pop('featureInstances', []) bodyFeatures = body.pop('featureInstances', [])
body['featureInstances'] = [] body['featureInstances'] = []
@ -34183,6 +34224,7 @@ def _doUpdateResourceCalendars(entityList):
callGAPI(cd.resources().calendars(), 'patch', callGAPI(cd.resources().calendars(), 'patch',
throwReasons=[GAPI.INVALID, GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.REQUIRED, throwReasons=[GAPI.INVALID, GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.REQUIRED,
GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN], GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId, body=body, fields='') customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId, body=body, fields='')
entityActionPerformed([Ent.RESOURCE_CALENDAR, resourceId], i, count) entityActionPerformed([Ent.RESOURCE_CALENDAR, resourceId], i, count)
except (GAPI.invalid, GAPI.invalidInput, GAPI.serviceNotAvailable, GAPI.required) as e: except (GAPI.invalid, GAPI.invalidInput, GAPI.serviceNotAvailable, GAPI.required) as e:
@ -34208,6 +34250,7 @@ def _doDeleteResourceCalendars(entityList):
try: try:
callGAPI(cd.resources().calendars(), 'delete', callGAPI(cd.resources().calendars(), 'delete',
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN], throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId) customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId)
entityActionPerformed([Ent.RESOURCE_CALENDAR, resourceId], i, count) entityActionPerformed([Ent.RESOURCE_CALENDAR, resourceId], i, count)
except GAPI.serviceNotAvailable as e: except GAPI.serviceNotAvailable as e:
@ -40445,6 +40488,7 @@ def doCreateUser():
callGAPI(parameters['lic'].licenseAssignments(), 'insert', callGAPI(parameters['lic'].licenseAssignments(), 'insert',
throwReasons=[GAPI.INTERNAL_ERROR, GAPI.DUPLICATE, GAPI.CONDITION_NOT_MET, GAPI.INVALID, throwReasons=[GAPI.INTERNAL_ERROR, GAPI.DUPLICATE, GAPI.CONDITION_NOT_MET, GAPI.INVALID,
GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
productId=productId, skuId=skuId, body={'userId': user}, fields='') productId=productId, skuId=skuId, body={'userId': user}, fields='')
entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)]) entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)])
except (GAPI.internalError, GAPI.duplicate, GAPI.conditionNotMet, GAPI.invalid, except (GAPI.internalError, GAPI.duplicate, GAPI.conditionNotMet, GAPI.invalid,
@ -42216,7 +42260,7 @@ def _getInboundSSOProfiles(ci):
filter=f'customer=="{customer}"') filter=f'customer=="{customer}"')
except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis,
GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.forbidden, GAPI.badRequest, GAPI.invalid,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, customer], str(e)) entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, customer], str(e))
return [] return []
@ -42304,7 +42348,7 @@ def doCreateInboundSSOProfile():
_processInboundSSOProfileResult(result, returnNameOnly, kvlist, 'create') _processInboundSSOProfileResult(result, returnNameOnly, kvlist, 'create')
except (GAPI.failedPrecondition, GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.failedPrecondition, GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
# gam update inboundssoprofile <SSOProfileItem> # gam update inboundssoprofile <SSOProfileItem>
@ -42325,7 +42369,7 @@ def doUpdateInboundSSOProfile():
entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST)
except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
# gam delete inboundssoprofile <SSOProfileItem> # gam delete inboundssoprofile <SSOProfileItem>
@ -42344,7 +42388,7 @@ def doDeleteInboundSSOProfile():
entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST)
except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
def _getInboundSSOProfile(ci, name): def _getInboundSSOProfile(ci, name):
@ -42357,7 +42401,7 @@ def _getInboundSSOProfile(ci, name):
except GAPI.notFound: except GAPI.notFound:
entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST)
except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
return None return None
@ -42419,7 +42463,7 @@ def getInboundSSOProfileCredentials(ci, profile):
parent=profile) parent=profile)
except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis,
GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.forbidden, GAPI.badRequest, GAPI.invalid,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, profile], str(e)) entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, profile], str(e))
return None return None
@ -42515,7 +42559,7 @@ def doCreateInboundSSOCredential():
entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, profile], str(e)) entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, profile], str(e))
except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
# gam delete inboundssocredential <SSOCredentialsName> # gam delete inboundssocredential <SSOCredentialsName>
@ -42536,7 +42580,7 @@ def doDeleteInboundSSOCredential(ci=None, name=None):
entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST)
except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
# gam info inboundssocredential <SSOCredentialsName> [formatjson] # gam info inboundssocredential <SSOCredentialsName> [formatjson]
@ -42554,7 +42598,7 @@ def doInfoInboundSSOCredential():
except GAPI.notFound: except GAPI.notFound:
entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST)
except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
# gam show inboundssocredentials [profile|profiles <SSOProfileItemList>] # gam show inboundssocredentials [profile|profiles <SSOProfileItemList>]
@ -42613,7 +42657,7 @@ def _getInboundSSOAssignment(ci, name):
except GAPI.notFound: except GAPI.notFound:
entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST)
except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
return None return None
@ -42626,7 +42670,7 @@ def _getInboundSSOAssignments(ci):
filter=f'customer=="{customer}"') filter=f'customer=="{customer}"')
except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis,
GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.forbidden, GAPI.badRequest, GAPI.invalid,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning([Ent.INBOUND_SSO_ASSIGNMENT, customer], str(e)) entityActionFailedWarning([Ent.INBOUND_SSO_ASSIGNMENT, customer], str(e))
return None return None
@ -42738,7 +42782,7 @@ def doCreateInboundSSOAssignment():
_processInboundSSOAssignmentResult(result, kvlist, ci, cd, 'create') _processInboundSSOAssignmentResult(result, kvlist, ci, cd, 'create')
except (GAPI.failedPrecondition, GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.failedPrecondition, GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
# gam update inboundssoassignment [(group <GroupItem> rank <Number>)|(ou|org|orgunit <OrgUnitItem>)] # gam update inboundssoassignment [(group <GroupItem> rank <Number>)|(ou|org|orgunit <OrgUnitItem>)]
@ -42759,7 +42803,7 @@ def doUpdateInboundSSOAssignment():
entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST)
except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
# gam delete inboundssoassignment <SSOAssignmentSelector> # gam delete inboundssoassignment <SSOAssignmentSelector>
@ -42783,7 +42827,7 @@ def doDeleteInboundSSOAssignment():
entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST)
except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument,
GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e:
entityActionFailedWarning(kvlist, str(e)) entityActionFailedWarning(kvlist, str(e))
# gam info inboundssoassignment <SSOAssignmentSelector> [formatjson] # gam info inboundssoassignment <SSOAssignmentSelector> [formatjson]
@ -43012,6 +43056,7 @@ def checkCourseExists(croom, courseId, i=0, count=0, entityType=Ent.COURSE):
try: try:
result = callGAPI(croom.courses(), 'get', result = callGAPI(croom.courses(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
id=courseId, fields='id,ownerId') id=courseId, fields='id,ownerId')
return result return result
except GAPI.notFound: except GAPI.notFound:
@ -43245,6 +43290,7 @@ class CourseAttributes():
self.courseAnnouncements = callGAPIpages(self.croom.courses().announcements(), 'list', 'announcements', self.courseAnnouncements = callGAPIpages(self.croom.courses().announcements(), 'list', 'announcements',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=self.courseId, announcementStates=self.announcementStates, courseId=self.courseId, announcementStates=self.announcementStates,
pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for courseAnnouncement in self.courseAnnouncements: for courseAnnouncement in self.courseAnnouncements:
@ -43261,6 +43307,7 @@ class CourseAttributes():
self.courseMaterials = callGAPIpages(self.croom.courses().courseWorkMaterials(), 'list', 'courseWorkMaterial', self.courseMaterials = callGAPIpages(self.croom.courses().courseWorkMaterials(), 'list', 'courseWorkMaterial',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=self.courseId, courseWorkMaterialStates=self.materialStates, courseId=self.courseId, courseWorkMaterialStates=self.materialStates,
pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for courseMaterial in self.courseMaterials: for courseMaterial in self.courseMaterials:
@ -43281,6 +43328,7 @@ class CourseAttributes():
self.courseWorks = callGAPIpages(self.croom.courses().courseWork(), 'list', 'courseWork', self.courseWorks = callGAPIpages(self.croom.courses().courseWork(), 'list', 'courseWork',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=self.courseId, courseWorkStates=self.workStates, courseId=self.courseId, courseWorkStates=self.workStates,
pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for courseWork in self.courseWorks: for courseWork in self.courseWorks:
@ -43304,6 +43352,7 @@ class CourseAttributes():
courseTopics = callGAPIpages(self.croom.courses().topics(), 'list', 'topic', courseTopics = callGAPIpages(self.croom.courses().topics(), 'list', 'topic',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=self.courseId, fields='nextPageToken,topic(topicId,name)', courseId=self.courseId, fields='nextPageToken,topic(topicId,name)',
pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for topic in courseTopics: for topic in courseTopics:
@ -43391,6 +43440,7 @@ class CourseAttributes():
try: try:
newCourseTopics = callGAPIpages(self.croom.courses().topics(), 'list', 'topic', newCourseTopics = callGAPIpages(self.croom.courses().topics(), 'list', 'topic',
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.FAILED_PRECONDITION, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.FAILED_PRECONDITION, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=newCourseId, fields='nextPageToken,topic(topicId,name)', courseId=newCourseId, fields='nextPageToken,topic(topicId,name)',
pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
newTopicsByName = {} newTopicsByName = {}
@ -43413,6 +43463,7 @@ class CourseAttributes():
try: try:
result = callGAPI(tcroom.courses().topics(), 'create', result = callGAPI(tcroom.courses().topics(), 'create',
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.FAILED_PRECONDITION, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.FAILED_PRECONDITION, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=newCourseId, body={'name': topicName}, fields='topicId') courseId=newCourseId, body={'name': topicName}, fields='topicId')
newTopicsByName[topicName] = result['topicId'] newTopicsByName[topicName] = result['topicId']
entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_TOPIC, topicName], Act.MODIFIER_FROM, entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_TOPIC, topicName], Act.MODIFIER_FROM,
@ -43440,6 +43491,7 @@ class CourseAttributes():
result = callGAPI(tcroom.courses().announcements(), 'create', result = callGAPI(tcroom.courses().announcements(), 'create',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN, throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN,
GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=newCourseId, body=body, fields='id') courseId=newCourseId, body=body, fields='id')
entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_ANNOUNCEMENT_ID, result['id']], Act.MODIFIER_FROM, entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_ANNOUNCEMENT_ID, result['id']], Act.MODIFIER_FROM,
[Ent.COURSE, self.courseId, Ent.COURSE_ANNOUNCEMENT_ID, courseAnnouncementId], j, jcount) [Ent.COURSE, self.courseId, Ent.COURSE_ANNOUNCEMENT_ID, courseAnnouncementId], j, jcount)
@ -43475,6 +43527,7 @@ class CourseAttributes():
result = callGAPI(tcroom.courses().courseWorkMaterials(), 'create', result = callGAPI(tcroom.courses().courseWorkMaterials(), 'create',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN, throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN,
GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=newCourseId, body=body, fields='id') courseId=newCourseId, body=body, fields='id')
entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_MATERIAL_ID, result['id']], Act.MODIFIER_FROM, entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_MATERIAL_ID, result['id']], Act.MODIFIER_FROM,
[Ent.COURSE, self.courseId, Ent.COURSE_MATERIAL_ID, courseMaterialId], j, jcount) [Ent.COURSE, self.courseId, Ent.COURSE_MATERIAL_ID, courseMaterialId], j, jcount)
@ -43515,6 +43568,7 @@ class CourseAttributes():
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN, throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN,
GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR, GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR,
GAPI.INTERNAL_ERROR, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE], GAPI.INTERNAL_ERROR, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=newCourseId, body=body, fields='id') courseId=newCourseId, body=body, fields='id')
entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_WORK_ID, result['id']], Act.MODIFIER_FROM, entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_WORK_ID, result['id']], Act.MODIFIER_FROM,
[Ent.COURSE, self.courseId, Ent.COURSE_WORK, f'{body.get("title", courseWorkId)}'], j, jcount) [Ent.COURSE, self.courseId, Ent.COURSE_WORK, f'{body.get("title", courseWorkId)}'], j, jcount)
@ -43560,6 +43614,7 @@ def doCreateCourse():
result = callGAPI(croom.courses(), 'create', result = callGAPI(croom.courses(), 'create',
throwReasons=[GAPI.ALREADY_EXISTS, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, throwReasons=[GAPI.ALREADY_EXISTS, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED,
GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
body=courseAttributes.body, fields='id,name,ownerId,courseState,teacherFolder(id)') body=courseAttributes.body, fields='id,name,ownerId,courseState,teacherFolder(id)')
entityActionPerformed([Ent.COURSE_NAME, result['name'], Ent.COURSE, result['id']]) entityActionPerformed([Ent.COURSE_NAME, result['name'], Ent.COURSE, result['id']])
if courseAttributes.courseId: if courseAttributes.courseId:
@ -43589,10 +43644,12 @@ def _doUpdateCourses(entityList):
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION, throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION,
GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.INVALID_ARGUMENT, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.INVALID_ARGUMENT,
GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
id=courseId, body=body, updateMask=','.join(list(body)), fields='id,name,ownerId,courseState,teacherFolder(id)') id=courseId, body=body, updateMask=','.join(list(body)), fields='id,name,ownerId,courseState,teacherFolder(id)')
else: else:
result = callGAPI(croom.courses(), 'get', result = callGAPI(croom.courses(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
id=courseId, fields='id,name,ownerId,courseState,teacherFolder(id)') id=courseId, fields='id,name,ownerId,courseState,teacherFolder(id)')
if courseAttributes.body: if courseAttributes.body:
if not newOwner: if not newOwner:
@ -43622,6 +43679,7 @@ def _doUpdateCourses(entityList):
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR,
GAPI.ALREADY_EXISTS, GAPI.FAILED_PRECONDITION, GAPI.ALREADY_EXISTS, GAPI.FAILED_PRECONDITION,
GAPI.QUOTA_EXCEEDED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.QUOTA_EXCEEDED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, body={'userId': newOwner}, fields='') courseId=courseId, body={'userId': newOwner}, fields='')
modifier = Act.MODIFIER_WITH_NEW_TEACHER_OWNER modifier = Act.MODIFIER_WITH_NEW_TEACHER_OWNER
time.sleep(10) time.sleep(10)
@ -43688,6 +43746,7 @@ def _doDeleteCourses(entityList):
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION, throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION,
GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.INVALID_ARGUMENT, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.INVALID_ARGUMENT,
GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
id=courseId, body=body, updateMask=updateMask, fields='') id=courseId, body=body, updateMask=updateMask, fields='')
callGAPI(croom.courses(), 'delete', callGAPI(croom.courses(), 'delete',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION, GAPI.INTERNAL_ERROR], throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION, GAPI.INTERNAL_ERROR],
@ -43839,6 +43898,7 @@ def _convertCourseUserIdToEmail(croom, userId, emails, entityValueList, i, count
try: try:
userEmail = callGAPI(croom.userProfiles(), 'get', userEmail = callGAPI(croom.userProfiles(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
userId=userId, fields='emailAddress').get('emailAddress') userId=userId, fields='emailAddress').get('emailAddress')
except (GAPI.notFound, GAPI.permissionDenied, GAPI.badRequest, GAPI.forbidden, GAPI.serviceNotAvailable): except (GAPI.notFound, GAPI.permissionDenied, GAPI.badRequest, GAPI.forbidden, GAPI.serviceNotAvailable):
pass pass
@ -43865,6 +43925,7 @@ def _getCourseAliasesMembers(croom, courseId, courseShowProperties, teachersFiel
aliases = callGAPIpages(croom.courses().aliases(), 'list', 'aliases', aliases = callGAPIpages(croom.courses().aliases(), 'list', 'aliases',
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE, GAPI.NOT_IMPLEMENTED], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE, GAPI.NOT_IMPLEMENTED],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) courseId=courseId, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.notImplemented): except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.notImplemented):
pass pass
@ -43878,6 +43939,7 @@ def _getCourseAliasesMembers(croom, courseId, courseShowProperties, teachersFiel
teachers = callGAPIpages(croom.courses().teachers(), 'list', 'teachers', teachers = callGAPIpages(croom.courses().teachers(), 'list', 'teachers',
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, fields=teachersFields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) courseId=courseId, fields=teachersFields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
except (GAPI.notFound, GAPI.serviceNotAvailable): except (GAPI.notFound, GAPI.serviceNotAvailable):
pass pass
@ -43890,6 +43952,7 @@ def _getCourseAliasesMembers(croom, courseId, courseShowProperties, teachersFiel
students = callGAPIpages(croom.courses().students(), 'list', 'students', students = callGAPIpages(croom.courses().students(), 'list', 'students',
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, fields=studentsFields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) courseId=courseId, fields=studentsFields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
except (GAPI.notFound, GAPI.serviceNotAvailable): except (GAPI.notFound, GAPI.serviceNotAvailable):
pass pass
@ -43927,6 +43990,7 @@ def _doInfoCourses(entityList):
try: try:
course = callGAPI(croom.courses(), 'get', course = callGAPI(croom.courses(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
id=courseId, fields=fields) id=courseId, fields=fields)
if courseShowProperties['ownerEmail']: if courseShowProperties['ownerEmail']:
course['ownerEmail'] = _convertCourseUserIdToEmail(croom, course['ownerId'], ownerEmails, course['ownerEmail'] = _convertCourseUserIdToEmail(croom, course['ownerId'], ownerEmails,
@ -44075,6 +44139,7 @@ def _getCoursesInfo(croom, courseSelectionParameters, courseShowProperties, getO
return callGAPIpages(croom.courses(), 'list', 'courses', return callGAPIpages(croom.courses(), 'list', 'courses',
pageMessage=getPageMessage(), pageMessage=getPageMessage(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.BAD_REQUEST, GAPI.INVALID, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.BAD_REQUEST, GAPI.INVALID, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
teacherId=courseSelectionParameters['teacherId'], teacherId=courseSelectionParameters['teacherId'],
studentId=courseSelectionParameters['studentId'], studentId=courseSelectionParameters['studentId'],
courseStates=courseSelectionParameters['courseStates'], courseStates=courseSelectionParameters['courseStates'],
@ -44096,6 +44161,7 @@ def _getCoursesInfo(croom, courseSelectionParameters, courseShowProperties, getO
try: try:
info = callGAPI(croom.courses(), 'get', info = callGAPI(croom.courses(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
id=courseId, fields=fields) id=courseId, fields=fields)
coursesInfo.append(info) coursesInfo.append(info)
except GAPI.notFound: except GAPI.notFound:
@ -44354,6 +44420,7 @@ def doPrintCourseAnnouncements():
results = callGAPIpages(croom.courses().announcements(), 'list', 'announcements', results = callGAPIpages(croom.courses().announcements(), 'list', 'announcements',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, announcementStates=courseAnnouncementStates, orderBy=OBY.orderBy, courseId=courseId, announcementStates=courseAnnouncementStates, orderBy=OBY.orderBy,
fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for courseAnnouncement in results: for courseAnnouncement in results:
@ -44371,6 +44438,7 @@ def doPrintCourseAnnouncements():
try: try:
courseAnnouncement = callGAPI(croom.courses().announcements(), 'get', courseAnnouncement = callGAPI(croom.courses().announcements(), 'get',
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, id=courseAnnouncementId, fields=fields) courseId=courseId, id=courseAnnouncementId, fields=fields)
_printCourseAnnouncement(course, courseAnnouncement, i, count) _printCourseAnnouncement(course, courseAnnouncement, i, count)
except GAPI.notFound: except GAPI.notFound:
@ -44439,6 +44507,7 @@ def doPrintCourseTopics():
results = callGAPIpages(croom.courses().topics(), 'list', 'topic', results = callGAPIpages(croom.courses().topics(), 'list', 'topic',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, courseId=courseId,
fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for courseTopic in results: for courseTopic in results:
@ -44456,6 +44525,7 @@ def doPrintCourseTopics():
try: try:
courseTopic = callGAPI(croom.courses().topics(), 'get', courseTopic = callGAPI(croom.courses().topics(), 'get',
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, id=courseTopicId, fields=fields) courseId=courseId, id=courseTopicId, fields=fields)
_printCourseTopic(course, courseTopic) _printCourseTopic(course, courseTopic)
except GAPI.notFound: except GAPI.notFound:
@ -44540,6 +44610,7 @@ def doPrintCourseWM(entityIDType, entityStateType):
try: try:
results = callGAPIpages(croom.courses().topics(), 'list', 'topic', results = callGAPIpages(croom.courses().topics(), 'list', 'topic',
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, courseId=courseId,
fields='nextPageToken,topic(topicId,name)', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) fields='nextPageToken,topic(topicId,name)', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for courseTopic in results: for courseTopic in results:
@ -44751,6 +44822,7 @@ def doPrintCourseSubmissions():
try: try:
userProfile = callGAPI(tcroom.userProfiles(), 'get', userProfile = callGAPI(tcroom.userProfiles(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
userId=userId, fields='emailAddress,name') userId=userId, fields='emailAddress,name')
userProfiles[userId] = {'profile': {'emailAddress': userProfile.get('emailAddress', ''), 'name': userProfile['name']}} userProfiles[userId] = {'profile': {'emailAddress': userProfile.get('emailAddress', ''), 'name': userProfile['name']}}
except (GAPI.notFound, GAPI.permissionDenied, GAPI.serviceNotAvailable): except (GAPI.notFound, GAPI.permissionDenied, GAPI.serviceNotAvailable):
@ -44837,6 +44909,7 @@ def doPrintCourseSubmissions():
results = callGAPIpages(croom.courses().courseWork(), 'list', 'courseWork', results = callGAPIpages(croom.courses().courseWork(), 'list', 'courseWork',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, courseWorkStates=courseWMSelectionParameters['courseWMStates'], orderBy=OBY.orderBy, courseId=courseId, courseWorkStates=courseWMSelectionParameters['courseWMStates'], orderBy=OBY.orderBy,
fields='nextPageToken,courseWork(id)', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) fields='nextPageToken,courseWork(id)', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
courseWorkIdsForCourse = [courseWork['id'] for courseWork in results] courseWorkIdsForCourse = [courseWork['id'] for courseWork in results]
@ -44861,6 +44934,7 @@ def doPrintCourseSubmissions():
results = callGAPIpages(croom.courses().courseWork().studentSubmissions(), 'list', 'studentSubmissions', results = callGAPIpages(croom.courses().courseWork().studentSubmissions(), 'list', 'studentSubmissions',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, courseWorkId=courseWorkId, states=courseSubmissionStates, late=late, userId=courseSelectionParameters['studentId'], courseId=courseId, courseWorkId=courseWorkId, states=courseSubmissionStates, late=late, userId=courseSelectionParameters['studentId'],
fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS])
for submission in results: for submission in results:
@ -44885,6 +44959,7 @@ def doPrintCourseSubmissions():
try: try:
submission = callGAPI(croom.courses().courseWork().studentSubmissions(), 'get', submission = callGAPI(croom.courses().courseWork().studentSubmissions(), 'get',
throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
courseId=courseId, courseWorkId=courseWorkId, id=courseSubmissionId, courseId=courseId, courseWorkId=courseWorkId, id=courseSubmissionId,
fields=fields) fields=fields)
_printCourseSubmission(course, submission) _printCourseSubmission(course, submission)
@ -45119,6 +45194,7 @@ def _getCoursesOwnerInfo(croom, courseIds, coursesInfo, useAdminAccess):
try: try:
info = callGAPI(croom.courses(), 'get', info = callGAPI(croom.courses(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
id=courseId, fields='name,ownerId') id=courseId, fields='name,ownerId')
if not useAdminAccess: if not useAdminAccess:
_, ocroom = buildGAPIServiceObject(API.CLASSROOM, f'uid:{info["ownerId"]}') _, ocroom = buildGAPIServiceObject(API.CLASSROOM, f'uid:{info["ownerId"]}')
@ -45396,6 +45472,7 @@ def _inviteGuardian(croom, studentId, guardianEmail, i=0, count=0, j=0, jcount=0
throwReasons=[GAPI.NOT_FOUND, GAPI.ALREADY_EXISTS, throwReasons=[GAPI.NOT_FOUND, GAPI.ALREADY_EXISTS,
GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN,
GAPI.PERMISSION_DENIED, GAPI.RESOURCE_EXHAUSTED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.PERMISSION_DENIED, GAPI.RESOURCE_EXHAUSTED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, body=body, fields='invitationId') studentId=studentId, body=body, fields='invitationId')
entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN, body['invitedEmailAddress'], Ent.GUARDIAN_INVITATION, result['invitationId']], j, jcount) entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN, body['invitedEmailAddress'], Ent.GUARDIAN_INVITATION, result['invitationId']], j, jcount)
return 1 return 1
@ -45444,6 +45521,7 @@ def _cancelGuardianInvitation(croom, studentId, invitationId, i=0, count=0, j=0,
throwReasons=[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION, throwReasons=[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION,
GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN,
GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, invitationId=invitationId, updateMask='state', body={'state': 'COMPLETE'}, fields='invitedEmailAddress') studentId=studentId, invitationId=invitationId, updateMask='state', body={'state': 'COMPLETE'}, fields='invitedEmailAddress')
entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN_INVITATION, result['invitedEmailAddress']], j, jcount) entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN_INVITATION, result['invitedEmailAddress']], j, jcount)
return 1 return 1
@ -45490,6 +45568,7 @@ def _deleteGuardian(croom, studentId, guardianId, guardianEmail, i, count, j, jc
try: try:
callGAPI(croom.userProfiles().guardians(), 'delete', callGAPI(croom.userProfiles().guardians(), 'delete',
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, guardianId=guardianId) studentId=studentId, guardianId=guardianId)
entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN, guardianEmail], j, jcount) entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN, guardianEmail], j, jcount)
return 1 return 1
@ -45514,6 +45593,7 @@ def _doDeleteGuardian(croom, studentId, guardianId, guardianClass, i=0, count=0,
invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations', invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, invitedEmailAddress=guardianId, states=['PENDING'], studentId=studentId, invitedEmailAddress=guardianId, states=['PENDING'],
fields='nextPageToken,guardianInvitations(studentId,invitationId)') fields='nextPageToken,guardianInvitations(studentId,invitationId)')
for invitation in invitations: for invitation in invitations:
@ -45532,6 +45612,7 @@ def _doDeleteGuardian(croom, studentId, guardianId, guardianClass, i=0, count=0,
guardians = callGAPIpages(croom.userProfiles().guardians(), 'list', 'guardians', guardians = callGAPIpages(croom.userProfiles().guardians(), 'list', 'guardians',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, invitedEmailAddress=guardianId, studentId=studentId, invitedEmailAddress=guardianId,
fields='nextPageToken,guardians(studentId,guardianId)') fields='nextPageToken,guardians(studentId,guardianId)')
for guardian in guardians: for guardian in guardians:
@ -45601,6 +45682,7 @@ def clearGuardians(users):
invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations', invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, states=['PENDING'], fields='nextPageToken,guardianInvitations(invitationId)') studentId=studentId, states=['PENDING'], fields='nextPageToken,guardianInvitations(invitationId)')
Act.Set(Act.CANCEL) Act.Set(Act.CANCEL)
jcount = len(invitations) jcount = len(invitations)
@ -45646,10 +45728,12 @@ def syncGuardians(users):
invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations', invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, states=['PENDING'], fields='nextPageToken,guardianInvitations(invitationId,invitedEmailAddress)') studentId=studentId, states=['PENDING'], fields='nextPageToken,guardianInvitations(invitationId,invitedEmailAddress)')
guardians = callGAPIpages(croom.userProfiles().guardians(), 'list', 'guardians', guardians = callGAPIpages(croom.userProfiles().guardians(), 'list', 'guardians',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, fields='nextPageToken,guardians(guardianId,invitedEmailAddress)') studentId=studentId, fields='nextPageToken,guardians(guardianId,invitedEmailAddress)')
except GAPI.notFound: except GAPI.notFound:
entityUnknownWarning(Ent.STUDENT, studentId, i, count) entityUnknownWarning(Ent.STUDENT, studentId, i, count)
@ -45694,6 +45778,7 @@ def _getCourseName(croom, courseNames, courseId):
courseName = callGAPI(croom.courses(), 'get', courseName = callGAPI(croom.courses(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
id=courseId, fields='name')['name'] id=courseId, fields='name')['name']
except (GAPI.notFound, GAPI.invalidArgument, GAPI.badRequest, GAPI.forbidden, GAPI.permissionDenied, GAPI.serviceNotAvailable): except (GAPI.notFound, GAPI.invalidArgument, GAPI.badRequest, GAPI.forbidden, GAPI.permissionDenied, GAPI.serviceNotAvailable):
pass pass
@ -45711,6 +45796,7 @@ def _getClassroomEmail(croom, classroomEmails, userId, user):
userEmail = callGAPI(croom.userProfiles(), 'get', userEmail = callGAPI(croom.userProfiles(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN,
GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
userId=userId, fields='emailAddress').get('emailAddress') userId=userId, fields='emailAddress').get('emailAddress')
except (GAPI.notFound, GAPI.invalidArgument, GAPI.badRequest, GAPI.forbidden, GAPI.permissionDenied, GAPI.serviceNotAvailable): except (GAPI.notFound, GAPI.invalidArgument, GAPI.badRequest, GAPI.forbidden, GAPI.permissionDenied, GAPI.serviceNotAvailable):
pass pass
@ -45810,6 +45896,7 @@ def _printShowGuardians(entityList=None):
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, invitedEmailAddress=invitedEmailAddress, states=states) studentId=studentId, invitedEmailAddress=invitedEmailAddress, states=states)
jcount = len(invitations) jcount = len(invitations)
if not csvPF: if not csvPF:
@ -45852,6 +45939,7 @@ def _printShowGuardians(entityList=None):
pageMessage=pageMessage, pageMessage=pageMessage,
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
studentId=studentId, invitedEmailAddress=invitedEmailAddress) studentId=studentId, invitedEmailAddress=invitedEmailAddress)
jcount = len(guardians) jcount = len(guardians)
if not csvPF: if not csvPF:
@ -45916,6 +46004,7 @@ def _getClassroomInvitations(croom, userId, courseId, role, i, count, j=0, jcoun
invitations = callGAPIpages(croom.invitations(), 'list', 'invitations', invitations = callGAPIpages(croom.invitations(), 'list', 'invitations',
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
userId=userId, courseId=courseId) userId=userId, courseId=courseId)
except GAPI.notFound: except GAPI.notFound:
if userId is not None: if userId is not None:
@ -46284,6 +46373,7 @@ def printShowClassroomProfile(users):
try: try:
result = callGAPI(croom.userProfiles(), 'get', result = callGAPI(croom.userProfiles(), 'get',
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
userId=userId, fields='*') userId=userId, fields='*')
result.setdefault('verifiedTeacher', False) result.setdefault('verifiedTeacher', False)
if not csvPF: if not csvPF:
@ -50300,6 +50390,7 @@ def showFileInfo(users):
try: try:
result['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions', result['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, throwReasons=GAPI.DRIVE3_GET_ACL_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
fileId=fileId, fields=permissionsFields, supportsAllDrives=True) fileId=fileId, fields=permissionsFields, supportsAllDrives=True)
for permission in result['permissions']: for permission in result['permissions']:
permission.pop('teamDrivePermissionDetails', None) permission.pop('teamDrivePermissionDetails', None)
@ -51612,6 +51703,7 @@ def printFileList(users):
try: try:
f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions', f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, throwReasons=GAPI.DRIVE3_GET_ACL_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
fileId=f_file['id'], fields=permissionsFields, supportsAllDrives=True) fileId=f_file['id'], fields=permissionsFields, supportsAllDrives=True)
if not DLP.CheckFilePermissionMatches(f_file): if not DLP.CheckFilePermissionMatches(f_file):
return return
@ -52465,6 +52557,7 @@ def printShowFileCounts(users):
try: try:
f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions', f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.BAD_REQUEST], throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.BAD_REQUEST],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
fileId=f_file['id'], fields=permissionsFields, supportsAllDrives=True) fileId=f_file['id'], fields=permissionsFields, supportsAllDrives=True)
if not DLP.CheckFilePermissionMatches(f_file): if not DLP.CheckFilePermissionMatches(f_file):
continue continue
@ -54247,6 +54340,7 @@ def _copyPermissions(drive, user, i, count, j, jcount,
try: try:
result = callGAPIpages(drive.permissions(), 'list', 'permissions', result = callGAPIpages(drive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, throwReasons=GAPI.DRIVE3_GET_ACL_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
fileId=fid, fileId=fid,
fields='nextPageToken,permissions(allowFileDiscovery,domain,emailAddress,expirationTime,id,role,type,deleted,view,pendingOwner,permissionDetails)', fields='nextPageToken,permissions(allowFileDiscovery,domain,emailAddress,expirationTime,id,role,type,deleted,view,pendingOwner,permissionDetails)',
useDomainAdminAccess=copyMoveOptions['useDomainAdminAccess'], supportsAllDrives=True) useDomainAdminAccess=copyMoveOptions['useDomainAdminAccess'], supportsAllDrives=True)
@ -55335,6 +55429,7 @@ def _updateMoveFilePermissions(drive, user, i, count,
try: try:
result = callGAPIpages(drive.permissions(), 'list', 'permissions', result = callGAPIpages(drive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, throwReasons=GAPI.DRIVE3_GET_ACL_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
fileId=fid, fileId=fid,
fields='nextPageToken,permissions(allowFileDiscovery,domain,emailAddress,expirationTime,id,role,type,deleted,view,pendingOwner,permissionDetails)', fields='nextPageToken,permissions(allowFileDiscovery,domain,emailAddress,expirationTime,id,role,type,deleted,view,pendingOwner,permissionDetails)',
useDomainAdminAccess=copyMoveOptions['useDomainAdminAccess'], supportsAllDrives=True) useDomainAdminAccess=copyMoveOptions['useDomainAdminAccess'], supportsAllDrives=True)
@ -56841,6 +56936,7 @@ def transferDrive(users):
try: try:
permissions = callGAPIpages(ownerDrive.permissions(), 'list', 'permissions', permissions = callGAPIpages(ownerDrive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.BAD_REQUEST], throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.BAD_REQUEST],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
fileId=childFileId, fields='nextPageToken,permissions') fileId=childFileId, fields='nextPageToken,permissions')
if getSourcePermissionFromOwner: if getSourcePermissionFromOwner:
for permission in permissions: for permission in permissions:
@ -59148,6 +59244,7 @@ def printShowDriveFileACLs(users, useDomainAdminAccess=False):
try: try:
permissions = callGAPIpages(drive.permissions(), 'list', 'permissions', permissions = callGAPIpages(drive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.NOT_FOUND], throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.NOT_FOUND],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
useDomainAdminAccess=useDomainAdminAccess, useDomainAdminAccess=useDomainAdminAccess,
includePermissionsForView=includePermissionsForView, includePermissionsForView=includePermissionsForView,
fileId=fileId, fields=fields, supportsAllDrives=True) fileId=fileId, fields=fields, supportsAllDrives=True)
@ -60537,6 +60634,7 @@ def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
permissions = callGAPIpages(drive.permissions(), 'list', 'permissions', permissions = callGAPIpages(drive.permissions(), 'list', 'permissions',
pageMessage=getPageMessageForWhom(), pageMessage=getPageMessageForWhom(),
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, throwReasons=GAPI.DRIVE3_GET_ACL_REASONS,
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
useDomainAdminAccess=useDomainAdminAccess, useDomainAdminAccess=useDomainAdminAccess,
fileId=shareddrive['id'], fields=fields, supportsAllDrives=True) fileId=shareddrive['id'], fields=fields, supportsAllDrives=True)
if not permissions: if not permissions:
@ -61883,6 +61981,7 @@ def _createLicenses(lic, productId, skuId, parameters, jcount, users, i, count,
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.INTERNAL_ERROR, GAPI.DUPLICATE, GAPI.CONDITION_NOT_MET, GAPI.INVALID, throwReasons=[GAPI.INTERNAL_ERROR, GAPI.DUPLICATE, GAPI.CONDITION_NOT_MET, GAPI.INVALID,
GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
productId=productId, skuId=skuId, body={'userId': user}, fields='') productId=productId, skuId=skuId, body={'userId': user}, fields='')
message = Act.SUCCESS message = Act.SUCCESS
entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)], j, jcount) entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)], j, jcount)
@ -61942,6 +62041,7 @@ def updateLicense(users):
bailOnInternalError=True, bailOnInternalError=True,
throwReasons=[GAPI.INTERNAL_ERROR, GAPI.NOT_FOUND, GAPI.CONDITION_NOT_MET, GAPI.INVALID, throwReasons=[GAPI.INTERNAL_ERROR, GAPI.NOT_FOUND, GAPI.CONDITION_NOT_MET, GAPI.INVALID,
GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
productId=productId, skuId=oldSkuId, userId=user, body=body, fields='') productId=productId, skuId=oldSkuId, userId=user, body=body, fields='')
message = Act.SUCCESS message = Act.SUCCESS
entityModifierNewValueActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.skuIdToDisplayName(skuId)], entityModifierNewValueActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.skuIdToDisplayName(skuId)],
@ -61974,6 +62074,7 @@ def _deleteLicenses(lic, productId, skuId, parameters, jcount, users, i, count):
callGAPI(lic.licenseAssignments(), 'delete', callGAPI(lic.licenseAssignments(), 'delete',
throwReasons=[GAPI.INTERNAL_ERROR, GAPI.NOT_FOUND, GAPI.CONDITION_NOT_MET, GAPI.INVALID, throwReasons=[GAPI.INTERNAL_ERROR, GAPI.NOT_FOUND, GAPI.CONDITION_NOT_MET, GAPI.INVALID,
GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE], GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
productId=productId, skuId=skuId, userId=user) productId=productId, skuId=skuId, userId=user)
message = Act.SUCCESS message = Act.SUCCESS
entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)], j, jcount) entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)], j, jcount)
@ -62216,6 +62317,7 @@ def getPhoto(users, profileMode):
else: else:
result = callGAPI(people.people(), 'get', result = callGAPI(people.people(), 'get',
throwReasons=[GAPI.NOT_FOUND], throwReasons=[GAPI.NOT_FOUND],
retryReasons=[GAPI.SERVICE_NOT_AVAILABLE],
resourceName='people/me', personFields='photos') resourceName='people/me', personFields='photos')
default = False default = False
url = None url = None

View File

@ -170,7 +170,7 @@ USER_NOT_FOUND = 'userNotFound'
USER_RATE_LIMIT_EXCEEDED = 'userRateLimitExceeded' USER_RATE_LIMIT_EXCEEDED = 'userRateLimitExceeded'
# #
DEFAULT_RETRY_REASONS = [QUOTA_EXCEEDED, RATE_LIMIT_EXCEEDED, SHARING_RATE_LIMIT_EXCEEDED, USER_RATE_LIMIT_EXCEEDED, DEFAULT_RETRY_REASONS = [QUOTA_EXCEEDED, RATE_LIMIT_EXCEEDED, SHARING_RATE_LIMIT_EXCEEDED, USER_RATE_LIMIT_EXCEEDED,
BACKEND_ERROR, BAD_GATEWAY, GATEWAY_TIMEOUT, INTERNAL_ERROR, TRANSIENT_ERROR, SERVICE_NOT_AVAILABLE] BACKEND_ERROR, BAD_GATEWAY, GATEWAY_TIMEOUT, INTERNAL_ERROR, TRANSIENT_ERROR]
ACTIVITY_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST] ACTIVITY_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST]
ALERT_THROW_REASONS = [SERVICE_NOT_AVAILABLE, AUTH_ERROR] ALERT_THROW_REASONS = [SERVICE_NOT_AVAILABLE, AUTH_ERROR]
CALENDAR_THROW_REASONS = [SERVICE_NOT_AVAILABLE, AUTH_ERROR, NOT_A_CALENDAR_USER] CALENDAR_THROW_REASONS = [SERVICE_NOT_AVAILABLE, AUTH_ERROR, NOT_A_CALENDAR_USER]
@ -182,10 +182,10 @@ CIGROUP_UPDATE_THROW_REASONS = [NOT_FOUND, GROUP_NOT_FOUND, DOMAIN_NOT_FOUND, DO
FORBIDDEN, BAD_REQUEST, INVALID, INVALID_INPUT, INVALID_ARGUMENT, FORBIDDEN, BAD_REQUEST, INVALID, INVALID_INPUT, INVALID_ARGUMENT,
SYSTEM_ERROR, PERMISSION_DENIED, FAILED_PRECONDITION] SYSTEM_ERROR, PERMISSION_DENIED, FAILED_PRECONDITION]
CIMEMBERS_THROW_REASONS = [MEMBER_NOT_FOUND, INVALID_MEMBER] CIMEMBERS_THROW_REASONS = [MEMBER_NOT_FOUND, INVALID_MEMBER]
CISSO_CREATE_THROW_REASONS = [SERVICE_NOT_AVAILABLE, FAILED_PRECONDITION, NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, INVALID, INVALID_ARGUMENT, PERMISSION_DENIED, INTERNAL_ERROR] CISSO_CREATE_THROW_REASONS = [FAILED_PRECONDITION, NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, INVALID, INVALID_ARGUMENT, PERMISSION_DENIED, INTERNAL_ERROR]
CISSO_GET_THROW_REASONS = [SERVICE_NOT_AVAILABLE, NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR] CISSO_GET_THROW_REASONS = [NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR]
CISSO_LIST_THROW_REASONS = [SERVICE_NOT_AVAILABLE, NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR] CISSO_LIST_THROW_REASONS = [NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR]
CISSO_UPDATE_THROW_REASONS = [SERVICE_NOT_AVAILABLE, NOT_FOUND, FAILED_PRECONDITION, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, CISSO_UPDATE_THROW_REASONS = [NOT_FOUND, FAILED_PRECONDITION, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS,
FORBIDDEN, BAD_REQUEST, INVALID, INVALID_INPUT, INVALID_ARGUMENT, FORBIDDEN, BAD_REQUEST, INVALID, INVALID_INPUT, INVALID_ARGUMENT,
SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR] SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR]
CONTACT_DELEGATE_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST, FAILED_PRECONDITION, PERMISSION_DENIED, FORBIDDEN, INVALID_ARGUMENT] CONTACT_DELEGATE_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST, FAILED_PRECONDITION, PERMISSION_DENIED, FORBIDDEN, INVALID_ARGUMENT]