0
我做下面創建一個用戶資源做SDK管理目錄API一個user.insert在Python腳本:如何創建Python腳本一個user.alias資源
userinfo = { 'primaryEmail': '[email protected]', 'name': { 'given_name': 'joe', 'familyName': 'smith' }, 'password': 'password' }
service = build("admin", "directory_v1", http=http)
service.users().insert(body=userinfo).execute()
How do I similarly create a user.alias resource so that I can do something like:
userinfo = {'alias': '[email protected]'}
service.users().alias.insert([email protected], body=userinfo).execute
獲取:
AttributeError: 'Resource' object has no attribute 'alias' ... or variants thereof with modifications. Twisted in the syntax for "user.alias" resources.
我解決如下:service.users()。別名()。insert(userKe[email protected],body = userinfo).execute – Tim 2015-01-29 00:17:01