Reference documentation and code samples for the Google Apps Chat V1 Client class Space.
A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
Generated from protobuf message google.chat.v1.Space
Namespace
Google \ Apps \ Chat \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ name
string
Identifier. Resource name of the space. Format: spaces/{space}
Where {space}
represents the system-assigned ID for the space. You can obtain the space ID by calling the spaces.list()
method or from the space URL. For example, if the space URL is https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA
, the space ID is AAAAAAAAA
.
↳ type
int
Output only. Deprecated: Use space_type
instead. The type of a space.
↳ space_type
int
Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
↳ single_user_bot_dm
bool
Optional. Whether the space is a DM between a Chat app and a single human.
↳ threaded
bool
Output only. Deprecated: Use spaceThreadingState
instead. Whether messages are threaded in this space.
↳ display_name
string
Optional. The space's display name. Required when creating a space
with a spaceType
of SPACE
. If you receive the error message ALREADY_EXISTS
when creating a space or updating the displayName
, try a different displayName
. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
↳ external_user_allowed
bool
Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
↳ space_threading_state
int
Output only. The threading state in the Chat space.
↳ space_details
↳ space_history_state
int
Optional. The message history state for messages and threads in this space.
↳ import_mode
bool
Optional. Whether this space is created in Import Mode
as part of a data migration into Google Workspace. While spaces are being imported, they aren't visible to users until the import is complete. Creating a space in Import Mode
requires user authentication
.
↳ create_time
Google\Protobuf\Timestamp
Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when spaceType
is GROUP_CHAT
or SPACE
.
↳ last_active_time
↳ admin_installed
bool
Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
↳ membership_count
Space\MembershipCount
Output only. The count of joined memberships grouped by member type. Populated when the space_type
is SPACE
, DIRECT_MESSAGE
or GROUP_CHAT
.
↳ access_settings
Space\AccessSettings
Optional. Specifies the access setting
of the space. Only populated when the space_type
is SPACE
.
↳ customer
string
Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with app authentication
and SpaceType
is SPACE
, otherwise should not be set. In the format customers/{customer}
, where customer
is the id
from the Admin SDK customer resource
. Private apps can also use the customers/my_customer
alias to create the space in the same Google Workspace organization as the app. For DMs, this field isn't populated.
↳ space_uri
string
Output only. The URI for a user to access the space.
↳ predefined_permission_settings
int
Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the PermissionSettings
field. Setting predefined permission settings supports: - App authentication
with administrator approval
with the chat.app.spaces
or chat.app.spaces.create
scopes. - User authentication
↳ permission_settings
Space\PermissionSettings
Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating permission settings supports: - App authentication
with administrator approval
with the chat.app.spaces
scope. Only populated and settable when the Chat app created the space. - User authentication
↳ import_mode_expire_time
Google\Protobuf\Timestamp
Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using spaces.completeImport
. This field is only populated for spaces that were created with import mode.
getName
Identifier. Resource name of the space.
Format: spaces/{space}
Where {space}
represents the system-assigned ID for the space. You can
obtain the space ID by calling the spaces.list()
method or from the space URL. For example, if the space URL
is https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA
, the space ID
is AAAAAAAAA
.
string
setName
Identifier. Resource name of the space.
Format: spaces/{space}
Where {space}
represents the system-assigned ID for the space. You can
obtain the space ID by calling the spaces.list()
method or from the space URL. For example, if the space URL
is https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA
, the space ID
is AAAAAAAAA
.
var
string
$this
getType
Output only. Deprecated: Use space_type
instead.
The type of a space.
int
setType
Output only. Deprecated: Use space_type
instead.
The type of a space.
var
int
$this
getSpaceType
Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
int
setSpaceType
Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
var
int
$this
getSingleUserBotDm
Optional. Whether the space is a DM between a Chat app and a single human.
bool
setSingleUserBotDm
Optional. Whether the space is a DM between a Chat app and a single human.
var
bool
$this
getThreaded
Output only. Deprecated: Use spaceThreadingState
instead.
Whether messages are threaded in this space.
bool
setThreaded
Output only. Deprecated: Use spaceThreadingState
instead.
Whether messages are threaded in this space.
var
bool
$this
getDisplayName
Optional. The space's display name. Required when creating a
space
with a spaceType
of SPACE
. If you receive the error message ALREADY_EXISTS
when creating a space or updating the displayName
, try a
different displayName
. An existing space within the Google Workspace
organization might already use this display name.
For direct messages, this field might be empty. Supports up to 128 characters.
string
setDisplayName
Optional. The space's display name. Required when creating a
space
with a spaceType
of SPACE
. If you receive the error message ALREADY_EXISTS
when creating a space or updating the displayName
, try a
different displayName
. An existing space within the Google Workspace
organization might already use this display name.
For direct messages, this field might be empty. Supports up to 128 characters.
var
string
$this
getExternalUserAllowed
Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization.
Omit this field when creating spaces in the following conditions:
- The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
bool
setExternalUserAllowed
Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization.
Omit this field when creating spaces in the following conditions:
- The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
var
bool
$this
getSpaceThreadingState
Output only. The threading state in the Chat space.
int
setSpaceThreadingState
Output only. The threading state in the Chat space.
var
int
$this
getSpaceDetails
Optional. Details about the space including description and rules.
hasSpaceDetails
clearSpaceDetails
setSpaceDetails
Optional. Details about the space including description and rules.
$this
getSpaceHistoryState
Optional. The message history state for messages and threads in this space.
int
setSpaceHistoryState
Optional. The message history state for messages and threads in this space.
var
int
$this
getImportMode
Optional. Whether this space is created in Import Mode
as part of a data
migration into Google Workspace. While spaces are being imported, they
aren't visible to users until the import is complete.
Creating a space in Import Mode
requires user
authentication
.
bool
setImportMode
Optional. Whether this space is created in Import Mode
as part of a data
migration into Google Workspace. While spaces are being imported, they
aren't visible to users until the import is complete.
Creating a space in Import Mode
requires user
authentication
.
var
bool
$this
getCreateTime
Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces.
For import mode spaces, set this field to the historical timestamp at which
the space was created in the source in order to preserve the original
creation time.
Only populated in the output when spaceType
is GROUP_CHAT
or SPACE
.
hasCreateTime
clearCreateTime
setCreateTime
Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces.
For import mode spaces, set this field to the historical timestamp at which
the space was created in the source in order to preserve the original
creation time.
Only populated in the output when spaceType
is GROUP_CHAT
or SPACE
.
$this
getLastActiveTime
Output only. Timestamp of the last message in the space.
hasLastActiveTime
clearLastActiveTime
setLastActiveTime
Output only. Timestamp of the last message in the space.
$this
getAdminInstalled
Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization.
To support admin install, your Chat app must feature direct messaging.
bool
setAdminInstalled
Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization.
To support admin install, your Chat app must feature direct messaging.
var
bool
$this
getMembershipCount
Output only. The count of joined memberships grouped by member type.
Populated when the space_type
is SPACE
, DIRECT_MESSAGE
or GROUP_CHAT
.
hasMembershipCount
clearMembershipCount
setMembershipCount
Output only. The count of joined memberships grouped by member type.
Populated when the space_type
is SPACE
, DIRECT_MESSAGE
or GROUP_CHAT
.
$this
getAccessSettings
Optional. Specifies the access setting of the space.
Only populated when the space_type
is SPACE
.
hasAccessSettings
clearAccessSettings
setAccessSettings
Optional. Specifies the access setting of the space.
Only populated when the space_type
is SPACE
.
$this
getCustomer
Optional. Immutable. The customer id of the domain of the space.
Required only when creating a space with app
authentication
and SpaceType
is SPACE
, otherwise should not be set.
In the format customers/{customer}
, where customer
is the id
from the Admin SDK customer resource
.
Private apps can also use the customers/my_customer
alias to create
the space in the same Google Workspace organization as the app.
For DMs, this field isn't populated.
string
hasCustomer
clearCustomer
setCustomer
Optional. Immutable. The customer id of the domain of the space.
Required only when creating a space with app
authentication
and SpaceType
is SPACE
, otherwise should not be set.
In the format customers/{customer}
, where customer
is the id
from the Admin SDK customer resource
.
Private apps can also use the customers/my_customer
alias to create
the space in the same Google Workspace organization as the app.
For DMs, this field isn't populated.
var
string
$this
getSpaceUri
Output only. The URI for a user to access the space.
string
setSpaceUri
Output only. The URI for a user to access the space.
var
string
$this
getPredefinedPermissionSettings
Optional. Input only. Predefined space permission settings, input only
when creating a space. If the field is not set, a collaboration space is
created. After you create the space, settings are populated in the PermissionSettings
field.
Setting predefined permission settings supports:
- App
authentication
with administrator
approval
with the
chat.app.spaces
orchat.app.spaces.create
scopes. - User authentication
int
hasPredefinedPermissionSettings
setPredefinedPermissionSettings
Optional. Input only. Predefined space permission settings, input only
when creating a space. If the field is not set, a collaboration space is
created. After you create the space, settings are populated in the PermissionSettings
field.
Setting predefined permission settings supports:
- App
authentication
with administrator
approval
with the
chat.app.spaces
orchat.app.spaces.create
scopes. - User authentication
var
int
$this
getPermissionSettings
Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings.
Reading and updating permission settings supports:
- App
authentication
with administrator
approval
with the
chat.app.spaces
scope. Only populated and settable when the Chat app created the space. - User authentication
hasPermissionSettings
setPermissionSettings
Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings.
Reading and updating permission settings supports:
- App
authentication
with administrator
approval
with the
chat.app.spaces
scope. Only populated and settable when the Chat app created the space. - User authentication
$this
getImportModeExpireTime
Output only. The time when the space will be automatically deleted by the system if it remains in import mode.
Each space created in import mode must exit this mode before this expire
time using spaces.completeImport
.
This field is only populated for spaces that were created with import mode.
hasImportModeExpireTime
clearImportModeExpireTime
setImportModeExpireTime
Output only. The time when the space will be automatically deleted by the system if it remains in import mode.
Each space created in import mode must exit this mode before this expire
time using spaces.completeImport
.
This field is only populated for spaces that were created with import mode.
$this
getSpacePermissionSettings
string