From f252f757f137139a23c960a1a2518c75f0d7b621 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 12 Mar 2021 13:03:04 -0800 Subject: [PATCH] UserInvitations clean up (#1329) * UserInvitations clean up This version of Cloud Identity API wants C in customer I commented it out in case the developers figure out that it's inconsistent with devices and groups Delete extraneous code * Update userinvitations.py --- src/gam/gapi/cloudidentity/userinvitations.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gam/gapi/cloudidentity/userinvitations.py b/src/gam/gapi/cloudidentity/userinvitations.py index fe176d1f..2ca132c6 100644 --- a/src/gam/gapi/cloudidentity/userinvitations.py +++ b/src/gam/gapi/cloudidentity/userinvitations.py @@ -13,10 +13,7 @@ from gam.gapi import cloudidentity as gapi_cloudidentity def _get_customerid(): ''' returns customer in format needed for this API''' - customer = GC_Values[GC_CUSTOMER_ID] - if customer.startswith('C'): - customer = customer[1:] - return f'customers/{customer}' + return f'customers/{GC_Values[GC_CUSTOMER_ID]}' def _reduce_name(name): ''' converts long name into email address''' @@ -33,12 +30,9 @@ def _generic_action(action): 'send': 'Sending' } print_action = action_map[action] - kwargs = {} - if action != 'get': - kwargs['body'] = {} print(f'{print_action} user invite...') result = gapi.call(svc.customers().userinvitations(), action, - name=name, **kwargs) + name=name) name = result.get('response', {}).get('name') if name: result['response']['name'] = _reduce_name(name)