in libs/google/admin.py [0:0]
def suspend(self, user_key):
"""
Suspends a user.
:param user_key: userKey
:return: bool
Note: When suspending a user, we expect the response to be True.
"""
result = True
try:
r = json.loads(self.call_google_api(service=self.service,
api_resource="users",
api_method="update",
response_field="suspended",
userKey=user_key,
body={"suspended": True}))
if r is True:
result = True
except(ValueError, KeyError, TypeError):
result = False
return result