gam7 7.10.6__py3-none-any.whl → 7.10.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gam7 might be problematic. Click here for more details.

gam/__init__.py CHANGED
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
25
25
  """
26
26
 
27
27
  __author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
28
- __version__ = '7.10.06'
28
+ __version__ = '7.10.08'
29
29
  __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
30
30
 
31
31
  #pylint: disable=wrong-import-position
@@ -5187,6 +5187,12 @@ def checkGAPIError(e, softErrors=False, retryOnHttpError=False, mapNotFound=True
5187
5187
  return (0, None, None)
5188
5188
  else:
5189
5189
  systemErrorExit(HTTP_ERROR_RC, eContent)
5190
+ requiredScopes = ''
5191
+ wwwAuthenticate = e.resp.get('www-authenticate', '')
5192
+ if 'insufficient_scope' in wwwAuthenticate:
5193
+ mg = re.match(r'.+scope="(.+)"', wwwAuthenticate)
5194
+ if mg:
5195
+ requiredScopes = mg.group(1).split(' ')
5190
5196
  if 'error' in error:
5191
5197
  http_status = error['error']['code']
5192
5198
  reason = ''
@@ -5256,6 +5262,8 @@ def checkGAPIError(e, softErrors=False, retryOnHttpError=False, mapNotFound=True
5256
5262
  elif 'the authenticated user cannot access this service' in lmessage:
5257
5263
  error = makeErrorDict(http_status, GAPI.SERVICE_NOT_AVAILABLE, message)
5258
5264
  elif status == 'PERMISSION_DENIED' or 'the caller does not have permission' in lmessage or 'permission iam.serviceaccountkeys' in lmessage:
5265
+ if requiredScopes:
5266
+ message += f', {Msg.NO_SCOPES_FOR_API.format(API.findAPIforScope(requiredScopes))}'
5259
5267
  error = makeErrorDict(http_status, GAPI.PERMISSION_DENIED, message)
5260
5268
  elif http_status == 404:
5261
5269
  if status == 'NOT_FOUND' or 'requested entity was not found' in lmessage or 'does not exist' in lmessage:
@@ -8864,6 +8872,7 @@ class CSVPrintFile():
8864
8872
  GAPI.fileOrganizerNotYetEnabledForThisTeamDrive,
8865
8873
  GAPI.fileOrganizerOnFoldersInSharedDriveOnly,
8866
8874
  GAPI.fileOrganizerOnNonTeamDriveNotSupported,
8875
+ GAPI.cannotModifyInheritedPermission,
8867
8876
  GAPI.teamDrivesFolderSharingNotSupported, GAPI.invalidLinkVisibility,
8868
8877
  GAPI.invalidSharingRequest, GAPI.fileNeverWritable, GAPI.abusiveContentRestriction) as e:
8869
8878
  entityActionFailedWarning([Ent.USER, user, Ent.SPREADSHEET, title,
@@ -29957,7 +29966,7 @@ DEVICE_ORDERBY_CHOICE_MAP = {
29957
29966
  # [orderby <DeviceOrderByFieldName> [ascending|descending]]
29958
29967
  # [all|company|personal|nocompanydevices|nopersonaldevices]
29959
29968
  # [nodeviceusers|oneuserperrow]
29960
- # [clientstates]
29969
+ # [clientstates]
29961
29970
  # [formatjson [quotechar <Character>]]
29962
29971
  # [showitemcountonly]
29963
29972
  def doPrintCIDevices():
@@ -59522,6 +59531,7 @@ def _copyPermissions(drive, user, i, count, j, jcount,
59522
59531
  GAPI.fileOrganizerNotYetEnabledForThisTeamDrive,
59523
59532
  GAPI.fileOrganizerOnFoldersInSharedDriveOnly,
59524
59533
  GAPI.fileOrganizerOnNonTeamDriveNotSupported,
59534
+ GAPI.cannotModifyInheritedPermission,
59525
59535
  GAPI.teamDrivesFolderSharingNotSupported, GAPI.invalidLinkVisibility, GAPI.abusiveContentRestriction) as e:
59526
59536
  entityActionFailedWarning(kvList, str(e), k, kcount)
59527
59537
  break
@@ -60629,6 +60639,7 @@ def _updateMoveFilePermissions(drive, user, i, count,
60629
60639
  GAPI.fileOrganizerNotYetEnabledForThisTeamDrive,
60630
60640
  GAPI.fileOrganizerOnFoldersInSharedDriveOnly,
60631
60641
  GAPI.fileOrganizerOnNonTeamDriveNotSupported,
60642
+ GAPI.cannotModifyInheritedPermission,
60632
60643
  GAPI.teamDrivesFolderSharingNotSupported, GAPI.invalidLinkVisibility, GAPI.abusiveContentRestriction) as e:
60633
60644
  entityActionFailedWarning(kvList, str(e), k, kcount)
60634
60645
  break
@@ -63883,6 +63894,7 @@ def createDriveFileACL(users, useDomainAdminAccess=False):
63883
63894
  GAPI.fileOrganizerNotYetEnabledForThisTeamDrive,
63884
63895
  GAPI.fileOrganizerOnFoldersInSharedDriveOnly,
63885
63896
  GAPI.fileOrganizerOnNonTeamDriveNotSupported,
63897
+ GAPI.cannotModifyInheritedPermission,
63886
63898
  GAPI.teamDrivesFolderSharingNotSupported, GAPI.invalidLinkVisibility,
63887
63899
  GAPI.invalidSharingRequest, GAPI.fileNeverWritable, GAPI.abusiveContentRestriction) as e:
63888
63900
  entityActionFailedWarning([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], str(e), j, jcount)
@@ -64118,6 +64130,7 @@ def createDriveFilePermissions(users, useDomainAdminAccess=False):
64118
64130
  GAPI.fileOrganizerNotYetEnabledForThisTeamDrive,
64119
64131
  GAPI.fileOrganizerOnFoldersInSharedDriveOnly,
64120
64132
  GAPI.fileOrganizerOnNonTeamDriveNotSupported,
64133
+ GAPI.cannotModifyInheritedPermission,
64121
64134
  GAPI.teamDrivesFolderSharingNotSupported, GAPI.invalidLinkVisibility,
64122
64135
  GAPI.invalidSharingRequest, GAPI.fileNeverWritable, GAPI.abusiveContentRestriction,
64123
64136
  GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
@@ -70242,14 +70255,16 @@ def _finalizeMessageSelectParameters(parameters, queryOrIdsRequired):
70242
70255
  for queryTimeName, queryTimeValue in iter(parameters['queryTimes'].items()):
70243
70256
  parameters['query'] = parameters['query'].replace(f'#{queryTimeName}#', queryTimeValue)
70244
70257
  _mapMessageQueryDates(parameters)
70245
- elif queryOrIdsRequired and parameters['messageEntity'] is None:
70246
- missingArgumentExit('query|matchlabel|ids')
70258
+ elif queryOrIdsRequired and parameters['messageEntity'] is None and not parameters['labelIds']:
70259
+ missingArgumentExit('query|matchlabel|ids|labelids')
70247
70260
  else:
70248
70261
  parameters['query'] = None
70249
70262
  parameters['maxItems'] = parameters['maxToProcess'] if parameters['quick'] and not parameters['labelMatchPattern'] else 0
70250
70263
 
70251
70264
  # gam <UserTypeEntity> archive messages <GroupItem>
70252
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_archive <Number>])|(ids <MessageIDEntity>)
70265
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70266
+ # [labelids <LabelIDList>]
70267
+ # [quick|notquick] [doit] [max_to_archive <Number>])|(ids <MessageIDEntity>)
70253
70268
  # [csv [todrive <ToDriveAttribute>*]]
70254
70269
  def archiveMessages(users):
70255
70270
  def _processMessageFailed(user, idsList, errMsg, j=0, jcount=0):
@@ -70534,39 +70549,59 @@ def _processMessagesThreads(users, entityType):
70534
70549
  csvPF.writeCSVfile(f'{Act.ToPerform()} Messages')
70535
70550
 
70536
70551
  # gam <UserTypeEntity> delete message|messages
70537
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_delete <Number>])|(ids <MessageIDEntity>)
70552
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70553
+ # [labelids <LabelIDList>]
70554
+ # [quick|notquick] [doit] [max_to_delete <Number>])|(ids <MessageIDEntity>)
70538
70555
  # [csv [todrive <ToDriveAttribute>*]]
70539
70556
  # gam <UserTypeEntity> modify message|messages
70540
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_modify <Number>])|(ids <MessageIDEntity>)
70557
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70558
+ # [labelids <LabelIDList>]
70559
+ # [quick|notquick] [doit] [max_to_modify <Number>])|(ids <MessageIDEntity>)
70541
70560
  # (addlabel <LabelName>)* (removelabel <LabelName>)*
70542
70561
  # [csv [todrive <ToDriveAttribute>*]]
70543
70562
  # gam <UserTypeEntity> spam message|messages
70544
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_spam <Number>])|(ids <MessageIDEntity>)
70563
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70564
+ # [labelids <LabelIDList>]
70565
+ # [quick|notquick] [doit] [max_to_spam <Number>])|(ids <MessageIDEntity>)
70545
70566
  # [csv [todrive <ToDriveAttribute>*]]
70546
70567
  # gam <UserTypeEntity> trash message|messages
70547
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_trash <Number>])|(ids <MessageIDEntity>)
70568
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70569
+ # [labelids <LabelIDList>]
70570
+ # [quick|notquick] [doit] [max_to_trash <Number>])|(ids <MessageIDEntity>)
70548
70571
  # [csv [todrive <ToDriveAttribute>*]]
70549
70572
  # gam <UserTypeEntity> untrash message|messages
70550
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_untrash <Number>])|(ids <MessageIDEntity>)
70573
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70574
+ # [labelids <LabelIDList>]
70575
+ # [quick|notquick] [doit] [max_to_untrash <Number>])|(ids <MessageIDEntity>)
70551
70576
  # [csv [todrive <ToDriveAttribute>*]]
70552
70577
  def processMessages(users):
70553
70578
  _processMessagesThreads(users, Ent.MESSAGE)
70554
70579
 
70555
70580
  # gam <UserTypeEntity> delete thread|threads
70556
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_delete <Number>])|(ids <ThreadIDEntity>)
70581
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70582
+ # [labelids <LabelIDList>]
70583
+ # [quick|notquick] [doit] [max_to_delete <Number>])|(ids <ThreadIDEntity>)
70557
70584
  # [csv [todrive <ToDriveAttribute>*]]
70558
70585
  # gam <UserTypeEntity> modify thread|threads
70559
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_modify <Number>])|(ids <ThreadIDEntity>)
70586
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70587
+ # [labelids <LabelIDList>]
70588
+ # [quick|notquick] [doit] [max_to_modify <Number>])|(ids <ThreadIDEntity>)
70560
70589
  # (addlabel <LabelName>)* (removelabel <LabelName>)*
70561
70590
  # [csv [todrive <ToDriveAttribute>*]]
70562
70591
  # gam <UserTypeEntity> spam thread|threads
70563
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_spam <Number>])|(ids <ThreadIDEntity>)
70592
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70593
+ # [labelids <LabelIDList>]
70594
+ # [quick|notquick] [doit] [max_to_spam <Number>])|(ids <ThreadIDEntity>)
70564
70595
  # [csv [todrive <ToDriveAttribute>*]]
70565
70596
  # gam <UserTypeEntity> trash thread|threads
70566
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_trash <Number>])|(ids <MessageIDEntity>)
70597
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70598
+ # [labelids <LabelIDList>]
70599
+ # [quick|notquick] [doit] [max_to_trash <Number>])|(ids <ThreadIDEntity>)
70567
70600
  # [csv [todrive <ToDriveAttribute>*]]
70568
70601
  # gam <UserTypeEntity> untrash thread|threads
70569
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+ [quick|notquick] [doit] [max_to_untrash <Number>])|(ids <ThreadIDEntity>)
70602
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+
70603
+ # [labelids <LabelIDList>]
70604
+ # [quick|notquick] [doit] [max_to_untrash <Number>])|(ids <ThreadIDEntity>)
70570
70605
  # [csv [todrive <ToDriveAttribute>*]]
70571
70606
  def processThreads(users):
70572
70607
  _processMessagesThreads(users, Ent.THREAD)
@@ -71988,7 +72023,9 @@ def printShowMessagesThreads(users, entityType):
71988
72023
  csvPF.writeCSVfile('Message Counts' if not show_labels else 'Message Label Counts')
71989
72024
 
71990
72025
  # gam <UserTypeEntity> print message|messages [todrive <ToDriveAttribute>*]
71991
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])* [quick|notquick] [max_to_print <Number>] [includespamtrash])|(ids <MessageIDEntity>)
72026
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])*
72027
+ # [labelids <LabelIDList>]
72028
+ # [quick|notquick] [max_to_print <Number>] [includespamtrash])|(ids <MessageIDEntity>)
71992
72029
  # [labelmatchpattern <REMatchPattern>] [sendermatchpattern <REMatchPattern>]
71993
72030
  # [headers all|<SMTPHeaderList>] [dateheaderformat iso|rfc2822|<String>] [dateheaderconverttimezone [<Boolean>]]
71994
72031
  # [showlabels] [showbody] [showhtml] [showdate] [showsize] [showsnippet]
@@ -71998,7 +72035,9 @@ def printShowMessagesThreads(users, entityType):
71998
72035
  # [showattachments [noshowtextplain]]]
71999
72036
  # (addcsvdata <FieldName> <String>)*
72000
72037
  # gam <UserTypeEntity> show message|messages
72001
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])* [quick|notquick] [max_to_show <Number>] [includespamtrash])|(ids <MessageIDEntity>)
72038
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])*
72039
+ # [labelids <LabelIDList>]
72040
+ # [quick|notquick] [max_to_show <Number>] [includespamtrash])|(ids <MessageIDEntity>)
72002
72041
  # [labelmatchpattern <REMatchPattern>] [sendermatchpattern <REMatchPattern>]
72003
72042
  # [headers all|<SMTPHeaderList>] [dateheaderformat iso|rfc2822|<String>] [dateheaderconverttimezone [<Boolean>]]
72004
72043
  # [showlabels] [showbody] [showhtml] [showdate] [showsize] [showsnippet]
@@ -72011,7 +72050,9 @@ def printShowMessages(users):
72011
72050
  printShowMessagesThreads(users, Ent.MESSAGE)
72012
72051
 
72013
72052
  # gam <UserTypeEntity> print thread|threads [todrive <ToDriveAttribute>*]
72014
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])* [quick|notquick] [max_to_print <Number>] [includespamtrash])|(ids <ThreadIDEntity>)
72053
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])*
72054
+ # [labelids <LabelIDList>]
72055
+ # [quick|notquick] [max_to_print <Number>] [includespamtrash])|(ids <ThreadIDEntity>)
72015
72056
  # [labelmatchpattern <REMatchPattern>]
72016
72057
  # [headers all|<SMTPHeaderList>] [dateheaderformat iso|rfc2822|<String>] [dateheaderconverttimezone [<Boolean>]]
72017
72058
  # [showlabels] [showbody] [showhtml] [showdate] [showsize] [showsnippet]
@@ -72021,7 +72062,9 @@ def printShowMessages(users):
72021
72062
  # [showattachments [noshowtextplain]]]
72022
72063
  # (addcsvdata <FieldName> <String>)*
72023
72064
  # gam <UserTypeEntity> show thread|threads
72024
- # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])* [quick|notquick] [max_to_show <Number>] [includespamtrash])|(ids <ThreadIDEntity>)
72065
+ # (((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])*
72066
+ # [labelids <LabelIDList>]
72067
+ # [quick|notquick] [max_to_show <Number>] [includespamtrash])|(ids <ThreadIDEntity>)
72025
72068
  # [labelmatchpattern <REMatchPattern>]
72026
72069
  # [headers all|<SMTPHeaderList>] [dateheaderformat iso|rfc2822|<String>] [dateheaderconverttimezone [<Boolean>]]
72027
72070
  # [showlabels] [showbody] [showhtml] [showdate] [showsize] [showsnippet]
gam/gamlib/glapi.py CHANGED
@@ -226,15 +226,15 @@ _INFO = {
226
226
  CHROMEMANAGEMENT_TELEMETRY: {'name': 'Chrome Management API - Telemetry', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHROMEMANAGEMENT},
227
227
  CHROMEPOLICY: {'name': 'Chrome Policy API', 'version': 'v1', 'v2discovery': True},
228
228
  CHROMEVERSIONHISTORY: {'name': 'Chrome Version History API', 'version': 'v1', 'v2discovery': True},
229
- CLOUDCHANNEL: {'name': 'Channel Channel API', 'version': 'v1', 'v2discovery': True},
230
- CLOUDIDENTITY_DEVICES: {'name': 'Cloud Identity Devices API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
231
- CLOUDIDENTITY_GROUPS: {'name': 'Cloud Identity Groups API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
232
- CLOUDIDENTITY_GROUPS_BETA: {'name': 'Cloud Identity Groups API', 'version': 'v1beta1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
233
- CLOUDIDENTITY_INBOUND_SSO: {'name': 'Cloud Identity Inbound SSO API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
234
- CLOUDIDENTITY_ORGUNITS: {'name': 'Cloud Identity OrgUnits API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
235
- CLOUDIDENTITY_ORGUNITS_BETA: {'name': 'Cloud Identity OrgUnits API', 'version': 'v1beta1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
236
- CLOUDIDENTITY_POLICY: {'name': 'Cloud Identity Policy API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
237
- CLOUDIDENTITY_USERINVITATIONS: {'name': 'Cloud Identity User Invitations API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
229
+ CLOUDCHANNEL: {'name': 'Cloud Channel API', 'version': 'v1', 'v2discovery': True},
230
+ CLOUDIDENTITY_DEVICES: {'name': 'Cloud Identity API - Devices', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
231
+ CLOUDIDENTITY_GROUPS: {'name': 'Cloud Identity API - Groups', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
232
+ CLOUDIDENTITY_GROUPS_BETA: {'name': 'Cloud Identity API - Groups Beta', 'version': 'v1beta1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
233
+ CLOUDIDENTITY_INBOUND_SSO: {'name': 'Cloud Identity API - Inbound SSO Settings', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
234
+ CLOUDIDENTITY_ORGUNITS: {'name': 'Cloud Identity API - OrgUnits', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
235
+ CLOUDIDENTITY_ORGUNITS_BETA: {'name': 'Cloud Identity API - OrgUnits Beta', 'version': 'v1beta1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
236
+ CLOUDIDENTITY_POLICY: {'name': 'Cloud Identity API - Policy', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
237
+ CLOUDIDENTITY_USERINVITATIONS: {'name': 'Cloud Identity API - User Invitations', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
238
238
  CLOUDRESOURCEMANAGER: {'name': 'Cloud Resource Manager API v3', 'version': 'v3', 'v2discovery': True},
239
239
  CONTACTS: {'name': 'Contacts API', 'version': 'v3', 'v2discovery': False},
240
240
  CONTACTDELEGATION: {'name': 'Contact Delegation API', 'version': 'v1', 'v2discovery': True, 'localjson': True},
@@ -258,13 +258,13 @@ _INFO = {
258
258
  LICENSING: {'name': 'License Manager API', 'version': 'v1', 'v2discovery': True},
259
259
  LOOKERSTUDIO: {'name': 'Looker Studio API', 'version': 'v1', 'v2discovery': True, 'localjson': True},
260
260
  MEET: {'name': 'Meet API', 'version': 'v2', 'v2discovery': True},
261
- MEET_BETA: {'name': 'Meet API', 'version': 'v2beta', 'v2discovery': True, 'localjson': True, 'mappedAPI': MEET},
261
+ MEET_BETA: {'name': 'Meet API Beta', 'version': 'v2beta', 'v2discovery': True, 'localjson': True, 'mappedAPI': MEET},
262
262
  OAUTH2: {'name': 'OAuth2 API', 'version': 'v2', 'v2discovery': False},
263
263
  ORGPOLICY: {'name': 'Organization Policy API', 'version': 'v2', 'v2discovery': True},
264
264
  PEOPLE: {'name': 'People API', 'version': 'v1', 'v2discovery': True},
265
265
  PEOPLE_DIRECTORY: {'name': 'People Directory API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': PEOPLE},
266
266
  PEOPLE_OTHERCONTACTS: {'name': 'People API - Other Contacts', 'version': 'v1', 'v2discovery': True, 'mappedAPI': PEOPLE},
267
- PRINTERS: {'name': 'Directory API Printers', 'version': 'directory_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
267
+ PRINTERS: {'name': 'Directory API - Printers', 'version': 'directory_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
268
268
  PUBSUB: {'name': 'Pub / Sub API', 'version': 'v1', 'v2discovery': True},
269
269
  REPORTS: {'name': 'Reports API', 'version': 'reports_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
270
270
  RESELLER: {'name': 'Reseller API', 'version': 'v1', 'v2discovery': True},
@@ -362,29 +362,29 @@ _CLIENT_SCOPES = [
362
362
  'subscopes': READONLY,
363
363
  'offByDefault': True,
364
364
  'scope': 'https://www.googleapis.com/auth/apps.order'},
365
- {'name': 'Cloud Identity Groups API',
365
+ {'name': 'Cloud Identity API - Groups',
366
366
  'api': CLOUDIDENTITY_GROUPS,
367
367
  'subscopes': READONLY,
368
368
  'scope': 'https://www.googleapis.com/auth/cloud-identity.groups'},
369
- {'name': 'Cloud Identity Groups API Beta (Enables group locking/unlocking)',
369
+ {'name': 'Cloud Identity API - Groups Beta (Enables group locking/unlocking)',
370
370
  'api': CLOUDIDENTITY_GROUPS_BETA,
371
371
  'subscopes': [],
372
372
  'scope': 'https://www.googleapis.com/auth/cloud-identity.groups'},
373
- {'name': 'Cloud Identity - Inbound SSO Settings',
373
+ {'name': 'Cloud Identity API - Inbound SSO Settings',
374
374
  'api': CLOUDIDENTITY_INBOUND_SSO,
375
375
  'subscopes': READONLY,
376
376
  'scope': 'https://www.googleapis.com/auth/cloud-identity.inboundsso'},
377
- {'name': 'Cloud Identity OrgUnits API',
377
+ {'name': 'Cloud Identity API - OrgUnits Beta',
378
378
  'api': CLOUDIDENTITY_ORGUNITS_BETA,
379
379
  'subscopes': READONLY,
380
380
  'scope': 'https://www.googleapis.com/auth/cloud-identity.orgunits'},
381
- {'name': 'Cloud Identity - Policy',
381
+ {'name': 'Cloud Identity API - Policy',
382
382
  'api': CLOUDIDENTITY_POLICY,
383
383
  'subscopes': READONLY,
384
384
  'roByDefault': True,
385
385
  'scope': 'https://www.googleapis.com/auth/cloud-identity.policies'
386
386
  },
387
- {'name': 'Cloud Identity User Invitations API',
387
+ {'name': 'Cloud Identity API - User Invitations',
388
388
  'api': CLOUDIDENTITY_USERINVITATIONS,
389
389
  'subscopes': READONLY,
390
390
  'scope': 'https://www.googleapis.com/auth/cloud-identity.userinvitations'},
@@ -833,3 +833,27 @@ def getSvcAcctScopesList(userServiceAccountAccessOnly, svcAcctSpecialScopes):
833
833
 
834
834
  def hasLocalJSON(api):
835
835
  return _INFO[api].get('localjson', False)
836
+
837
+ def findAPIforScope(scopesList):
838
+ def checkScopeMatch(scope, cscope):
839
+ if cscope['scope'] == scope:
840
+ requiredAPIs.append(cscope['name'])
841
+ return True
842
+ if cscope['subscopes'] == READONLY and cscope['scope']+'.readonly' == scope:
843
+ requiredAPIs.append(cscope['name']+' (supports readonly)')
844
+ return True
845
+ return False
846
+
847
+ requiredAPIs = []
848
+ for scope in scopesList:
849
+ for cscope in _CLIENT_SCOPES:
850
+ if checkScopeMatch(scope, cscope):
851
+ break
852
+ else:
853
+ for cscope in _SVCACCT_SCOPES:
854
+ if checkScopeMatch(scope, cscope):
855
+ break
856
+ if not requiredAPIs:
857
+ requiredAPIs = scopesList
858
+ return ' or '.join(requiredAPIs)
859
+
gam/gamlib/glgapi.py CHANGED
@@ -229,6 +229,7 @@ DRIVE3_CREATE_ACL_THROW_REASONS = [BAD_REQUEST, INVALID, INVALID_SHARING_REQUEST
229
229
  FILE_ORGANIZER_NOT_YET_ENABLED_FOR_THIS_TEAMDRIVE,
230
230
  FILE_ORGANIZER_ON_FOLDERS_IN_SHARED_DRIVE_ONLY,
231
231
  FILE_ORGANIZER_ON_NON_TEAMDRIVE_NOT_SUPPORTED,
232
+ CANNOT_MODIFY_INHERITED_PERMISSION,
232
233
  TEAMDRIVES_FOLDER_SHARING_NOT_SUPPORTED, INVALID_LINK_VISIBILITY, ABUSIVE_CONTENT_RESTRICTION]
233
234
  DRIVE3_GET_ACL_REASONS = DRIVE_USER_THROW_REASONS+[FILE_NOT_FOUND, FORBIDDEN, INTERNAL_ERROR,
234
235
  INSUFFICIENT_ADMINISTRATOR_PRIVILEGES, INSUFFICIENT_FILE_PERMISSIONS,
gam/gamlib/glmsgs.py CHANGED
@@ -184,8 +184,8 @@ ALREADY_EXISTS_IN_TARGET_FOLDER = 'Already exists in {0}: {1}'
184
184
  ALREADY_EXISTS_USE_MERGE_ARGUMENT = 'Already exists; use the "merge" argument to merge the labels'
185
185
  API_ACCESS_DENIED = 'API access Denied'
186
186
  API_CALLS_RETRY_DATA = 'API calls retry data\n'
187
- API_CHECK_CLIENT_AUTHORIZATION = 'Please make sure the Client ID: {0} is authorized for the appropriate API or scopes:\n{1}\n\nRun: gam oauth create\n'
188
- API_CHECK_SVCACCT_AUTHORIZATION = 'Please make sure the Service Account Client ID: {0} is authorized for the appropriate API or scopes:\n{1}\n\nRun: gam user {2} update serviceaccount\n'
187
+ API_CHECK_CLIENT_AUTHORIZATION = 'Please make sure the Client ID: {0} is authorized for the appropriate API or scopes: {1}\n\nRun: gam oauth create\n'
188
+ API_CHECK_SVCACCT_AUTHORIZATION = 'Please make sure the Service Account Client ID: {0} is authorized for the appropriate API or scopes: {1}\n\nRun: gam user {2} update serviceaccount\n'
189
189
  API_ERROR_SETTINGS = 'API error, some settings not set'
190
190
  ARE_BOTH_REQUIRED = 'Arguments {0} and {1} are both required'
191
191
  ARE_MUTUALLY_EXCLUSIVE = 'Arguments {0} and {1} are mutually exclusive'
@@ -425,7 +425,7 @@ NO_LABELS_TO_PROCESS = 'No Labels to process'
425
425
  NO_MESSAGES_WITH_LABEL = 'No Messages with Label'
426
426
  NO_PARENTS_TO_CONVERT_TO_SHORTCUTS = 'No parents to convert to shortcuts'
427
427
  NO_REPORT_AVAILABLE = 'No {0} report available.'
428
- NO_SCOPES_FOR_API = 'There are no scopes authorized for the {0}'
428
+ NO_SCOPES_FOR_API = 'There are no scopes authorized for the API(s): {0}'
429
429
  NO_SERIAL_NUMBERS_SPECIFIED = 'No serial numbers specified'
430
430
  NO_SSO_PROFILE_MATCHES = 'No SSO profile matches display name {0}'
431
431
  NO_SSO_PROFILE_ASSIGNED = 'No SSO profile assigned to {0} {1}'
gam/gamlib/glskus.py CHANGED
@@ -107,6 +107,8 @@ _SKUS = {
107
107
  'product': '101047', 'aliases': ['aisecurity'], 'displayName': 'AI Security'},
108
108
  '1010470007': {
109
109
  'product': '101047', 'aliases': ['aimeetingsandmessaging'], 'displayName': 'AI Meetings and Messaging'},
110
+ '1010470008': {
111
+ 'product': '101047', 'aliases': ['geminiultra'], 'displayName': 'Google AI Ultra for Business'},
110
112
  '1010490001': {
111
113
  'product': '101049', 'aliases': ['eeu'], 'displayName': 'Endpoint Education Upgrade'},
112
114
  '1010500001': {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.10.6
3
+ Version: 7.10.8
4
4
  Summary: CLI tool to manage Google Workspace
5
5
  Project-URL: Homepage, https://github.com/GAM-team/GAM
6
6
  Project-URL: Issues, https://github.com/GAM-team/GAM/issues
@@ -1,4 +1,4 @@
1
- gam/__init__.py,sha256=yvibVAzILcATl-jk73JqR_QHSzQVd911lW-8937nM10,3533835
1
+ gam/__init__.py,sha256=dylNcZjzYccpgDnK8eV0UehP3HfMc_XbIv8AW7NKuf8,3534966
2
2
  gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
3
3
  gam/cacerts.pem,sha256=82Ak7btW_2XvocLUvAwPmpx8Chi0oqtZUG1gseLK_t4,50235
4
4
  gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
@@ -23,16 +23,16 @@ gam/atom/token_store.py,sha256=7E6Ecvxa86WCvl1pJAhv78jg9OxQv8pMtIUcPhZCq04,3803
23
23
  gam/atom/url.py,sha256=pxO1TlORxyKQTQ1bkBE1unFzjnv9c8LjJkm-UEORShY,4276
24
24
  gam/gamlib/__init__.py,sha256=z5mF-y0j8pm-YNFBaiuxB4M_GAUPG-cXWwrhYwrVReM,679
25
25
  gam/gamlib/glaction.py,sha256=1Il_HrChVnPkzZwiZs5au4mFQVtq4K1Z42uIuR6qdnI,9419
26
- gam/gamlib/glapi.py,sha256=A6kdyCacc9tvTaxMUNvWj8jWbOrss8e8XdkqF1xbN70,34572
26
+ gam/gamlib/glapi.py,sha256=27NW2etvdNK4jfR699eqFzhV4gPotijXIQeX-wxCvHA,35319
27
27
  gam/gamlib/glcfg.py,sha256=bNTckxzIM_HruxO2DfYsDbEgqOIz1RX6CbU6XOQQQyg,28296
28
28
  gam/gamlib/glclargs.py,sha256=Ohe746FOQqMlXlutH-XJ6E1unYNzf_EJhdubnPp3new,42472
29
29
  gam/gamlib/glentity.py,sha256=c9-7MAp0HruXEUVq8Nwkllxc4KypFeZRUFkvVzPwrwk,33760
30
- gam/gamlib/glgapi.py,sha256=648jvjKK5rT9Qdyz5Ybh6wAO6sxUwQu1L_ogRqj0zZ0,39762
30
+ gam/gamlib/glgapi.py,sha256=2mu7DQGGYmF7ZGXeBQu_mT1FNZgXbEQqcddJjHzbvE4,39833
31
31
  gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
32
32
  gam/gamlib/glglobals.py,sha256=J0xcHggVrUBzHJ5GruenKV-qV1zPKcK2qWgAgN3i5Jw,9608
33
33
  gam/gamlib/glindent.py,sha256=RfBa2LDfLIqPLL5vMfC689TCVmqn8xf-qulSzkiatrc,1228
34
- gam/gamlib/glmsgs.py,sha256=uSshtTyemMcJGCnYMy3hIilYHIh-IHFbCLlY2aAyTGM,33798
35
- gam/gamlib/glskus.py,sha256=Q4UfVnZZxKXpyBc-iQy_uBgbNyIL519jMXHBotrMPio,15241
34
+ gam/gamlib/glmsgs.py,sha256=c6ff4fetFjcMtOA37-jdkNNdQVgmFgbkzoUPt99vcpI,33804
35
+ gam/gamlib/glskus.py,sha256=e1u3zw1MGQjBgAFXqjrGWQl2d7eYpVlMYGpIKNwjskQ,15360
36
36
  gam/gamlib/gluprop.py,sha256=IyPLCyvn7-NHTUenM71YPQPXRZXx6CB5q-GtJ-FYd1c,11461
37
37
  gam/gamlib/glverlibs.py,sha256=xoQXiwcE_-HVYKv-VYA8O0mazRsc9mN-_ysj1dAlMyc,992
38
38
  gam/gamlib/yubikey.py,sha256=-UC-3oue9qarYK3LT7YL6Gmqs7TMK8oz9_AoxdaG2FA,7925
@@ -65,8 +65,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
65
65
  gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
66
66
  gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
67
67
  gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
68
- gam7-7.10.6.dist-info/METADATA,sha256=HOvXQLyeFroUAFznW21mso2g7EIQJBKU2n0hy-vBYfs,2978
69
- gam7-7.10.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
- gam7-7.10.6.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
- gam7-7.10.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
- gam7-7.10.6.dist-info/RECORD,,
68
+ gam7-7.10.8.dist-info/METADATA,sha256=aj7mavAYxuN9vF7DjO56zXVMgQoY2BW2SkVq27MFCv8,2978
69
+ gam7-7.10.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
+ gam7-7.10.8.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
+ gam7-7.10.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
+ gam7-7.10.8.dist-info/RECORD,,
File without changes