diff --git a/src/GamCommands.txt b/src/GamCommands.txt index b8414857..fbe72f8c 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -141,6 +141,7 @@ If an item contains spaces, it should be surrounded by ". ::= [user:]|group:|domain[:]|default ::= ::= + ::= ::= |id: ::= editor|freebusy|freebusyreader|owner|reader|writer ::= user:|group:|domain:|default @@ -554,6 +555,7 @@ Items, separated by spaces, with spaces, commas or single quotes in the items th ::= "(,)*" ::= "(,)*" ::= "(,)*" + ::= "(,g)*" ::= "(,)*" ::= "(,)*" ::= "(,)*" @@ -1152,11 +1154,18 @@ gam info device [id] gam delete device [id] gam cancelwipe device [id] gam wipe device [id] + gam approve deviceuser [id] gam block deviceuser [id] gam delete deviceuser [id] gam cancelwipe deviceuser [id] gam wipe deviceuser [id] +gam update deviceuserstate [id] + [clientid ] [customid ] [assettags clear|] + [compliantstate|compliancestate compliant|noncompliant] [managedstate clear|managed|unmanaged] + [healthscore verypoor|poor|neutral|good|verygood] [scorereason clear|] + (customvalue (bool )|(number )|(string ))* + gam print devices [todrive] [filter|query ] [orderby [ascending|descending]] [company|personal|nocompanydevices|nopersonaldevices] diff --git a/src/gam/gapi/cloudidentity/devices.py b/src/gam/gapi/cloudidentity/devices.py index 29b7c16d..3af096b0 100644 --- a/src/gam/gapi/cloudidentity/devices.py +++ b/src/gam/gapi/cloudidentity/devices.py @@ -146,7 +146,7 @@ def update_state(): client_id = f'{customer}-{sys.argv[i+1]}' i += 2 elif myarg in ['assettag', 'assettags']: - body['assetTags'] = sys.argv[i+1].split(',') + body['assetTags'] = gam.shlexSplitList(sys.argv[i+1]) if body['assetTags'] == ['clear']: # TODO: this doesn't work to clear # existing values. Figure out why. @@ -176,21 +176,20 @@ def update_state(): sys.argv[i+1]) i += 2 elif myarg == 'customvalue': - allowed_types = ['boolValue', 'numberValue', 'stringValue'] - value_type = f'{sys.argv[i+1].lower()}Value' + allowed_types = ['bool', 'number', 'string'] + value_type = sys.argv[i+1].lower() if value_type not in allowed_types: controlflow.expected_argument_exit('custom_value', ', '.join(allowed_types), sys.argv[i+1]) key = sys.argv[i+2] value = sys.argv[i+3] - if value_type == 'boolValue': + if value_type == 'bool': value = gam.getBoolean(value, key) - elif value_type == 'numberValue': + elif value_type == 'number': value = int(value) - if 'keyValuePairs' not in body: - body['keyValuePairs'] = {} - body['keyValuePairs'][key] = {value_type: value} + body.setdefault('keyValuePairs', {}) + body['keyValuePairs'][key] = {f'{value_type}Value': value} i += 4 elif myarg in ['managedstate']: managed_states = gapi.get_enum_values_minus_unspecified(