@google-apps/chat 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/protos/google/chat/v1/chat_service.proto +56 -7
- package/build/protos/google/chat/v1/markup_syntax.proto +47 -0
- package/build/protos/google/chat/v1/message.proto +271 -11
- package/build/protos/google/chat/v1/space.proto +65 -16
- package/build/protos/protos.d.ts +2687 -1693
- package/build/protos/protos.js +1 -1
- package/build/protos/protos.json +423 -98
- package/build/src/v1/chat_service_client.d.ts +745 -34
- package/build/src/v1/chat_service_client.js +532 -18
- package/build/src/v1/chat_service_client.js.map +1 -1
- package/build/src/v1/chat_service_client_config.json +5 -0
- package/build/src/v1/chat_service_proto_list.json +1 -0
- package/build/src/v1/gapic_metadata.json +14 -0
- package/package.json +1 -1
|
@@ -51,6 +51,9 @@ service ChatService {
|
|
|
51
51
|
"https://www.googleapis.com/auth/chat.admin.memberships.readonly,"
|
|
52
52
|
"https://www.googleapis.com/auth/chat.admin.spaces,"
|
|
53
53
|
"https://www.googleapis.com/auth/chat.admin.spaces.readonly,"
|
|
54
|
+
"https://www.googleapis.com/auth/chat.app.all.memberships.readonly,"
|
|
55
|
+
"https://www.googleapis.com/auth/chat.app.all.messages.readonly,"
|
|
56
|
+
"https://www.googleapis.com/auth/chat.app.all.spaces.readonly,"
|
|
54
57
|
"https://www.googleapis.com/auth/chat.app.delete,"
|
|
55
58
|
"https://www.googleapis.com/auth/chat.app.memberships,"
|
|
56
59
|
"https://www.googleapis.com/auth/chat.app.memberships.readonly,"
|
|
@@ -342,6 +345,41 @@ service ChatService {
|
|
|
342
345
|
option (google.api.method_signature) = "name";
|
|
343
346
|
}
|
|
344
347
|
|
|
348
|
+
// Searches for messages in Google Chat that the calling user has access to.
|
|
349
|
+
// Returns a list of messages matching the search criteria.
|
|
350
|
+
//
|
|
351
|
+
// To search across all spaces the user has access to, set `parent` to
|
|
352
|
+
// `spaces/-`. Using any other value for `parent` results in an
|
|
353
|
+
// `INVALID_ARGUMENT` error. The returned messages have their `name` field
|
|
354
|
+
// populated with the full resource name, which includes the specific `space`
|
|
355
|
+
// in which the message resides.
|
|
356
|
+
//
|
|
357
|
+
// This API doesn't return all message types. The types of messages listed
|
|
358
|
+
// below aren't included in the response. Use
|
|
359
|
+
// [ListMessages][google.chat.v1.ChatService.ListMessages] to list all
|
|
360
|
+
// messages.
|
|
361
|
+
//
|
|
362
|
+
// - Private Messages that are visible to the authenticated user.
|
|
363
|
+
// - Messages posted by Chat apps in spaces or group chats.
|
|
364
|
+
// - Messages in a Chat app DM.
|
|
365
|
+
// - Messages from blocked users.
|
|
366
|
+
// - Messages in spaces that the caller has muted.
|
|
367
|
+
//
|
|
368
|
+
// Requires [user
|
|
369
|
+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
370
|
+
// with one of the following [authorization
|
|
371
|
+
// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
372
|
+
//
|
|
373
|
+
// - `https://www.googleapis.com/auth/chat.messages.readonly`
|
|
374
|
+
// - `https://www.googleapis.com/auth/chat.messages`
|
|
375
|
+
rpc SearchMessages(SearchMessagesRequest) returns (SearchMessagesResponse) {
|
|
376
|
+
option (google.api.http) = {
|
|
377
|
+
post: "/v1/{parent=spaces/*}/messages:search"
|
|
378
|
+
body: "*"
|
|
379
|
+
};
|
|
380
|
+
option (google.api.method_signature) = "parent,filter";
|
|
381
|
+
}
|
|
382
|
+
|
|
345
383
|
// Gets the metadata of a message attachment. The attachment data is fetched
|
|
346
384
|
// using the [media
|
|
347
385
|
// API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download).
|
|
@@ -415,19 +453,30 @@ service ChatService {
|
|
|
415
453
|
option (google.api.method_signature) = "";
|
|
416
454
|
}
|
|
417
455
|
|
|
418
|
-
// Returns a list of spaces in a Google Workspace organization
|
|
419
|
-
//
|
|
420
|
-
// For an example, see [Search for and manage
|
|
456
|
+
// Returns a list of spaces in a Google Workspace organization. For an
|
|
457
|
+
// example, see [Search for and manage
|
|
421
458
|
// spaces](https://developers.google.com/workspace/chat/search-manage-admin).
|
|
422
459
|
//
|
|
423
|
-
//
|
|
460
|
+
// When `use_admin_access` is set to `false`, the results are limited to
|
|
461
|
+
// spaces where the calling user is a joined member. To search with
|
|
462
|
+
// administrator privileges, set `use_admin_access` to `true`.
|
|
463
|
+
//
|
|
464
|
+
// Supports the following types of
|
|
465
|
+
// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
|
|
466
|
+
//
|
|
467
|
+
// - [User
|
|
468
|
+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
469
|
+
// with one of the following authorization scopes:
|
|
470
|
+
// - `https://www.googleapis.com/auth/chat.spaces.readonly`
|
|
471
|
+
// - `https://www.googleapis.com/auth/chat.spaces`
|
|
472
|
+
//
|
|
473
|
+
// - [User
|
|
424
474
|
// authentication with administrator
|
|
425
475
|
// privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges)
|
|
426
476
|
// and one of the following [authorization
|
|
427
477
|
// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
428
|
-
//
|
|
429
|
-
//
|
|
430
|
-
// - `https://www.googleapis.com/auth/chat.admin.spaces`
|
|
478
|
+
// - `https://www.googleapis.com/auth/chat.admin.spaces.readonly`
|
|
479
|
+
// - `https://www.googleapis.com/auth/chat.admin.spaces`
|
|
431
480
|
rpc SearchSpaces(SearchSpacesRequest) returns (SearchSpacesResponse) {
|
|
432
481
|
option (google.api.http) = {
|
|
433
482
|
get: "/v1/spaces:search"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.chat.v1;
|
|
18
|
+
|
|
19
|
+
option csharp_namespace = "Google.Apps.Chat.V1";
|
|
20
|
+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
|
|
21
|
+
option java_multiple_files = true;
|
|
22
|
+
option java_outer_classname = "MarkupSyntaxProto";
|
|
23
|
+
option java_package = "com.google.chat.v1";
|
|
24
|
+
option objc_class_prefix = "DYNAPIProto";
|
|
25
|
+
option php_namespace = "Google\\Apps\\Chat\\V1";
|
|
26
|
+
option ruby_package = "Google::Apps::Chat::V1";
|
|
27
|
+
|
|
28
|
+
// Specifies the markup syntax used to format the Chat message text.
|
|
29
|
+
// Applies to the `text` field of the `Message` resource.
|
|
30
|
+
enum MarkupSyntax {
|
|
31
|
+
// Represents the unspecified value.
|
|
32
|
+
MARKUP_SYNTAX_UNSPECIFIED = 0;
|
|
33
|
+
|
|
34
|
+
// Uses Google Chat's markup syntax.
|
|
35
|
+
// See
|
|
36
|
+
// https://developers.google.com/workspace/chat/format-messages#format-texts
|
|
37
|
+
// for more information.
|
|
38
|
+
MARKUP_SYNTAX_CHAT = 1;
|
|
39
|
+
|
|
40
|
+
// Uses Markdown syntax. This syntax is based on the
|
|
41
|
+
// [CommonMark](https://commonmark.org/help/) specification, with additional
|
|
42
|
+
// extensions.
|
|
43
|
+
// See
|
|
44
|
+
// https://developers.google.com/workspace/chat/format-messages#format-texts
|
|
45
|
+
// for more information.
|
|
46
|
+
MARKUP_SYNTAX_MARKDOWN = 2;
|
|
47
|
+
}
|
|
@@ -24,10 +24,12 @@ import "google/chat/v1/annotation.proto";
|
|
|
24
24
|
import "google/chat/v1/attachment.proto";
|
|
25
25
|
import "google/chat/v1/contextual_addon.proto";
|
|
26
26
|
import "google/chat/v1/deletion_metadata.proto";
|
|
27
|
+
import "google/chat/v1/markup_syntax.proto";
|
|
27
28
|
import "google/chat/v1/matched_url.proto";
|
|
28
29
|
import "google/chat/v1/reaction.proto";
|
|
29
30
|
import "google/chat/v1/slash_command.proto";
|
|
30
31
|
import "google/chat/v1/space.proto";
|
|
32
|
+
import "google/chat/v1/space_notification_setting.proto";
|
|
31
33
|
import "google/chat/v1/user.proto";
|
|
32
34
|
import "google/protobuf/field_mask.proto";
|
|
33
35
|
import "google/protobuf/timestamp.proto";
|
|
@@ -112,8 +114,8 @@ message Message {
|
|
|
112
114
|
//
|
|
113
115
|
// * [Markup
|
|
114
116
|
// syntax](https://developers.google.com/workspace/chat/format-messages)
|
|
115
|
-
// for bold, italic, strikethrough, monospace, monospace block,
|
|
116
|
-
// list.
|
|
117
|
+
// for bold, italic, strikethrough, monospace, monospace block, bulleted
|
|
118
|
+
// list, and block quote.
|
|
117
119
|
//
|
|
118
120
|
// * [User
|
|
119
121
|
// mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention)
|
|
@@ -144,9 +146,14 @@ message Message {
|
|
|
144
146
|
// Optional. An array of
|
|
145
147
|
// [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards).
|
|
146
148
|
//
|
|
147
|
-
//
|
|
149
|
+
// Chat apps can create cards with [app
|
|
150
|
+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
|
|
151
|
+
// As part of the [Developer Preview
|
|
152
|
+
// Program](https://developers.google.com/workspace/preview), if your Chat app
|
|
153
|
+
// [authenticates as a
|
|
148
154
|
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
|
|
149
|
-
//
|
|
155
|
+
// it can create card messages. If your Chat app is not part of Developer
|
|
156
|
+
// Preview Program, it can't create cards with user authentication.
|
|
150
157
|
//
|
|
151
158
|
// To learn how to create a message that contains cards, see [Send a
|
|
152
159
|
// message](https://developers.google.com/workspace/chat/create-messages).
|
|
@@ -191,8 +198,8 @@ message Message {
|
|
|
191
198
|
// Optional. User-uploaded attachment.
|
|
192
199
|
repeated Attachment attachment = 18 [(google.api.field_behavior) = OPTIONAL];
|
|
193
200
|
|
|
194
|
-
// Output only. A URL in `
|
|
195
|
-
// pattern. For more information, see [Preview
|
|
201
|
+
// Output only. A URL in the Chat message `text` field that matches a link
|
|
202
|
+
// preview pattern. For more information, see [Preview
|
|
196
203
|
// links](https://developers.google.com/workspace/chat/preview-links).
|
|
197
204
|
MatchedUrl matched_url = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
198
205
|
|
|
@@ -271,6 +278,10 @@ message Message {
|
|
|
271
278
|
// (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
|
|
272
279
|
repeated AccessoryWidget accessory_widgets = 44
|
|
273
280
|
[(google.api.field_behavior) = OPTIONAL];
|
|
281
|
+
|
|
282
|
+
// Optional. Specifies how the server interprets the message `text` field
|
|
283
|
+
// content.
|
|
284
|
+
MarkupSyntax markup_syntax = 47 [(google.api.field_behavior) = OPTIONAL];
|
|
274
285
|
}
|
|
275
286
|
|
|
276
287
|
// A GIF image that's specified by a URL.
|
|
@@ -511,6 +522,10 @@ message GetMessageRequest {
|
|
|
511
522
|
(google.api.field_behavior) = REQUIRED,
|
|
512
523
|
(google.api.resource_reference) = { type: "chat.googleapis.com/Message" }
|
|
513
524
|
];
|
|
525
|
+
|
|
526
|
+
// Optional. Specifies the desired output syntax for the Chat message
|
|
527
|
+
// `formatted_text` field.
|
|
528
|
+
MarkupSyntax markup_syntax = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
514
529
|
}
|
|
515
530
|
|
|
516
531
|
// Request to delete a message.
|
|
@@ -677,9 +692,9 @@ message CreateMessageNotificationOptions {
|
|
|
677
692
|
// (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
|
|
678
693
|
NOTIFICATION_TYPE_FORCE_NOTIFY = 2;
|
|
679
694
|
|
|
680
|
-
//
|
|
681
|
-
//
|
|
682
|
-
//
|
|
695
|
+
// Do not notify recipients, and do not mark the message as unread.
|
|
696
|
+
// This behaves similarly to the user muting the conversation or enabling
|
|
697
|
+
// [Chat Do Not Disturb](https://support.google.com/chat/answer/9093489).
|
|
683
698
|
//
|
|
684
699
|
// Requires [app authentication]
|
|
685
700
|
// (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
|
|
@@ -774,6 +789,10 @@ message ListMessagesRequest {
|
|
|
774
789
|
// deleted time and metadata about their deletion, but message content is
|
|
775
790
|
// unavailable.
|
|
776
791
|
bool show_deleted = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
792
|
+
|
|
793
|
+
// Optional. Specifies the desired output syntax for the Chat message
|
|
794
|
+
// `formatted_text` field.
|
|
795
|
+
MarkupSyntax markup_syntax = 9 [(google.api.field_behavior) = OPTIONAL];
|
|
777
796
|
}
|
|
778
797
|
|
|
779
798
|
// Response message for listing messages.
|
|
@@ -817,9 +836,17 @@ message Dialog {
|
|
|
817
836
|
// [card](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards)
|
|
818
837
|
// in a Google Chat message.
|
|
819
838
|
//
|
|
820
|
-
//
|
|
839
|
+
// Chat apps can create cards with [app
|
|
840
|
+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
|
|
841
|
+
// As part of the [Developer Preview
|
|
842
|
+
// Program](https://developers.google.com/workspace/preview), if your Chat app
|
|
843
|
+
// [authenticates as a
|
|
821
844
|
// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
|
|
822
|
-
//
|
|
845
|
+
// it can create card messages. If your Chat app is not part of Developer
|
|
846
|
+
// Preview Program, it can't create cards with user authentication.
|
|
847
|
+
//
|
|
848
|
+
// To learn how to create a message that contains cards, see [Send a
|
|
849
|
+
// message](https://developers.google.com/workspace/chat/create-messages).
|
|
823
850
|
//
|
|
824
851
|
// [Card builder](https://addons.gsuite.google.com/uikit/builder)
|
|
825
852
|
message CardWithId {
|
|
@@ -830,3 +857,236 @@ message CardWithId {
|
|
|
830
857
|
// A card. Maximum size is 32 KB.
|
|
831
858
|
google.apps.card.v1.Card card = 2;
|
|
832
859
|
}
|
|
860
|
+
|
|
861
|
+
// Request message for searching messages.
|
|
862
|
+
message SearchMessagesRequest {
|
|
863
|
+
// The kinds of view that are supported for partial search results.
|
|
864
|
+
enum SearchMessagesView {
|
|
865
|
+
// The default / unset value.
|
|
866
|
+
// The API will default to the BASIC view.
|
|
867
|
+
SEARCH_MESSAGES_VIEW_UNSPECIFIED = 0;
|
|
868
|
+
|
|
869
|
+
// Includes only the matched messages in the results, but no additional
|
|
870
|
+
// metadata. This is the default value.
|
|
871
|
+
SEARCH_MESSAGES_VIEW_BASIC = 1;
|
|
872
|
+
|
|
873
|
+
// Includes everything in the results: the matched messages and additional
|
|
874
|
+
// metadata.
|
|
875
|
+
SEARCH_MESSAGES_VIEW_FULL = 2;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
// Required. The resource name of the space to search within.
|
|
879
|
+
//
|
|
880
|
+
// To search across all spaces the user has access to, set this field to
|
|
881
|
+
// `spaces/-`. Using any other value for `parent` results in an
|
|
882
|
+
// `INVALID_ARGUMENT` error.
|
|
883
|
+
//
|
|
884
|
+
// To limit the search to one or more spaces, use `space.name` or
|
|
885
|
+
// `space.display_name` in the `filter`.
|
|
886
|
+
string parent = 1 [
|
|
887
|
+
(google.api.field_behavior) = REQUIRED,
|
|
888
|
+
(google.api.resource_reference) = { type: "chat.googleapis.com/Space" }
|
|
889
|
+
];
|
|
890
|
+
|
|
891
|
+
// Required. A search query.
|
|
892
|
+
//
|
|
893
|
+
// The query can specify one or more search keywords, which are used to filter
|
|
894
|
+
// the results,
|
|
895
|
+
//
|
|
896
|
+
// You can also filter the results using the following message fields:
|
|
897
|
+
//
|
|
898
|
+
// - `create_time`: Accepts a timestamp in
|
|
899
|
+
// [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the
|
|
900
|
+
// supported comparison operators are: `<` and `>=`.
|
|
901
|
+
// - `sender.name`: The resource name of the sender (`users/{user}`). Only
|
|
902
|
+
// supports `=`. You can use the e-mail as an alias for `{user}`. For
|
|
903
|
+
// example, `users/example@gmail.com`, where `example@gmail.com` is the
|
|
904
|
+
// e-mail of the Google Chat user.
|
|
905
|
+
// - `space.name`: The resource name of the space where the message is posted.
|
|
906
|
+
// (`spaces/{space}`). Only supports `=`. If this filter is not set, the
|
|
907
|
+
// search is performed across all direct messages and spaces the user has
|
|
908
|
+
// access to as a space member.
|
|
909
|
+
// - `space.display_name`: Supports the operator `:` (has) and filters spaces
|
|
910
|
+
// based on a partial match of their display name. Results are limited to
|
|
911
|
+
// the top five space matches. For example, `space.display_name:Project`
|
|
912
|
+
// searches for messages in the top five spaces that contain the word
|
|
913
|
+
// "Project" in their display names.
|
|
914
|
+
// - `attachment`: Supports the operator `:*` (has any) to check for the
|
|
915
|
+
// presence of attachments. If `attachment:*` is specified, only messages
|
|
916
|
+
// that have at least one attachment are returned.
|
|
917
|
+
// - `annotations.user_mentions.user.name`: The resource name of the mentioned
|
|
918
|
+
// user (`users/{user}`). Only supports `:` (has). For example:
|
|
919
|
+
// `annotations.user_mentions.user.name:"users/1234567890"` returns only
|
|
920
|
+
// messages that contain a mention to the specified user. Alternatively, the
|
|
921
|
+
// alias `me` can be used to filter for messages that mention the caller
|
|
922
|
+
// user, for example: `annotations.user_mentions.user.name:users/me`. You
|
|
923
|
+
// can also use the e-mail as an alias for `{user}`, for example,
|
|
924
|
+
// `users/example@gmail.com`.
|
|
925
|
+
//
|
|
926
|
+
// For advanced filtering, the following functions are also available:
|
|
927
|
+
//
|
|
928
|
+
// - `has_link()`: Returns only messages that have at least one hyperlink in
|
|
929
|
+
// the message text.
|
|
930
|
+
// - `is_unread()`: Filters out messages that have been read by the calling
|
|
931
|
+
// user.
|
|
932
|
+
//
|
|
933
|
+
// Using the `space.display_name` filter requires that the calling credentials
|
|
934
|
+
// include one of the following [authorization
|
|
935
|
+
// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
936
|
+
//
|
|
937
|
+
// - `https://www.googleapis.com/auth/chat.spaces.readonly`
|
|
938
|
+
// - `https://www.googleapis.com/auth/chat.spaces`
|
|
939
|
+
//
|
|
940
|
+
// Using the `is_unread()` filter requires that the calling credentials
|
|
941
|
+
// include one of the following [authorization
|
|
942
|
+
// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
943
|
+
//
|
|
944
|
+
// - `https://www.googleapis.com/auth/chat.users.readstate.readonly`
|
|
945
|
+
// - `https://www.googleapis.com/auth/chat.users.readstate`
|
|
946
|
+
//
|
|
947
|
+
//
|
|
948
|
+
// Across different fields, only `AND` operators are supported. A valid
|
|
949
|
+
// example is `sender.name = "users/1234567890" AND is_unread()`. The word
|
|
950
|
+
// `AND` is optional and is implied if omitted. For example, `sender.name =
|
|
951
|
+
// "users/1234567890" is_unread()` is valid and is equivalent to the previous
|
|
952
|
+
// example. An invalid example is `sender.name = "users/1234567890" OR
|
|
953
|
+
// is_unread()` because `OR` is not supported between different fields.
|
|
954
|
+
//
|
|
955
|
+
// Among the same field:
|
|
956
|
+
//
|
|
957
|
+
// - `create_time` supports only `AND`, and can only be used to represent
|
|
958
|
+
// an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND
|
|
959
|
+
// create_time < "2023-01-01T00:00:00+00:00"`.
|
|
960
|
+
// - `sender.name` supports only the `OR` operator, for example:
|
|
961
|
+
// `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`.
|
|
962
|
+
// - `space.name` supports only the `OR` operator, for example:
|
|
963
|
+
// `space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI"`.
|
|
964
|
+
// - `space.display_name` supports the operators `AND` and `OR`, but not a
|
|
965
|
+
// mix of both. For example:
|
|
966
|
+
// `space.display_name:Project AND space.display_name:Tasks` returns
|
|
967
|
+
// messages that are in spaces with display names containing both `Project`
|
|
968
|
+
// and `Tasks`, whereas
|
|
969
|
+
// `space.display_name:Project OR space.display_name:Tasks` returns messages
|
|
970
|
+
// that are in spaces with display names containing either `Project` or
|
|
971
|
+
// `Tasks` or both.
|
|
972
|
+
// - `annotations.user_mentions.user.name` supports the operators `AND` and
|
|
973
|
+
// `OR`, but not a mix of both. For example:
|
|
974
|
+
// `annotations.user_mentions.user.name:"users/1234567890" AND
|
|
975
|
+
// annotations.user_mentions.user.name:"users/0987654321"` returns only
|
|
976
|
+
// messages that mentions both users, whereas
|
|
977
|
+
// `annotations.user_mentions.user.name:"users/1234567890" OR
|
|
978
|
+
// annotations.user_mentions.user.name:"users/0987654321"` returns messages
|
|
979
|
+
// that mention either user or both.
|
|
980
|
+
//
|
|
981
|
+
// Parentheses are required to disambiguate operator precedence when combining
|
|
982
|
+
// `AND` and `OR` operators in the same query. For example:
|
|
983
|
+
// `(sender.name="users/me" OR sender.name="users/123456") AND is_unread()`.
|
|
984
|
+
// Otherwise, parentheses are optional.
|
|
985
|
+
//
|
|
986
|
+
// The following example queries are valid:
|
|
987
|
+
//
|
|
988
|
+
// ```
|
|
989
|
+
// "Pending reports" AND create_time >= "2023-01-01T00:00:00Z"
|
|
990
|
+
//
|
|
991
|
+
// sender.name = "users/example@gmail.com"
|
|
992
|
+
//
|
|
993
|
+
// annotations.user_mentions.user.name:"users/0987654321"
|
|
994
|
+
//
|
|
995
|
+
// attachment:* AND space.name = "spaces/ABCDEFGH"
|
|
996
|
+
//
|
|
997
|
+
// tasks AND is_unread() AND sender.name = "users/1234567890"
|
|
998
|
+
//
|
|
999
|
+
// "things to do" "urgent"
|
|
1000
|
+
//
|
|
1001
|
+
// (sender.name = "users/1234567890")
|
|
1002
|
+
// AND (create_time < "2023-05-01T00:00:00Z")
|
|
1003
|
+
//
|
|
1004
|
+
// tasks AND space.name = "spaces/ABCDEFGH" AND has_link()
|
|
1005
|
+
//
|
|
1006
|
+
// "project one" is_unread()
|
|
1007
|
+
//
|
|
1008
|
+
// space.display_name:Project tasks
|
|
1009
|
+
// ```
|
|
1010
|
+
//
|
|
1011
|
+
// The maximum query length is 1,000 characters.
|
|
1012
|
+
//
|
|
1013
|
+
// Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
|
|
1014
|
+
// error.
|
|
1015
|
+
string filter = 2 [(google.api.field_behavior) = REQUIRED];
|
|
1016
|
+
|
|
1017
|
+
// Optional. The maximum number of results to return. The service may return
|
|
1018
|
+
// fewer than this value.
|
|
1019
|
+
//
|
|
1020
|
+
// If unspecified, at most 25 are returned.
|
|
1021
|
+
//
|
|
1022
|
+
// The maximum value is 100. If you use a value more than 100, it's
|
|
1023
|
+
// automatically changed to 100.
|
|
1024
|
+
int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
1025
|
+
|
|
1026
|
+
// Optional. A token, received from the previous search messages call. Provide
|
|
1027
|
+
// this parameter to retrieve the subsequent page.
|
|
1028
|
+
//
|
|
1029
|
+
// When paginating, all other parameters provided should match the call that
|
|
1030
|
+
// provided the page token. Passing different values to the other parameters
|
|
1031
|
+
// might lead to unexpected results.
|
|
1032
|
+
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
1033
|
+
|
|
1034
|
+
// Optional. How the results list is ordered.
|
|
1035
|
+
//
|
|
1036
|
+
// Supported attributes to order by are:
|
|
1037
|
+
//
|
|
1038
|
+
// - `create_time`: Sorts the results by the time of the message creation.
|
|
1039
|
+
// Default value.
|
|
1040
|
+
// - `relevance`: Sorts the results by relevance.
|
|
1041
|
+
// [Developer Preview](https://developers.google.com/workspace/preview).
|
|
1042
|
+
//
|
|
1043
|
+
// The default ordering is `create_time desc`. Only a single order per query
|
|
1044
|
+
// (`create_time` or `relevance`) is supported. Only descending order (`desc`)
|
|
1045
|
+
// is supported, and it must be specified after the order attribute.
|
|
1046
|
+
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
|
|
1047
|
+
|
|
1048
|
+
// Optional. Specifies the desired output syntax for the Chat message
|
|
1049
|
+
// `formatted_text` field.
|
|
1050
|
+
MarkupSyntax markup_syntax = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
1051
|
+
|
|
1052
|
+
// Optional. Specifies what kind of search results view to return. The default
|
|
1053
|
+
// is `SEARCH_MESSAGES_VIEW_BASIC`.
|
|
1054
|
+
SearchMessagesView view = 7 [(google.api.field_behavior) = OPTIONAL];
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
// Response message for searching messages.
|
|
1058
|
+
message SearchMessagesResponse {
|
|
1059
|
+
// The list of search results that matched the query.
|
|
1060
|
+
repeated SearchMessageResult results = 1;
|
|
1061
|
+
|
|
1062
|
+
// A token that can be used to retrieve the next page. If this field is empty,
|
|
1063
|
+
// there are no subsequent pages.
|
|
1064
|
+
string next_page_token = 2;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
// A single result item from a message search.
|
|
1068
|
+
message SearchMessageResult {
|
|
1069
|
+
// The matched message.
|
|
1070
|
+
Message message = 1;
|
|
1071
|
+
|
|
1072
|
+
// Indicates if the matched message is read by the calling user.
|
|
1073
|
+
//
|
|
1074
|
+
// Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the
|
|
1075
|
+
// calling credentials include one of the following [authorization
|
|
1076
|
+
// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
1077
|
+
//
|
|
1078
|
+
// - `https://www.googleapis.com/auth/chat.users.readstate.readonly`
|
|
1079
|
+
// - `https://www.googleapis.com/auth/chat.users.readstate`
|
|
1080
|
+
optional bool read = 3;
|
|
1081
|
+
|
|
1082
|
+
// The mute setting of the calling user for the space where the message is
|
|
1083
|
+
// posted. The caller app can use this information to decide how to process
|
|
1084
|
+
// the message depending on whether the space is muted for the user or not.
|
|
1085
|
+
//
|
|
1086
|
+
// Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the
|
|
1087
|
+
// calling credentials include the following [authorization
|
|
1088
|
+
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
1089
|
+
//
|
|
1090
|
+
// - `https://www.googleapis.com/auth/chat.users.spacesettings`
|
|
1091
|
+
SpaceNotificationSetting.MuteSetting space_mute_setting = 4;
|
|
1092
|
+
}
|
|
@@ -76,17 +76,20 @@ message Space {
|
|
|
76
76
|
// Reserved.
|
|
77
77
|
SPACE_THREADING_STATE_UNSPECIFIED = 0;
|
|
78
78
|
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
79
|
+
// Spaces that support message threads. When users respond to a message,
|
|
80
|
+
// they can reply in-thread, which keeps their response in the context of
|
|
81
|
+
// the original message.
|
|
82
82
|
THREADED_MESSAGES = 2;
|
|
83
83
|
|
|
84
84
|
// Named spaces where the conversation is organized by topic. Topics and
|
|
85
85
|
// their replies are grouped together.
|
|
86
86
|
GROUPED_MESSAGES = 3;
|
|
87
87
|
|
|
88
|
-
//
|
|
89
|
-
//
|
|
88
|
+
// Spaces that don't support message threading. This space threading state
|
|
89
|
+
// is only used for special cases including:
|
|
90
|
+
//
|
|
91
|
+
// * Continuous meeting chat where threading is intentionally turned off.
|
|
92
|
+
// * Legacy group conversations that were created prior to 2022.
|
|
90
93
|
UNTHREADED_MESSAGES = 4;
|
|
91
94
|
}
|
|
92
95
|
|
|
@@ -765,9 +768,6 @@ message SearchSpacesRequest {
|
|
|
765
768
|
// Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces`
|
|
766
769
|
// [OAuth 2.0
|
|
767
770
|
// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).
|
|
768
|
-
//
|
|
769
|
-
// This method currently only supports admin access, thus only `true` is
|
|
770
|
-
// accepted for this field.
|
|
771
771
|
bool use_admin_access = 1;
|
|
772
772
|
|
|
773
773
|
// The maximum number of spaces to return. The service may return fewer than
|
|
@@ -789,7 +789,8 @@ message SearchSpacesRequest {
|
|
|
789
789
|
|
|
790
790
|
// Required. A search query.
|
|
791
791
|
//
|
|
792
|
-
// You can search by using the following parameters
|
|
792
|
+
// You can search by using the following parameters when `useAdminAccess`
|
|
793
|
+
// is set to `true`:
|
|
793
794
|
//
|
|
794
795
|
// - `create_time`
|
|
795
796
|
// - `customer`
|
|
@@ -799,18 +800,27 @@ message SearchSpacesRequest {
|
|
|
799
800
|
// - `space_history_state`
|
|
800
801
|
// - `space_type`
|
|
801
802
|
//
|
|
803
|
+
// When `useAdminAccess` is set to `false`:
|
|
804
|
+
//
|
|
805
|
+
// - `display_name`
|
|
806
|
+
// - `external_user_allowed`
|
|
807
|
+
// - `space_type`
|
|
808
|
+
//
|
|
802
809
|
// `create_time` and `last_active_time` accept a timestamp in
|
|
803
810
|
// [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported
|
|
804
811
|
// comparison operators are: `=`, `<`, `>`, `<=`, `>=`.
|
|
805
812
|
//
|
|
806
|
-
// `customer` is required
|
|
807
|
-
// to
|
|
813
|
+
// `customer` is required when `useAdminAccess` is set to `true`, and is
|
|
814
|
+
// used to indicate which customer to fetch spaces from.
|
|
815
|
+
// `customers/my_customer` is the only supported value.
|
|
808
816
|
//
|
|
809
817
|
// `display_name` only accepts the `HAS` (`:`) operator. The text to
|
|
810
818
|
// match is first tokenized into tokens and each token is prefix-matched
|
|
811
819
|
// case-insensitively and independently as a substring anywhere in the space's
|
|
812
820
|
// `display_name`. For example, `Fun Eve` matches `Fun event` or `The
|
|
813
|
-
// evening was fun`, but not `notFun event` or `even`.
|
|
821
|
+
// evening was fun`, but not `notFun event` or `even`. When `useAdminAccess`
|
|
822
|
+
// is set to `false`, `display_name` is required to retrieve meaningful
|
|
823
|
+
// results. Otherwise, the default behavior is to return an empty response.
|
|
814
824
|
//
|
|
815
825
|
// `external_user_allowed` accepts either `true` or `false`.
|
|
816
826
|
//
|
|
@@ -833,7 +843,8 @@ message SearchSpacesRequest {
|
|
|
833
843
|
// < "2022-01-01T00:00:00+00:00" AND last_active_time >
|
|
834
844
|
// "2023-01-01T00:00:00+00:00"`.
|
|
835
845
|
//
|
|
836
|
-
// The following example queries are valid
|
|
846
|
+
// The following example queries are valid when `useAdminAccess` is set to
|
|
847
|
+
// `true`:
|
|
837
848
|
//
|
|
838
849
|
// ```
|
|
839
850
|
// customer = "customers/my_customer" AND space_type = "SPACE"
|
|
@@ -855,6 +866,21 @@ message SearchSpacesRequest {
|
|
|
855
866
|
// "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND
|
|
856
867
|
// (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF")
|
|
857
868
|
// ```
|
|
869
|
+
//
|
|
870
|
+
// The following example queries are valid when `useAdminAccess` is set to
|
|
871
|
+
// `false`:
|
|
872
|
+
//
|
|
873
|
+
// ```
|
|
874
|
+
// display_name:"Hello World" AND space_type = "SPACE"
|
|
875
|
+
//
|
|
876
|
+
// (display_name:"Hello" OR display_name:"Fun") AND space_type = "SPACE"
|
|
877
|
+
//
|
|
878
|
+
// (external_user_allowed = "true" AND space_type = "SPACE") // Returns an
|
|
879
|
+
// empty response.
|
|
880
|
+
//
|
|
881
|
+
// (external_user_allowed = "true" AND display_name:"Hello" AND space_type =
|
|
882
|
+
// "SPACE")
|
|
883
|
+
// ```
|
|
858
884
|
string query = 4 [(google.api.field_behavior) = REQUIRED];
|
|
859
885
|
|
|
860
886
|
// Optional. How the list of spaces is ordered.
|
|
@@ -867,13 +893,17 @@ message SearchSpacesRequest {
|
|
|
867
893
|
// any topic of this space.
|
|
868
894
|
// - `create_time` — Denotes the time of the space creation.
|
|
869
895
|
//
|
|
896
|
+
// When `useAdminAccess` is `false`, only `create_time` and `relevance` are
|
|
897
|
+
// supported for ordering. Only `DESC` is supported for these fields in
|
|
898
|
+
// non-admin searches.
|
|
899
|
+
//
|
|
870
900
|
// Valid ordering operation values are:
|
|
871
901
|
//
|
|
872
902
|
// - `ASC` for ascending. Default value.
|
|
873
903
|
//
|
|
874
904
|
// - `DESC` for descending.
|
|
875
905
|
//
|
|
876
|
-
// The supported syntax are
|
|
906
|
+
// The supported syntax are when `useAdminAccess` is set to `true`:
|
|
877
907
|
//
|
|
878
908
|
// - `membership_count.joined_direct_human_user_count DESC`
|
|
879
909
|
// - `membership_count.joined_direct_human_user_count ASC`
|
|
@@ -881,13 +911,28 @@ message SearchSpacesRequest {
|
|
|
881
911
|
// - `last_active_time ASC`
|
|
882
912
|
// - `create_time DESC`
|
|
883
913
|
// - `create_time ASC`
|
|
914
|
+
//
|
|
915
|
+
// When `useAdminAccess` is set to `false`:
|
|
916
|
+
//
|
|
917
|
+
// - `create_time DESC`
|
|
918
|
+
// - `relevance DESC`
|
|
919
|
+
// [Developer Preview](https://developers.google.com/workspace/preview).
|
|
884
920
|
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
|
|
885
921
|
}
|
|
886
922
|
|
|
887
923
|
// Response with a list of spaces corresponding to the search spaces request.
|
|
888
924
|
message SearchSpacesResponse {
|
|
889
|
-
// A
|
|
890
|
-
|
|
925
|
+
// A single result item from a space search.
|
|
926
|
+
message SearchSpaceResult {
|
|
927
|
+
// Output only. The matched space.
|
|
928
|
+
Space space = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
// Deprecated: Please use the new `results` field instead.
|
|
932
|
+
// A page of the requested spaces. This field will be populated only when
|
|
933
|
+
// `useAdminAccess` is set to `true` and deprecated in favor of the new
|
|
934
|
+
// `results` field.
|
|
935
|
+
repeated Space spaces = 1 [deprecated = true];
|
|
891
936
|
|
|
892
937
|
// A token that can be used to retrieve the next page. If this field is empty,
|
|
893
938
|
// there are no subsequent pages.
|
|
@@ -896,6 +941,10 @@ message SearchSpacesResponse {
|
|
|
896
941
|
// The total number of spaces that match the query, across all pages. If the
|
|
897
942
|
// result is over 10,000 spaces, this value is an estimate.
|
|
898
943
|
int32 total_size = 3;
|
|
944
|
+
|
|
945
|
+
// Output only. The list of search results that matched the query.
|
|
946
|
+
repeated SearchSpaceResult results = 4
|
|
947
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
|
899
948
|
}
|
|
900
949
|
|
|
901
950
|
// Request for deleting a space.
|