Skip to content

Commit 062dff4

Browse files
feat: [chat] Addition of space notification setting Chat API (#6120)
* feat: Addition of space notification setting Chat API PiperOrigin-RevId: 734264583 Source-Link: googleapis/googleapis@76254e6 Source-Link: googleapis/googleapis-gen@63109f6 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNoYXQvLk93bEJvdC55YW1sIiwiaCI6IjYzMTA5ZjYwY2Y1ZmQ3NmRiZmIxMTUxMzM5ZWUxNzQwNjY1MTg1MjIifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 3f75a90 commit 062dff4

15 files changed

Lines changed: 2436 additions & 2 deletions

packages/google-chat/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
141141
| Chat_service.get_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_message.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_message.js,packages/google-chat/samples/README.md) |
142142
| Chat_service.get_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space.js,packages/google-chat/samples/README.md) |
143143
| Chat_service.get_space_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space_event.js,packages/google-chat/samples/README.md) |
144+
| Chat_service.get_space_notification_setting | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js,packages/google-chat/samples/README.md) |
144145
| Chat_service.get_space_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js,packages/google-chat/samples/README.md) |
145146
| Chat_service.get_thread_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js,packages/google-chat/samples/README.md) |
146147
| Chat_service.list_memberships | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.list_memberships.js,packages/google-chat/samples/README.md) |
@@ -153,6 +154,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
153154
| Chat_service.update_membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_membership.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_membership.js,packages/google-chat/samples/README.md) |
154155
| Chat_service.update_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_message.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_message.js,packages/google-chat/samples/README.md) |
155156
| Chat_service.update_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space.js,packages/google-chat/samples/README.md) |
157+
| Chat_service.update_space_notification_setting | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js,packages/google-chat/samples/README.md) |
156158
| Chat_service.update_space_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js,packages/google-chat/samples/README.md) |
157159
| Chat_service.upload_attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js,packages/google-chat/samples/README.md) |
158160
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/quickstart.js,packages/google-chat/samples/README.md) |

