Reference documentation and code samples for the Google Apps Chat V1 Client class User.
A user in Google Chat.
When returned as an output from a request, if your Chat app authenticates as
a
user,
the output for a User resource only populates the user's name and type.
Generated from protobuf message google.chat.v1.User
Namespace
Google \ Apps \ Chat \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Resource name for a Google Chat user. Format: users/{user}. users/app can be used as an alias for the calling app bot user. For human users, {user} is the same user identifier as: - the id for the Person in the People API. For example, users/123456789 in Chat API represents the same person as the 123456789 Person profile ID in People API. - the id for a user in the Admin SDK Directory API. - the user's email address can be used as an alias for {user} in API requests. For example, if the People API Person profile ID for user@example.com is 123456789, you can use users/user@example.com as an alias to reference users/123456789. Only the canonical resource name (for example users/123456789) will be returned from the API.
↳ display_name
string
Output only. The user's display name.
↳ domain_id
string
Unique identifier of the user's Google Workspace domain.
↳ type
int
User type.
↳ is_anonymous
bool
Output only. When true, the user is deleted or their profile is not visible.
Format: users/{user}. users/app can be used as an alias for the calling
app bot user.
For human users, {user} is the same
user identifier as:
the id for the
Person in the
People API. For example, users/123456789 in Chat API represents the same
person as the 123456789 Person profile ID in People API.
the user's email address can be used as an alias for {user} in API
requests. For example, if the People API Person profile ID for
user@example.com is 123456789, you can use users/user@example.com as
an alias to reference users/123456789. Only the canonical resource name
(for example users/123456789) will be returned from the API.
Format: users/{user}. users/app can be used as an alias for the calling
app bot user.
For human users, {user} is the same
user identifier as:
the id for the
Person in the
People API. For example, users/123456789 in Chat API represents the same
person as the 123456789 Person profile ID in People API.
the user's email address can be used as an alias for {user} in API
requests. For example, if the People API Person profile ID for
user@example.com is 123456789, you can use users/user@example.com as
an alias to reference users/123456789. Only the canonical resource name
(for example users/123456789) will be returned from the API.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDisplayName
Output only. The user's display name.
Returns
Type
Description
string
setDisplayName
Output only. The user's display name.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDomainId
Unique identifier of the user's Google Workspace domain.
Returns
Type
Description
string
setDomainId
Unique identifier of the user's Google Workspace domain.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getType
User type.
Returns
Type
Description
int
setType
User type.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getIsAnonymous
Output only. When true, the user is deleted or their profile is not
visible.
Returns
Type
Description
bool
setIsAnonymous
Output only. When true, the user is deleted or their profile is not
visible.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class User (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Chat.V1.User)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Chat.V1.User)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Chat.V1.User)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Chat.V1.User)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Chat.V1.User)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Chat.V1.User)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Chat.V1.User)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Chat.V1.User)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Chat.V1.User)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Chat.V1.User)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Chat.V1.User)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Chat.V1.User) \nReference documentation and code samples for the Google Apps Chat V1 Client class User.\n\nA user in Google Chat.\n\nWhen returned as an output from a request, if your Chat app [authenticates as\na\nuser](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),\nthe output for a `User` resource only populates the user's `name` and `type`.\n\nGenerated from protobuf message `google.chat.v1.User`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Chat \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nResource name for a Google Chat [user](/php/docs/reference/apps-chat/latest/Chat.V1.User).\n\nFormat: `users/{user}`. `users/app` can be used as an alias for the calling\napp [bot](/php/docs/reference/apps-chat/latest/Chat.V1.User.Type#_Google_Apps_Chat_V1_User_Type__BOT) user.\nFor [human users](/php/docs/reference/apps-chat/latest/Chat.V1.User.Type#_Google_Apps_Chat_V1_User_Type__HUMAN), `{user}` is the same\nuser identifier as:\n\n- the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API.\n- the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API.\n- the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.\n\n### setName\n\nResource name for a Google Chat [user](/php/docs/reference/apps-chat/latest/Chat.V1.User).\n\nFormat: `users/{user}`. `users/app` can be used as an alias for the calling\napp [bot](/php/docs/reference/apps-chat/latest/Chat.V1.User.Type#_Google_Apps_Chat_V1_User_Type__BOT) user.\nFor [human users](/php/docs/reference/apps-chat/latest/Chat.V1.User.Type#_Google_Apps_Chat_V1_User_Type__HUMAN), `{user}` is the same\nuser identifier as:\n\n- the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API.\n- the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API.\n- the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.\n\n### getDisplayName\n\nOutput only. The user's display name.\n\n### setDisplayName\n\nOutput only. The user's display name.\n\n### getDomainId\n\nUnique identifier of the user's Google Workspace domain.\n\n### setDomainId\n\nUnique identifier of the user's Google Workspace domain.\n\n### getType\n\nUser type.\n\n### setType\n\nUser type.\n\n### getIsAnonymous\n\nOutput only. When `true`, the user is deleted or their profile is not\nvisible.\n\n### setIsAnonymous\n\nOutput only. When `true`, the user is deleted or their profile is not\nvisible."]]