gam7 7.9.1__py3-none-any.whl → 7.9.2__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 +65 -40
- {gam7-7.9.1.dist-info → gam7-7.9.2.dist-info}/METADATA +1 -1
- {gam7-7.9.1.dist-info → gam7-7.9.2.dist-info}/RECORD +6 -6
- {gam7-7.9.1.dist-info → gam7-7.9.2.dist-info}/WHEEL +0 -0
- {gam7-7.9.1.dist-info → gam7-7.9.2.dist-info}/entry_points.txt +0 -0
- {gam7-7.9.1.dist-info → gam7-7.9.2.dist-info}/licenses/LICENSE +0 -0
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.09.
|
|
28
|
+
__version__ = '7.09.02'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -25947,7 +25947,7 @@ def exitIfChatNotConfigured(chat, kvList, errMsg, i, count):
|
|
|
25947
25947
|
if (('No bot associated with this project.' in errMsg) or
|
|
25948
25948
|
('Invalid project number.' in errMsg) or
|
|
25949
25949
|
('Google Chat app not found.' in errMsg)):
|
|
25950
|
-
systemErrorExit(API_ACCESS_DENIED_RC, Msg.TO_SET_UP_GOOGLE_CHAT.format(setupChatURL(chat)))
|
|
25950
|
+
systemErrorExit(API_ACCESS_DENIED_RC, Msg.TO_SET_UP_GOOGLE_CHAT.format(setupChatURL(chat), GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['project_id']))
|
|
25951
25951
|
entityActionFailedWarning(kvList, errMsg, i, count)
|
|
25952
25952
|
|
|
25953
25953
|
def _getChatAdminAccess(adminAPI, userAPI):
|
|
@@ -28119,7 +28119,9 @@ def simplifyChromeSchema(schema):
|
|
|
28119
28119
|
}
|
|
28120
28120
|
fieldDescriptions = schema['fieldDescriptions']
|
|
28121
28121
|
savedSettingName = ''
|
|
28122
|
+
savedTypeName = ''
|
|
28122
28123
|
for mtype in schema['definition']['messageType']:
|
|
28124
|
+
numSettings = len(mtype['field'])
|
|
28123
28125
|
for setting in mtype['field']:
|
|
28124
28126
|
setting_name = setting['name']
|
|
28125
28127
|
setting_dict = {'name': setting_name,
|
|
@@ -28127,9 +28129,9 @@ def simplifyChromeSchema(schema):
|
|
|
28127
28129
|
'descriptions': [],
|
|
28128
28130
|
'type': setting['type'],
|
|
28129
28131
|
}
|
|
28130
|
-
if
|
|
28132
|
+
if mtype['name'] == savedTypeName and numSettings == 1:
|
|
28131
28133
|
setting_dict['name'] = savedSettingName
|
|
28132
|
-
|
|
28134
|
+
savedTypeName = ''
|
|
28133
28135
|
if setting_dict['type'] == 'TYPE_STRING' and setting.get('label') == 'LABEL_REPEATED':
|
|
28134
28136
|
setting_dict['type'] = 'TYPE_LIST'
|
|
28135
28137
|
if setting_dict['type'] == 'TYPE_ENUM':
|
|
@@ -28152,6 +28154,7 @@ def simplifyChromeSchema(schema):
|
|
|
28152
28154
|
break
|
|
28153
28155
|
elif setting_dict['type'] == 'TYPE_MESSAGE':
|
|
28154
28156
|
savedSettingName = setting_name
|
|
28157
|
+
savedTypeName = setting['typeName']
|
|
28155
28158
|
continue
|
|
28156
28159
|
else:
|
|
28157
28160
|
setting_dict['enums'] = None
|
|
@@ -28928,7 +28931,7 @@ def _showChromePolicySchema(schema, FJQC, i=0, count=0):
|
|
|
28928
28931
|
return
|
|
28929
28932
|
printEntity([Ent.CHROME_POLICY_SCHEMA, schema['name']], i, count)
|
|
28930
28933
|
Ind.Increment()
|
|
28931
|
-
showJSON(None, schema)
|
|
28934
|
+
showJSON(None, schema, dictObjectsKey={'messageType': 'name', 'field': 'name'})
|
|
28932
28935
|
Ind.Decrement()
|
|
28933
28936
|
|
|
28934
28937
|
CHROME_POLICY_SCHEMA_FIELDS_CHOICE_MAP = {
|
|
@@ -28951,6 +28954,9 @@ CHROME_POLICY_SCHEMA_FIELDS_CHOICE_MAP = {
|
|
|
28951
28954
|
# [formatjson]
|
|
28952
28955
|
def doInfoChromePolicySchemas():
|
|
28953
28956
|
cp = buildGAPIObject(API.CHROMEPOLICY)
|
|
28957
|
+
if checkArgumentPresent('std'):
|
|
28958
|
+
doInfoChromePolicySchemasStd(cp)
|
|
28959
|
+
return
|
|
28954
28960
|
FJQC = FormatJSONQuoteChar()
|
|
28955
28961
|
fieldsList = []
|
|
28956
28962
|
name = _getChromePolicySchemaName()
|
|
@@ -28979,7 +28985,7 @@ def doInfoChromePolicySchemas():
|
|
|
28979
28985
|
# [filter <String>]
|
|
28980
28986
|
# <ChromePolicySchemaFieldName>* [fields <ChromePolicySchemaFieldNameList>]
|
|
28981
28987
|
# [[formatjson [quotechar <Character>]]
|
|
28982
|
-
def
|
|
28988
|
+
def doPrintShowChromePolicySchemas():
|
|
28983
28989
|
def _printChromePolicySchema(schema):
|
|
28984
28990
|
row = flattenJSON(schema)
|
|
28985
28991
|
if not FJQC.formatJSON:
|
|
@@ -28993,10 +28999,12 @@ def doPrintShowChromeSchemas():
|
|
|
28993
28999
|
row['JSON'] = json.dumps(cleanJSON(schema), ensure_ascii=False, sort_keys=True)
|
|
28994
29000
|
csvPF.WriteRowNoFilter(row)
|
|
28995
29001
|
|
|
28996
|
-
if checkArgumentPresent('std'):
|
|
28997
|
-
doShowChromeSchemasStd()
|
|
28998
|
-
return
|
|
28999
29002
|
cp = buildGAPIObject(API.CHROMEPOLICY)
|
|
29003
|
+
if checkArgumentPresent('std'):
|
|
29004
|
+
if not Act.csvFormat():
|
|
29005
|
+
doShowChromePolicySchemasStd(cp)
|
|
29006
|
+
return
|
|
29007
|
+
unknownArgumentExit()
|
|
29000
29008
|
parent = _getCustomersCustomerIdWithC()
|
|
29001
29009
|
csvPF = CSVPrintFile(['name', 'schemaName', 'policyDescription',
|
|
29002
29010
|
'policyApiLifecycle.policyApiLifecycleStage',
|
|
@@ -29056,9 +29064,51 @@ def doPrintShowChromeSchemas():
|
|
|
29056
29064
|
if csvPF:
|
|
29057
29065
|
csvPF.writeCSVfile('Chrome Policy Schemas')
|
|
29058
29066
|
|
|
29067
|
+
def _showChromePolicySchemaStd(schema):
|
|
29068
|
+
printKeyValueList([f'{schema.get("name")}', f'{schema.get("description")}'])
|
|
29069
|
+
Ind.Increment()
|
|
29070
|
+
for val in schema['settings'].values():
|
|
29071
|
+
vtype = val.get('type')
|
|
29072
|
+
printKeyValueList([f'{val.get("name")}', f'{vtype}'])
|
|
29073
|
+
Ind.Increment()
|
|
29074
|
+
if vtype == 'TYPE_ENUM':
|
|
29075
|
+
enums = val.get('enums', [])
|
|
29076
|
+
descriptions = val.get('descriptions', [])
|
|
29077
|
+
for i in range(len(val.get('enums', []))):
|
|
29078
|
+
printKeyValueList([f'{enums[i]}', f'{descriptions[i]}'])
|
|
29079
|
+
elif vtype == 'TYPE_BOOL':
|
|
29080
|
+
pvs = val.get('descriptions')
|
|
29081
|
+
for pvi in pvs:
|
|
29082
|
+
if isinstance(pvi, dict):
|
|
29083
|
+
pvalue = pvi.get('value')
|
|
29084
|
+
pdescription = pvi.get('description')
|
|
29085
|
+
printKeyValueList([f'{pvalue}', f'{pdescription}'])
|
|
29086
|
+
elif isinstance(pvi, list):
|
|
29087
|
+
printKeyValueList([f'{pvi[0]}'])
|
|
29088
|
+
else:
|
|
29089
|
+
description = val.get('descriptions')
|
|
29090
|
+
if len(description) > 0:
|
|
29091
|
+
printKeyValueList([f'{description[0]}'])
|
|
29092
|
+
Ind.Decrement()
|
|
29093
|
+
Ind.Decrement()
|
|
29094
|
+
|
|
29095
|
+
# gam info chromeschema std <SchemaName>
|
|
29096
|
+
def doInfoChromePolicySchemasStd(cp):
|
|
29097
|
+
name = _getChromePolicySchemaName()
|
|
29098
|
+
checkForExtraneousArguments()
|
|
29099
|
+
try:
|
|
29100
|
+
schema = callGAPI(cp.customers().policySchemas(), 'get',
|
|
29101
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.BAD_REQUEST, GAPI.FORBIDDEN],
|
|
29102
|
+
name=name)
|
|
29103
|
+
_, schema_dict = simplifyChromeSchema(schema)
|
|
29104
|
+
_showChromePolicySchemaStd(schema_dict)
|
|
29105
|
+
except GAPI.notFound:
|
|
29106
|
+
entityUnknownWarning(Ent.CHROME_POLICY_SCHEMA, name)
|
|
29107
|
+
except (GAPI.badRequest, GAPI.forbidden):
|
|
29108
|
+
accessErrorExit(None)
|
|
29109
|
+
|
|
29059
29110
|
# gam show chromeschemas std [filter <String>]
|
|
29060
|
-
def
|
|
29061
|
-
cp = buildGAPIObject(API.CHROMEPOLICY)
|
|
29111
|
+
def doShowChromePolicySchemasStd(cp):
|
|
29062
29112
|
sfilter = None
|
|
29063
29113
|
while Cmd.ArgumentsRemaining():
|
|
29064
29114
|
myarg = getArgument()
|
|
@@ -29074,33 +29124,8 @@ def doShowChromeSchemasStd():
|
|
|
29074
29124
|
for schema in result:
|
|
29075
29125
|
schema_name, schema_dict = simplifyChromeSchema(schema)
|
|
29076
29126
|
schemas[schema_name.lower()] = schema_dict
|
|
29077
|
-
for _,
|
|
29078
|
-
|
|
29079
|
-
Ind.Increment()
|
|
29080
|
-
for val in value['settings'].values():
|
|
29081
|
-
vtype = val.get('type')
|
|
29082
|
-
printKeyValueList([f'{val.get("name")}', f'{vtype}'])
|
|
29083
|
-
Ind.Increment()
|
|
29084
|
-
if vtype == 'TYPE_ENUM':
|
|
29085
|
-
enums = val.get('enums', [])
|
|
29086
|
-
descriptions = val.get('descriptions', [])
|
|
29087
|
-
for i in range(len(val.get('enums', []))):
|
|
29088
|
-
printKeyValueList([f'{enums[i]}', f'{descriptions[i]}'])
|
|
29089
|
-
elif vtype == 'TYPE_BOOL':
|
|
29090
|
-
pvs = val.get('descriptions')
|
|
29091
|
-
for pvi in pvs:
|
|
29092
|
-
if isinstance(pvi, dict):
|
|
29093
|
-
pvalue = pvi.get('value')
|
|
29094
|
-
pdescription = pvi.get('description')
|
|
29095
|
-
printKeyValueList([f'{pvalue}', f'{pdescription}'])
|
|
29096
|
-
elif isinstance(pvi, list):
|
|
29097
|
-
printKeyValueList([f'{pvi[0]}'])
|
|
29098
|
-
else:
|
|
29099
|
-
description = val.get('descriptions')
|
|
29100
|
-
if len(description) > 0:
|
|
29101
|
-
printKeyValueList([f'{description[0]}'])
|
|
29102
|
-
Ind.Decrement()
|
|
29103
|
-
Ind.Decrement()
|
|
29127
|
+
for _, schema in sorted(iter(schemas.items())):
|
|
29128
|
+
_showChromePolicySchemaStd(schema)
|
|
29104
29129
|
printBlankLine()
|
|
29105
29130
|
|
|
29106
29131
|
# gam create chromenetwork
|
|
@@ -76137,7 +76162,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
|
|
|
76137
76162
|
Cmd.ARG_CHROMENEEDSATTN: doPrintShowChromeNeedsAttn,
|
|
76138
76163
|
Cmd.ARG_CHROMEPOLICY: doPrintShowChromePolicies,
|
|
76139
76164
|
Cmd.ARG_CHROMEPROFILE: doPrintShowChromeProfiles,
|
|
76140
|
-
Cmd.ARG_CHROMESCHEMA:
|
|
76165
|
+
Cmd.ARG_CHROMESCHEMA: doPrintShowChromePolicySchemas,
|
|
76141
76166
|
Cmd.ARG_CHROMESNVALIDITY: doPrintChromeSnValidity,
|
|
76142
76167
|
Cmd.ARG_CHROMEVERSIONS: doPrintShowChromeVersions,
|
|
76143
76168
|
Cmd.ARG_CIGROUP: doPrintCIGroups,
|
|
@@ -76269,7 +76294,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
|
|
|
76269
76294
|
Cmd.ARG_CHROMENEEDSATTN: doPrintShowChromeNeedsAttn,
|
|
76270
76295
|
Cmd.ARG_CHROMEPOLICY: doPrintShowChromePolicies,
|
|
76271
76296
|
Cmd.ARG_CHROMEPROFILE: doPrintShowChromeProfiles,
|
|
76272
|
-
Cmd.ARG_CHROMESCHEMA:
|
|
76297
|
+
Cmd.ARG_CHROMESCHEMA: doPrintShowChromePolicySchemas,
|
|
76273
76298
|
Cmd.ARG_CHROMEVERSIONS: doPrintShowChromeVersions,
|
|
76274
76299
|
Cmd.ARG_CIGROUPMEMBERS: doShowCIGroupMembers,
|
|
76275
76300
|
Cmd.ARG_CIPOLICY: doPrintShowCIPolicies,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=k24a3tQujvq-K_PZ-10jWwxI5_JNQF17IeNgswZNo4s,3518201
|
|
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
|
|
@@ -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.9.
|
|
69
|
-
gam7-7.9.
|
|
70
|
-
gam7-7.9.
|
|
71
|
-
gam7-7.9.
|
|
72
|
-
gam7-7.9.
|
|
68
|
+
gam7-7.9.2.dist-info/METADATA,sha256=CpMi20gNqtuKBx1Z1Z7K70qhg7vscF_HLoQGNW99DNE,2977
|
|
69
|
+
gam7-7.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.9.2.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.9.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.9.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|