Class SpacesResource.SearchRequest
Returns a list of spaces in a Google Workspace organization. For an example, see Search for and manage
spaces. When use_admin_access is set to
false, the results are limited to spaces where the calling user is a joined member. To search with
administrator privileges, set use_admin_access to true. Setting use_admin_access to false is
available under Developer Preview. Supports the following types of
authentication: - User
authentication with one of
the following authorization scopes: - https://www.googleapis.com/auth/chat.spaces.readonly -
https://www.googleapis.com/auth/chat.spaces - User authentication with administrator
privileges
and one of the following authorization
scopes: -
https://www.googleapis.com/auth/chat.admin.spaces.readonly -
https://www.googleapis.com/auth/chat.admin.spaces
Inheritance
Inherited Members
Namespace: Google.Apis.HangoutsChat.v1
Assembly: Google.Apis.HangoutsChat.v1.dll
Syntax
public class SpacesResource.SearchRequest : HangoutsChatBaseServiceRequest<SearchSpacesResponse>, IClientServiceRequest<SearchSpacesResponse>, IClientServiceRequest
Constructors
SearchRequest(IClientService)
Constructs a new Search request.
Declaration
public SearchRequest(IClientService service)
Parameters
| Type | Name | Description |
|---|---|---|
| IClientService | service |
Properties
HttpMethod
Gets the HTTP method.
Declaration
public override string HttpMethod { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
MethodName
Gets the method name.
Declaration
public override string MethodName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
OrderBy
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. When useAdminAccess is false,
only create_time and relevance are supported for ordering. Only DESC is supported for these fields
in non-admin searches. Valid ordering operation values are: - ASC for ascending. Default value. -
DESC for descending. The supported syntax are when useAdminAccess is set to true: -
membership_count.joined_direct_human_user_count DESC -
membership_count.joined_direct_human_user_count ASC - last_active_time DESC - last_active_time ASC
create_time DESC-create_time ASCWhenuseAdminAccessis set tofalse: -create_time DESC-relevance DESC
Declaration
[RequestParameter("orderBy", RequestParameterType.Query)]
public virtual string OrderBy { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
PageSize
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. If you use a value more than 1000, it's automatically changed to 1000.
Declaration
[RequestParameter("pageSize", RequestParameterType.Query)]
public virtual int? PageSize { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
PageToken
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.
Declaration
[RequestParameter("pageToken", RequestParameterType.Query)]
public virtual string PageToken { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Query
Required. A search query. You can search by using the following parameters when useAdminAccess is set
to true: - create_time - customer - display_name - external_user_allowed - last_active_time
space_history_state-space_typeWhenuseAdminAccessis set tofalse: -display_name-external_user_allowedcreate_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 the [historyState] (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) field of aspaceresource.space_typeis required whenuseAdminAccessis set totrue, 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:
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 when useAdminAccess is set to false:
display_name:"Hello World" (display_name:"Hello" OR display_name:"Fun") (external_user_allowed = "true")
// Returns an empty response. (external_user_allowed = "true" AND display_name:"Hello")
Declaration
[RequestParameter("query", RequestParameterType.Query)]
public virtual string Query { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
RestPath
Gets the REST path.
Declaration
public override string RestPath { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
UseAdminAccess
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. Setting
use_admin_access to false is available under Developer Preview. Developer
Preview.
Declaration
[RequestParameter("useAdminAccess", RequestParameterType.Query)]
public virtual bool? UseAdminAccess { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Methods
InitParameters()
Initializes Search parameter list.
Declaration
protected override void InitParameters()