@@ -103,6 +103,16 @@ message Space {
103103 string guidelines = 2 ;
104104 }
105105
106+ // Represents the count of memberships of a space, grouped into categories.
107+ message MembershipCount {
108+ // Count of human users that have directly joined the space, not counting
109+ // users joined by having membership in a joined group.
110+ int32 joined_direct_human_user_count = 4 ;
111+
112+ // Count of all groups that have directly joined the space.
113+ int32 joined_group_count = 5 ;
114+ }
115+
106116 // Represents the [access
107117 // setting](https://support.google.com/chat/answer/11971020) of the space.
108118 message AccessSettings {
@@ -218,6 +228,10 @@ message Space {
218228 (google.api.field_behavior ) = OPTIONAL
219229 ];
220230
231+ // Output only. Timestamp of the last message in the space.
232+ google.protobuf.Timestamp last_active_time = 18
233+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
234+
221235 // Output only. For direct message (DM) spaces with a Chat app, whether the
222236 // space was created by a Google Workspace administrator. Administrators can
223237 // install and set up a direct message with a Chat app on behalf of users in
@@ -226,6 +240,12 @@ message Space {
226240 // To support admin install, your Chat app must feature direct messaging.
227241 bool admin_installed = 19 [(google.api.field_behavior ) = OUTPUT_ONLY ];
228242
243+ // Output only. The count of joined memberships grouped by member type.
244+ // Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or
245+ // `GROUP_CHAT`.
246+ MembershipCount membership_count = 20
247+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
248+
229249 // Optional. Specifies the [access
230250 // setting](https://support.google.com/chat/answer/11971020) of the space.
231251 // Only populated when the `space_type` is `SPACE`.
@@ -318,6 +338,17 @@ message GetSpaceRequest {
318338 (google.api.field_behavior ) = REQUIRED ,
319339 (google.api.resource_reference ) = { type : "chat.googleapis.com/Space" }
320340 ];
341+
342+ // When `true`, the method runs using the user's Google Workspace
343+ // administrator privileges.
344+ //
345+ // The calling user must be a Google Workspace administrator with the
346+ // [manage chat and spaces conversations
347+ // privilege](https://support.google.com/a/answer/13369245).
348+ //
349+ // Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0
350+ // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
351+ bool use_admin_access = 2 ;
321352}
322353
323354// A request to get direct message space based on the user resource.
@@ -397,6 +428,165 @@ message UpdateSpaceRequest {
397428 // (Warning: mutually exclusive with all other non-permission settings field
398429 // paths). `permission_settings` is not supported with admin access.
399430 google.protobuf.FieldMask update_mask = 2 ;
431+
432+ // When `true`, the method runs using the user's Google Workspace
433+ // administrator privileges.
434+ //
435+ // The calling user must be a Google Workspace administrator with the
436+ // [manage chat and spaces conversations
437+ // privilege](https://support.google.com/a/answer/13369245).
438+ //
439+ // Requires the `chat.admin.spaces` [OAuth 2.0
440+ // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
441+ //
442+ // Some `FieldMask` values are not supported using admin access. For details,
443+ // see the description of `update_mask`.
444+ bool use_admin_access = 3 ;
445+ }
446+
447+ // Request to search for a list of spaces based on a query.
448+ message SearchSpacesRequest {
449+ // When `true`, the method runs using the user's Google Workspace
450+ // administrator privileges.
451+ //
452+ // The calling user must be a Google Workspace administrator with the
453+ // [manage chat and spaces conversations
454+ // privilege](https://support.google.com/a/answer/13369245).
455+ //
456+ // Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces`
457+ // [OAuth 2.0
458+ // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
459+ //
460+ // This method currently only supports admin access, thus only `true` is
461+ // accepted for this field.
462+ bool use_admin_access = 1 ;
463+
464+ // The maximum number of spaces to return. The service may return fewer than
465+ // this value.
466+ //
467+ // If unspecified, at most 100 spaces are returned.
468+ //
469+ // The maximum value is 1000. If you use a value more than 1000, it's
470+ // automatically changed to 1000.
471+ int32 page_size = 2 ;
472+
473+ // A token, received from the previous search spaces call. Provide this
474+ // parameter to retrieve the subsequent page.
475+ //
476+ // When paginating, all other parameters provided should match the call that
477+ // provided the page token. Passing different values to the other parameters
478+ // might lead to unexpected results.
479+ string page_token = 3 ;
480+
481+ // Required. A search query.
482+ //
483+ // You can search by using the following parameters:
484+ //
485+ // - `create_time`
486+ // - `customer`
487+ // - `display_name`
488+ // - `external_user_allowed`
489+ // - `last_active_time`
490+ // - `space_history_state`
491+ // - `space_type`
492+ //
493+ // `create_time` and `last_active_time` accept a timestamp in
494+ // [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported
495+ // comparison operators are: `=`, `<`, `>`, `<=`, `>=`.
496+ //
497+ // `customer` is required and is used to indicate which customer
498+ // to fetch spaces from. `customers/my_customer` is the only supported value.
499+ //
500+ // `display_name` only accepts the `HAS` (`:`) operator. The text to
501+ // match is first tokenized into tokens and each token is prefix-matched
502+ // case-insensitively and independently as a substring anywhere in the space's
503+ // `display_name`. For example, `Fun Eve` matches `Fun event` or `The
504+ // evening was fun`, but not `notFun event` or `even`.
505+ //
506+ // `external_user_allowed` accepts either `true` or `false`.
507+ //
508+ // `space_history_state` only accepts values from the [`historyState`]
509+ // (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState)
510+ // field of a `space` resource.
511+ //
512+ // `space_type` is required and the only valid value is `SPACE`.
513+ //
514+ // Across different fields, only `AND` operators are supported. A valid
515+ // example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid
516+ // example is `space_type = "SPACE" OR display_name:"Hello"`.
517+ //
518+ // Among the same field,
519+ // `space_type` doesn't support `AND` or `OR` operators.
520+ // `display_name`, 'space_history_state', and 'external_user_allowed' only
521+ // support `OR` operators.
522+ // `last_active_time` and `create_time` support both `AND` and `OR` operators.
523+ // `AND` can only be used to represent an interval, such as `last_active_time
524+ // < "2022-01-01T00:00:00+00:00" AND last_active_time >
525+ // "2023-01-01T00:00:00+00:00"`.
526+ //
527+ // The following example queries are valid:
528+ //
529+ // ```
530+ // customer = "customers/my_customer" AND space_type = "SPACE"
531+ //
532+ // customer = "customers/my_customer" AND space_type = "SPACE" AND
533+ // display_name:"Hello World"
534+ //
535+ // customer = "customers/my_customer" AND space_type = "SPACE" AND
536+ // (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time >
537+ // "2022-01-01T00:00:00+00:00")
538+ //
539+ // customer = "customers/my_customer" AND space_type = "SPACE" AND
540+ // (display_name:"Hello World" OR display_name:"Fun event") AND
541+ // (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time <
542+ // "2022-01-01T00:00:00+00:00")
543+ //
544+ // customer = "customers/my_customer" AND space_type = "SPACE" AND
545+ // (create_time > "2019-01-01T00:00:00+00:00" AND create_time <
546+ // "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND
547+ // (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF")
548+ // ```
549+ string query = 4 [(google.api.field_behavior ) = REQUIRED ];
550+
551+ // Optional. How the list of spaces is ordered.
552+ //
553+ // Supported attributes to order by are:
554+ //
555+ // - `membership_count.joined_direct_human_user_count` — Denotes the count of
556+ // human users that have directly joined a space.
557+ // - `last_active_time` — Denotes the time when last eligible item is added to
558+ // any topic of this space.
559+ // - `create_time` — Denotes the time of the space creation.
560+ //
561+ // Valid ordering operation values are:
562+ //
563+ // - `ASC` for ascending. Default value.
564+ //
565+ // - `DESC` for descending.
566+ //
567+ // The supported syntax are:
568+ //
569+ // - `membership_count.joined_direct_human_user_count DESC`
570+ // - `membership_count.joined_direct_human_user_count ASC`
571+ // - `last_active_time DESC`
572+ // - `last_active_time ASC`
573+ // - `create_time DESC`
574+ // - `create_time ASC`
575+ string order_by = 5 [(google.api.field_behavior ) = OPTIONAL ];
576+ }
577+
578+ // Response with a list of spaces corresponding to the search spaces request.
579+ message SearchSpacesResponse {
580+ // A page of the requested spaces.
581+ repeated Space spaces = 1 ;
582+
583+ // A token that can be used to retrieve the next page. If this field is empty,
584+ // there are no subsequent pages.
585+ string next_page_token = 2 ;
586+
587+ // The total number of spaces that match the query, across all pages. If the
588+ // result is over 10,000 spaces, this value is an estimate.
589+ int32 total_size = 3 ;
400590}
401591
402592// Request for deleting a space.
@@ -408,6 +598,17 @@ message DeleteSpaceRequest {
408598 (google.api.field_behavior ) = REQUIRED ,
409599 (google.api.resource_reference ) = { type : "chat.googleapis.com/Space" }
410600 ];
601+
602+ // When `true`, the method runs using the user's Google Workspace
603+ // administrator privileges.
604+ //
605+ // The calling user must be a Google Workspace administrator with the
606+ // [manage chat and spaces conversations
607+ // privilege](https://support.google.com/a/answer/13369245).
608+ //
609+ // Requires the `chat.admin.delete` [OAuth 2.0
610+ // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
611+ bool use_admin_access = 2 ;
411612}
412613
413614// Request message for completing the import process for a space.
0 commit comments