Skip to content

Commit 7a77d8e

Browse files
Google APIscopybara-github
authored andcommitted
feat: add GetSpaceEvent and ListSpaceEvents APIs
PiperOrigin-RevId: 651735637
1 parent 47947b2 commit 7a77d8e

6 files changed

Lines changed: 554 additions & 6 deletions

File tree

google/chat/v1/BUILD.bazel

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# buildifier: disable=load-on-top
13+
1214
# This is an API workspace, having public visibility by default makes perfect sense.
1315
package(default_visibility = ["//visibility:public"])
1416

1517
##############################################################################
1618
# Common
1719
##############################################################################
18-
load("@rules_proto//proto:defs.bzl", "proto_library")
20+
# buildifier: disable=same-origin-load
1921
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
2023

2124
proto_library(
2225
name = "chat_proto",
@@ -27,6 +30,7 @@ proto_library(
2730
"chat_service.proto",
2831
"contextual_addon.proto",
2932
"deletion_metadata.proto",
33+
"event_payload.proto",
3034
"group.proto",
3135
"history_state.proto",
3236
"matched_url.proto",
@@ -35,6 +39,7 @@ proto_library(
3539
"reaction.proto",
3640
"slash_command.proto",
3741
"space.proto",
42+
"space_event.proto",
3843
"space_read_state.proto",
3944
"space_setup.proto",
4045
"thread_read_state.proto",
@@ -65,6 +70,7 @@ proto_library_with_info(
6570
##############################################################################
6671
# Java
6772
##############################################################################
73+
# buildifier: disable=same-origin-load
6874
load(
6975
"@com_google_googleapis_imports//:imports.bzl",
7076
"java_gapic_assembly_gradle_pkg",
@@ -128,6 +134,7 @@ java_gapic_assembly_gradle_pkg(
128134
##############################################################################
129135
# Go
130136
##############################################################################
137+
# buildifier: disable=same-origin-load
131138
load(
132139
"@com_google_googleapis_imports//:imports.bzl",
133140
"go_gapic_assembly_pkg",
@@ -177,6 +184,7 @@ go_gapic_assembly_pkg(
177184
##############################################################################
178185
# Python
179186
##############################################################################
187+
# buildifier: disable=same-origin-load
180188
load(
181189
"@com_google_googleapis_imports//:imports.bzl",
182190
"py_gapic_assembly_pkg",
@@ -197,9 +205,9 @@ py_gapic_library(
197205
srcs = [":chat_proto"],
198206
grpc_service_config = "chat_grpc_service_config.json",
199207
opt_args = [
208+
"proto-plus-deps=google.apps.card.v1",
200209
"python-gapic-namespace=google.apps",
201210
"warehouse-package-name=google-apps-chat",
202-
"proto-plus-deps=google.apps.card.v1",
203211
],
204212
rest_numeric_enums = True,
205213
service_yaml = "chat_v1.yaml",
@@ -267,6 +275,7 @@ php_gapic_assembly_pkg(
267275
##############################################################################
268276
# Node.js
269277
##############################################################################
278+
# buildifier: disable=same-origin-load
270279
load(
271280
"@com_google_googleapis_imports//:imports.bzl",
272281
"nodejs_gapic_assembly_pkg",
@@ -298,6 +307,7 @@ nodejs_gapic_assembly_pkg(
298307
##############################################################################
299308
# Ruby
300309
##############################################################################
310+
# buildifier: disable=same-origin-load
301311
load(
302312
"@com_google_googleapis_imports//:imports.bzl",
303313
"ruby_cloud_gapic_library",
@@ -321,8 +331,8 @@ ruby_cloud_gapic_library(
321331
name = "chat_ruby_gapic",
322332
srcs = [":chat_proto_with_info"],
323333
extra_protoc_parameters = [
324-
"ruby-cloud-gem-name=google-apps-chat-v1",
325-
"ruby-cloud-extra-dependencies=google-apps-card-v1=>0.0+<2.a",
334+
"ruby-cloud-extra-dependencies=google-apps-card-v1=>0.0+<2.a",
335+
"ruby-cloud-gem-name=google-apps-chat-v1",
326336
],
327337
grpc_service_config = "chat_grpc_service_config.json",
328338
rest_numeric_enums = True,
@@ -347,6 +357,7 @@ ruby_gapic_assembly_pkg(
347357
##############################################################################
348358
# C#
349359
##############################################################################
360+
# buildifier: disable=same-origin-load
350361
load(
351362
"@com_google_googleapis_imports//:imports.bzl",
352363
"csharp_gapic_assembly_pkg",
@@ -357,7 +368,6 @@ load(
357368

358369
csharp_proto_library(
359370
name = "chat_csharp_proto",
360-
extra_opts = [],
361371
deps = [":chat_proto"],
362372
)
363373

@@ -394,6 +404,7 @@ csharp_gapic_assembly_pkg(
394404
##############################################################################
395405
# C++
396406
##############################################################################
407+
# buildifier: disable=same-origin-load
397408
load(
398409
"@com_google_googleapis_imports//:imports.bzl",
399410
"cc_grpc_library",

google/chat/v1/chat_grpc_service_config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
{ "service": "google.chat.v1.ChatService", "method": "UpdateSpaceReadState" },
2727
{ "service": "google.chat.v1.ChatService", "method": "GetSpaceReadState" },
2828
{ "service": "google.chat.v1.ChatService", "method": "GetThreadReadState" },
29-
{ "service": "google.chat.v1.ChatService", "method": "GetAttachment" }
29+
{ "service": "google.chat.v1.ChatService", "method": "GetAttachment" },
30+
{ "service": "google.chat.v1.ChatService", "method": "GetSpaceEvent" },
31+
{ "service": "google.chat.v1.ChatService", "method": "ListSpaceEvents" }
3032
],
3133
"timeout": "30s",
3234
"retryPolicy": {

google/chat/v1/chat_service.proto

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import "google/chat/v1/membership.proto";
2323
import "google/chat/v1/message.proto";
2424
import "google/chat/v1/reaction.proto";
2525
import "google/chat/v1/space.proto";
26+
import "google/chat/v1/space_event.proto";
2627
import "google/chat/v1/space_read_state.proto";
2728
import "google/chat/v1/space_setup.proto";
2829
import "google/chat/v1/thread_read_state.proto";
@@ -584,4 +585,47 @@ service ChatService {
584585
};
585586
option (google.api.method_signature) = "name";
586587
}
588+
589+
// Returns an event from a Google Chat space. The [event
590+
// payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)
591+
// contains the most recent version of the resource that changed. For example,
592+
// if you request an event about a new message but the message was later
593+
// updated, the server returns the updated `Message` resource in the event
594+
// payload.
595+
//
596+
// Requires [user
597+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
598+
// To get an event, the authenticated user must be a member of the space.
599+
//
600+
// For an example, see [Get details about an
601+
// event from a Google Chat
602+
// space](https://developers.google.com/workspace/chat/get-space-event).
603+
rpc GetSpaceEvent(GetSpaceEventRequest) returns (SpaceEvent) {
604+
option (google.api.http) = {
605+
get: "/v1/{name=spaces/*/spaceEvents/*}"
606+
};
607+
option (google.api.method_signature) = "name";
608+
}
609+
610+
// Lists events from a Google Chat space. For each event, the
611+
// [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)
612+
// contains the most recent version of the Chat resource. For example, if you
613+
// list events about new space members, the server returns `Membership`
614+
// resources that contain the latest membership details. If new members were
615+
// removed during the requested period, the event payload contains an empty
616+
// `Membership` resource.
617+
//
618+
// Requires [user
619+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
620+
// To list events, the authenticated user must be a member of the space.
621+
//
622+
// For an example, see [List events from a Google Chat
623+
// space](https://developers.google.com/workspace/chat/list-space-events).
624+
rpc ListSpaceEvents(ListSpaceEventsRequest)
625+
returns (ListSpaceEventsResponse) {
626+
option (google.api.http) = {
627+
get: "/v1/{parent=spaces/*}/spaceEvents"
628+
};
629+
option (google.api.method_signature) = "parent,filter";
630+
}
587631
}

google/chat/v1/chat_v1.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ authentication:
102102
https://www.googleapis.com/auth/chat.bot,
103103
https://www.googleapis.com/auth/chat.spaces,
104104
https://www.googleapis.com/auth/chat.spaces.readonly
105+
- selector: google.chat.v1.ChatService.GetSpaceEvent
106+
oauth:
107+
canonical_scopes: |-
108+
https://www.googleapis.com/auth/chat.memberships,
109+
https://www.googleapis.com/auth/chat.memberships.readonly,
110+
https://www.googleapis.com/auth/chat.messages,
111+
https://www.googleapis.com/auth/chat.messages.reactions,
112+
https://www.googleapis.com/auth/chat.messages.reactions.readonly,
113+
https://www.googleapis.com/auth/chat.messages.readonly,
114+
https://www.googleapis.com/auth/chat.spaces,
115+
https://www.googleapis.com/auth/chat.spaces.readonly
105116
- selector: google.chat.v1.ChatService.GetSpaceReadState
106117
oauth:
107118
canonical_scopes: |-
@@ -134,6 +145,17 @@ authentication:
134145
https://www.googleapis.com/auth/chat.messages.reactions,
135146
https://www.googleapis.com/auth/chat.messages.reactions.readonly,
136147
https://www.googleapis.com/auth/chat.messages.readonly
148+
- selector: google.chat.v1.ChatService.ListSpaceEvents
149+
oauth:
150+
canonical_scopes: |-
151+
https://www.googleapis.com/auth/chat.memberships,
152+
https://www.googleapis.com/auth/chat.memberships.readonly,
153+
https://www.googleapis.com/auth/chat.messages,
154+
https://www.googleapis.com/auth/chat.messages.reactions,
155+
https://www.googleapis.com/auth/chat.messages.reactions.readonly,
156+
https://www.googleapis.com/auth/chat.messages.readonly,
157+
https://www.googleapis.com/auth/chat.spaces,
158+
https://www.googleapis.com/auth/chat.spaces.readonly
137159
- selector: google.chat.v1.ChatService.ListSpaces
138160
oauth:
139161
canonical_scopes: |-

0 commit comments

Comments
 (0)