packages/google-chat/protos/google/chat/v1/chat_service.proto

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import "google/chat/v1/message.proto";
2424
import "google/chat/v1/reaction.proto";
2525
import "google/chat/v1/space.proto";
2626
import "google/chat/v1/space_event.proto";
27+
import "google/chat/v1/space_notification_setting.proto";
2728
import "google/chat/v1/space_read_state.proto";
2829
import "google/chat/v1/space_setup.proto";
2930
import "google/chat/v1/thread_read_state.proto";
@@ -64,7 +65,8 @@ service ChatService {
6465
"https://www.googleapis.com/auth/chat.spaces.create,"
6566
"https://www.googleapis.com/auth/chat.spaces.readonly,"
6667
"https://www.googleapis.com/auth/chat.users.readstate,"
67-
"https://www.googleapis.com/auth/chat.users.readstate.readonly";
68+
"https://www.googleapis.com/auth/chat.users.readstate.readonly,"
69+
"https://www.googleapis.com/auth/chat.users.spacesettings";
6870

6971
// Creates a message in a Google Chat space. For an example, see [Send a
7072
// message](https://developers.google.com/workspace/chat/create-messages).
@@ -739,4 +741,34 @@ service ChatService {
739741
};
740742
option (google.api.method_signature) = "parent,filter";
741743
}
744+
745+
// Gets the space notification setting. For an example, see [Get the
746+
// caller's space notification
747+
// setting](https://developers.google.com/workspace/chat/get-space-notification-setting).
748+
//
749+
// Requires [user
750+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
751+
rpc GetSpaceNotificationSetting(GetSpaceNotificationSettingRequest)
752+
returns (SpaceNotificationSetting) {
753+
option (google.api.http) = {
754+
get: "/v1/{name=users/*/spaces/*/spaceNotificationSetting}"
755+
};
756+
option (google.api.method_signature) = "name";
757+
}
758+
759+
// Updates the space notification setting. For an example, see [Update
760+
// the caller's space notification
761+
// setting](https://developers.google.com/workspace/chat/update-space-notification-setting).
762+
//
763+
// Requires [user
764+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
765+
rpc UpdateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest)
766+
returns (SpaceNotificationSetting) {
767+
option (google.api.http) = {
768+
patch: "/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}"
769+
body: "space_notification_setting"
770+
};
771+
option (google.api.method_signature) =
772+
"space_notification_setting,update_mask";
773+
}
742774
}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// Copyright 2025 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+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
21+
import "google/protobuf/field_mask.proto";
22+
23+
option csharp_namespace = "Google.Apps.Chat.V1";
24+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
25+
option java_multiple_files = true;
26+
option java_outer_classname = "SpaceNotificationSettingProto";
27+
option java_package = "com.google.chat.v1";
28+
option objc_class_prefix = "DYNAPIProto";
29+
option php_namespace = "Google\\Apps\\Chat\\V1";
30+
option ruby_package = "Google::Apps::Chat::V1";
31+
32+
// The notification setting of a user in a space.
33+
message SpaceNotificationSetting {
34+
option (google.api.resource) = {
35+
type: "chat.googleapis.com/SpaceNotificationSetting"
36+
pattern: "users/{user}/spaces/{space}/spaceNotificationSetting"
37+
singular: "spaceNotificationSetting"
38+
};
39+
40+
// The notification setting types. Other types might be supported in the
41+
// future.
42+
enum NotificationSetting {
43+
// Reserved.
44+
NOTIFICATION_SETTING_UNSPECIFIED = 0;
45+
46+
// Notifications are triggered by @mentions, followed threads, first
47+
// message of new threads. All new threads are automatically followed,
48+
// unless manually unfollowed by the user.
49+
ALL = 1;
50+
51+
// The notification is triggered by @mentions, followed threads, first
52+
// message of new threads. Not available for 1:1 direct messages.
53+
MAIN_CONVERSATIONS = 2;
54+
55+
// The notification is triggered by @mentions, followed threads. Not
56+
// available for 1:1 direct messages.
57+
FOR_YOU = 3;
58+
59+
// Notification is off.
60+
OFF = 4;
61+
}
62+
63+
// The space notification mute setting types.
64+
enum MuteSetting {
65+
// Reserved.
66+
MUTE_SETTING_UNSPECIFIED = 0;
67+
68+
// The user will receive notifications for the space based on the
69+
// notification setting.
70+
UNMUTED = 1;
71+
72+
// The user will not receive any notifications for the space, regardless of
73+
// the notification setting.
74+
MUTED = 2;
75+
}
76+
77+
// Identifier. The resource name of the space notification setting.
78+
// Format: `users/{user}/spaces/{space}/spaceNotificationSetting`.
79+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
80+
81+
// The notification setting.
82+
optional NotificationSetting notification_setting = 2;
83+
84+
// The space notification mute setting.
85+
optional MuteSetting mute_setting = 3;
86+
}
87+
88+
// Request message to get space notification setting.
89+
// Only supports getting notification setting for the calling user.
90+
message GetSpaceNotificationSettingRequest {
91+
// Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting
92+
//
93+
// - `users/me/spaces/{space}/spaceNotificationSetting`, OR
94+
// - `users/[email protected]/spaces/{space}/spaceNotificationSetting`, OR
95+
// - `users/123456789/spaces/{space}/spaceNotificationSetting`.
96+
// Note: Only the caller's user id or email is allowed in the path.
97+
string name = 1 [
98+
(google.api.field_behavior) = REQUIRED,
99+
(google.api.resource_reference) = {
100+
type: "chat.googleapis.com/SpaceNotificationSetting"
101+
}
102+
];
103+
}
104+
105+
// Request to update the space notification settings.
106+
// Only supports updating notification setting for the calling user.
107+
message UpdateSpaceNotificationSettingRequest {
108+
// Required. The resource name for the space notification settings must be
109+
// populated in the form of
110+
// `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields
111+
// specified by `update_mask` are updated.
112+
SpaceNotificationSetting space_notification_setting = 1
113+
[(google.api.field_behavior) = REQUIRED];
114+
115+
// Required. Supported field paths:
116+
//
117+
// - `notification_setting`
118+
//
119+
// - `mute_setting`
120+
google.protobuf.FieldMask update_mask = 2
121+
[(google.api.field_behavior) = REQUIRED];
122+
}

0 commit comments

Comments
 (0)