Google Directory API通过Golang中的API调用获取自定义架构

时间:2018-07-25 09:19:02

标签: go google-api gsuite google-directory-api

从Gsuite中检索所有用户后,

allUsers, err := adminService.Users.List().Domain("myDomain").MaxResults(maxResults).Do()

有没有一种方法可以通过简单的调用(例如

)来获取某个我感兴趣的自定义模式字段的值。
for _, u := range allUsers.Users {
    fullName := u.Name.FullName //this would give me the fullName
  //does something like u.CustomSchema["Name of field I am interested in"] exist?

到目前为止,我所发现的只是有了u.CustomSchema我得到了

CustomSchema,类型为map[string]googleapi.RawMessage

所以我将需要编组JSON等等,如果可以避免的话,这将非常麻烦

0 个答案:

没有答案