动态群组查询的有效用户字段

本页面概述了可在成员资格查询中使用的受支持的 CEL 字段和功能。

用户字段

Admin SDK 的 User 资源中的以下字段可用于成员资格查询。

字段 子字段
addresses country
country_code
custom_type
extended_address
locality
po_box
postal_code
primary
region
street_address
type
archived boolean
change_password_at_next_login boolean
is_2sv_enforced boolean
is_enrolled_in_2sv boolean
is_mailbox_setup boolean
locations area
building_id
custom_type
desk_code
floor_name
floor_section
type
organizations cost_center
custom_type
department
description
domain
location
name
primary
symbol
title
type
relations custom_type
type
value
emails address
custom_type
primary
type
external_ids custom_type
type
value
gender address_me_as
custom_gender
type
ims custom_protocol
custom_type
standard_protocol
primary
type
value
keywords custom_type
type
value
languages language_code
name family_name
given_name
value
phones custom_type
primary
type
value
suspended boolean
suspension_reason custom_type
type
value
websites custom_type
primary
type
value

类型特性

上表中的 type 特性使用枚举值而不是其字符串表示形式进行匹配。以下列表将每种类型的字符串表示形式记录到相应的枚举值。

属性 枚举值 字符串表示形式
地址数 0 未知
1 自定义
2 家庭
3 工作
4 其他
位置 0 默认
1 自定义
2 办公桌
单位 0 未知
1 工作
2 学校
3 仅限网域内
Relations(关系) 12 经理
电子邮件 0 未知
1 自定义
2 家庭
3 工作
4 其他
外部 ID 0 未知
1 自定义
2 账号
3 customer
4 网络
5 组织
6 login_id
性别 0 未知
1 男性的/男性
2 雌的/女性
3 其他
IMS 标准协议 0 默认
1 自定义协议
2 aim
3 msn
4 yahoo
5 skype
6 qq
7 gtalk
8 icq
9 jabber
10 net meeting
IMS 类型 0 未知
1 自定义
2 家庭
3 工作
4 其他
关键字 0 未知
1 自定义
2 任务
3 occupation
4 outlook
Phones(电话号码) 0 未知
1 自定义
2 家庭
3 工作
4 其他
5 家庭传真
6 工作传真
7 移动
8 寻呼机
9 其他传真
10 公司总机
11 Google 助理
12 汽车
13 收音机
14 isdn
15 callback
16 电报
17 tty tdd
18 工作手机
19 工作寻呼机
20 main
21 Grand Central
22 Enterprise Voice
暂停原因 1 admin
2 13 以下
3 需要 Web 登录
4 abuse
5 滥用 - 管理员可以恢复
Websites(网站) 0 未知
1 应用安装信息页
2 博客
3 自定义
4 ftp
5 家庭
6 首页
7 其他
8 分析
9 预订
10 resume
11 工作

组织部门字段

您还可以使用 orgUnitId 字段查询成员资格,以包括直接或间接属于该单位部门的所有用户。如需详细了解如何检索 orgUnitId 值,请参阅 Admin SDK 参考文档

查询示例

  • 给定单位部门下的所有直接用户:

    user.org_unit_id==orgUnitId('03ph8a2z1enx4lx')
    
  • 给定单位部门下的所有直接和间接用户:

    user.org_units.exists(org_unit, org_unit.org_unit_id==orgUnitId('03ph8a2z1khexns'))
    

其他查询类型

  • 由特定个人管理的所有用户:

    user.managers.exists(manager, manager.user_id == userId('MANAGER_ID'))
    

    MANAGER_ID 替换为管理人员的唯一用户 ID。您可以使用管理人员的电子邮件地址作为 userKey,通过 AdminSDK Directory API 检索此 ID。