Reference documentation and code samples for the Google Apps Chat V1 Client class SearchSpacesRequest.
Request to search for a list of spaces based on a query.
Generated from protobuf message google.chat.v1.SearchSpacesRequest
Namespace
Google \ Apps \ Chat \ V1Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ use_admin_access |
bool
When |
↳ page_size |
int
The maximum number of spaces to return. The service may return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000 when |
↳ page_token |
string
A token, received from the previous search spaces call. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. |
↳ query |
string
Required. A search query. You can search by using the following parameters when |
↳ order_by |
string
Optional. How the list of spaces is ordered. Supported attributes to order by are: - |
getUseAdminAccess
When true, the method runs using the user's Google Workspace
administrator privileges.
The calling user must be a Google Workspace administrator with the
manage chat and spaces conversations
privilege.
Requires either the chat.admin.spaces.readonly or chat.admin.spaces
OAuth 2.0
scope.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setUseAdminAccess
When true, the method runs using the user's Google Workspace
administrator privileges.
The calling user must be a Google Workspace administrator with the
manage chat and spaces conversations
privilege.
Requires either the chat.admin.spaces.readonly or chat.admin.spaces
OAuth 2.0
scope.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getPageSize
The maximum number of spaces to return. The service may return fewer than this value.
If unspecified, at most 100 spaces are returned.
The maximum value is 1000 when useAdminAccess is set to true.
Otherwise, the maximum value is 100. If you use a value more than the
maximum value, it's automatically changed to the maximum value.
| Returns | |
|---|---|
| Type | Description |
int |
|
setPageSize
The maximum number of spaces to return. The service may return fewer than this value.
If unspecified, at most 100 spaces are returned.
The maximum value is 1000 when useAdminAccess is set to true.
Otherwise, the maximum value is 100. If you use a value more than the
maximum value, it's automatically changed to the maximum value.
| Parameter | |
|---|---|
| Name | Description |
var |
int
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getPageToken
A token, received from the previous search spaces call. Provide this parameter to retrieve the subsequent page.
When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
| Returns | |
|---|---|
| Type | Description |
string |
|
setPageToken
A token, received from the previous search spaces call. Provide this parameter to retrieve the subsequent page.
When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getQuery
Required. A search query.
You can search by using the following parameters when useAdminAccess
is set to true:
create_timecustomerdisplay_nameexternal_user_allowedlast_active_timespace_history_statespace_typeWhenuseAdminAccessis set tofalse:display_nameexternal_user_allowedspace_typecreate_timeandlast_active_timeaccept a timestamp in RFC-3339 format and the supported comparison operators are:=,<,>,<=,>=.customeris required whenuseAdminAccessis set totrue, and is used to indicate which customer to fetch spaces from.customers/my_customeris the only supported value.display_nameonly accepts theHAS(:) operator. The text to match is first tokenized into tokens and each token is prefix-matched case-insensitively and independently as a substring anywhere in the space'sdisplay_name. For example,Fun EvematchesFun eventorThe evening was fun, but notnotFun eventoreven. WhenuseAdminAccessis set tofalse,display_nameis required to retrieve meaningful results. Otherwise, the default behavior is to return an empty response.external_user_allowedaccepts eithertrueorfalse.space_history_stateonly accepts values from thehistoryStatefield of aspaceresource.space_typeis required and the only valid value isSPACE. Across different fields, onlyANDoperators are supported. A valid example isspace_type = "SPACE" AND display_name:"Hello"and an invalid example isspace_type = "SPACE" OR display_name:"Hello". Among the same field,space_typedoesn't supportANDorORoperators.display_name, 'space_history_state', and 'external_user_allowed' only supportORoperators.last_active_timeandcreate_timesupport bothANDandORoperators.ANDcan only be used to represent an interval, such aslast_active_time < "2022-01-01T00:00:00+00:00" AND last_active_time > "2023-01-01T00:00:00+00:00". The following example queries are valid whenuseAdminAccessis set totrue:php customer = "customers/my_customer" AND space_type = "SPACE" customer = "customers/my_customer" AND space_type = "SPACE" AND display_name:"Hello World" customer = "customers/my_customer" AND space_type = "SPACE" AND (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > "2022-01-01T00:00:00+00:00") customer = "customers/my_customer" AND space_type = "SPACE" AND (display_name:"Hello World" OR display_name:"Fun event") AND (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < "2022-01-01T00:00:00+00:00") customer = "customers/my_customer" AND space_type = "SPACE" AND (create_time > "2019-01-01T00:00:00+00:00" AND create_time < "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF")The following example queries are valid whenuseAdminAccessis set tofalse:php display_name:"Hello World" AND space_type = "SPACE" (display_name:"Hello" OR display_name:"Fun") AND space_type = "SPACE" (external_user_allowed = "true" AND space_type = "SPACE") // Returns an empty response. (external_user_allowed = "true" AND display_name:"Hello" AND space_type = "SPACE")The maximum query length is 1,000 characters. Invalid queries are rejected by the server with anINVALID_ARGUMENTerror.
| Returns | |
|---|---|
| Type | Description |
string |
|
setQuery
Required. A search query.
You can search by using the following parameters when useAdminAccess
is set to true:
create_timecustomerdisplay_nameexternal_user_allowedlast_active_timespace_history_statespace_typeWhenuseAdminAccessis set tofalse:display_nameexternal_user_allowedspace_typecreate_timeandlast_active_timeaccept a timestamp in RFC-3339 format and the supported comparison operators are:=,<,>,<=,>=.customeris required whenuseAdminAccessis set totrue, and is used to indicate which customer to fetch spaces from.customers/my_customeris the only supported value.display_nameonly accepts theHAS(:) operator. The text to match is first tokenized into tokens and each token is prefix-matched case-insensitively and independently as a substring anywhere in the space'sdisplay_name. For example,Fun EvematchesFun eventorThe evening was fun, but notnotFun eventoreven. WhenuseAdminAccessis set tofalse,display_nameis required to retrieve meaningful results. Otherwise, the default behavior is to return an empty response.external_user_allowedaccepts eithertrueorfalse.space_history_stateonly accepts values from thehistoryStatefield of aspaceresource.space_typeis required and the only valid value isSPACE. Across different fields, onlyANDoperators are supported. A valid example isspace_type = "SPACE" AND display_name:"Hello"and an invalid example isspace_type = "SPACE" OR display_name:"Hello". Among the same field,space_typedoesn't supportANDorORoperators.display_name, 'space_history_state', and 'external_user_allowed' only supportORoperators.last_active_timeandcreate_timesupport bothANDandORoperators.ANDcan only be used to represent an interval, such aslast_active_time < "2022-01-01T00:00:00+00:00" AND last_active_time > "2023-01-01T00:00:00+00:00". The following example queries are valid whenuseAdminAccessis set totrue:php customer = "customers/my_customer" AND space_type = "SPACE" customer = "customers/my_customer" AND space_type = "SPACE" AND display_name:"Hello World" customer = "customers/my_customer" AND space_type = "SPACE" AND (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > "2022-01-01T00:00:00+00:00") customer = "customers/my_customer" AND space_type = "SPACE" AND (display_name:"Hello World" OR display_name:"Fun event") AND (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < "2022-01-01T00:00:00+00:00") customer = "customers/my_customer" AND space_type = "SPACE" AND (create_time > "2019-01-01T00:00:00+00:00" AND create_time < "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF")The following example queries are valid whenuseAdminAccessis set tofalse:php display_name:"Hello World" AND space_type = "SPACE" (display_name:"Hello" OR display_name:"Fun") AND space_type = "SPACE" (external_user_allowed = "true" AND space_type = "SPACE") // Returns an empty response. (external_user_allowed = "true" AND display_name:"Hello" AND space_type = "SPACE")The maximum query length is 1,000 characters. Invalid queries are rejected by the server with anINVALID_ARGUMENTerror.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getOrderBy
Optional. How the list of spaces is ordered.
Supported attributes to order by are:
membership_count.joined_direct_human_user_count— Denotes the count of human users that have directly joined a space.last_active_time— Denotes the time when last eligible item is added to any topic of this space.create_time— Denotes the time of the space creation. WhenuseAdminAccessisfalse, onlycreate_timeandrelevanceare supported for ordering. OnlyDESCis supported for these fields in non-admin searches. Valid ordering operation values are:ASCfor ascending. Default value.DESCfor descending. The supported syntax are whenuseAdminAccessis set totrue:membership_count.joined_direct_human_user_count DESCmembership_count.joined_direct_human_user_count ASClast_active_time DESClast_active_time ASCcreate_time DESCcreate_time ASCWhenuseAdminAccessis set tofalse:create_time DESCrelevance DESCDeveloper Preview.
| Returns | |
|---|---|
| Type | Description |
string |
|
setOrderBy
Optional. How the list of spaces is ordered.
Supported attributes to order by are:
membership_count.joined_direct_human_user_count— Denotes the count of human users that have directly joined a space.last_active_time— Denotes the time when last eligible item is added to any topic of this space.create_time— Denotes the time of the space creation. WhenuseAdminAccessisfalse, onlycreate_timeandrelevanceare supported for ordering. OnlyDESCis supported for these fields in non-admin searches. Valid ordering operation values are:ASCfor ascending. Default value.DESCfor descending. The supported syntax are whenuseAdminAccessis set totrue:membership_count.joined_direct_human_user_count DESCmembership_count.joined_direct_human_user_count ASClast_active_time DESClast_active_time ASCcreate_time DESCcreate_time ASCWhenuseAdminAccessis set tofalse:create_time DESCrelevance DESCDeveloper Preview.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|