【发布时间】:2021-08-25 16:07:35
【问题描述】:
我们目前在 Google 管理员中为我们公司拥有的所有 Chromebook 设备提供了自定义字段。我目前正在寻找从 Google Admin SDK API 获取我们的自定义字段。我已经研究了所有 Google's documentation,但没有看到任何引用自定义字段的内容。
谁能给我提供这方面的文件?
【问题讨论】:
标签: google-admin-sdk
我们目前在 Google 管理员中为我们公司拥有的所有 Chromebook 设备提供了自定义字段。我目前正在寻找从 Google Admin SDK API 获取我们的自定义字段。我已经研究了所有 Google's documentation,但没有看到任何引用自定义字段的内容。
谁能给我提供这方面的文件?
【问题讨论】:
标签: google-admin-sdk
希望这会有所帮助——我也在为同样的事情苦苦挣扎。 “预测/看涨期权”是您所需要的:
// Projection and associated type/method implements CallOption
// interface to enable seeing custom user attributes.
//
// https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/get#Projection
// https://github.com/googleapis/google-api-go-client/blob/v0.14.0/googleapi/googleapi.go#L378
func Projection(p string) googleapi.CallOption {
return projection(p)
}
// ...
func whatever() {
// lists user with custom attributes
u, _ := client.Users.Get(email).Do(Projection("FULL"))
fmt.Printf("DEBUG: %+v", string(u.CustomSchemas["attribute_name"]))
}
【讨论】: