mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
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
This commit is contained in:
@@ -13,10 +13,7 @@ from gam.gapi import cloudidentity as gapi_cloudidentity
|
|||||||
|
|
||||||
def _get_customerid():
|
def _get_customerid():
|
||||||
''' returns customer in format needed for this API'''
|
''' returns customer in format needed for this API'''
|
||||||
customer = GC_Values[GC_CUSTOMER_ID]
|
return f'customers/{GC_Values[GC_CUSTOMER_ID]}'
|
||||||
if customer.startswith('C'):
|
|
||||||
customer = customer[1:]
|
|
||||||
return f'customers/{customer}'
|
|
||||||
|
|
||||||
def _reduce_name(name):
|
def _reduce_name(name):
|
||||||
''' converts long name into email address'''
|
''' converts long name into email address'''
|
||||||
@@ -33,12 +30,9 @@ def _generic_action(action):
|
|||||||
'send': 'Sending'
|
'send': 'Sending'
|
||||||
}
|
}
|
||||||
print_action = action_map[action]
|
print_action = action_map[action]
|
||||||
kwargs = {}
|
|
||||||
if action != 'get':
|
|
||||||
kwargs['body'] = {}
|
|
||||||
print(f'{print_action} user invite...')
|
print(f'{print_action} user invite...')
|
||||||
result = gapi.call(svc.customers().userinvitations(), action,
|
result = gapi.call(svc.customers().userinvitations(), action,
|
||||||
name=name, **kwargs)
|
name=name)
|
||||||
name = result.get('response', {}).get('name')
|
name = result.get('response', {}).get('name')
|
||||||
if name:
|
if name:
|
||||||
result['response']['name'] = _reduce_name(name)
|
result['response']['name'] = _reduce_name(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user