xref: /aosp_15_r20/external/googleapis/google/chat/v1/thread_read_state.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.chat.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22
23option csharp_namespace = "Google.Apps.Chat.V1";
24option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
25option java_multiple_files = true;
26option java_outer_classname = "ThreadReadStateProto";
27option java_package = "com.google.chat.v1";
28option php_namespace = "Google\\Apps\\Chat\\V1";
29option ruby_package = "Google::Apps::Chat::V1";
30
31// A user's read state within a thread, used to identify read and unread
32// messages.
33message ThreadReadState {
34  option (google.api.resource) = {
35    type: "chat.googleapis.com/ThreadReadState"
36    pattern: "users/{user}/spaces/{space}/threads/{thread}/threadReadState"
37    singular: "threadReadState"
38  };
39
40  // Resource name of the thread read state.
41  //
42  // Format: `users/{user}/spaces/{space}/threads/{thread}/threadReadState`
43  string name = 1;
44
45  // The time when the user's thread read state was updated. Usually this
46  // corresponds with the timestamp of the last read message in a thread.
47  google.protobuf.Timestamp last_read_time = 2;
48}
49
50// Request message for GetThreadReadStateRequest API.
51message GetThreadReadStateRequest {
52  // Required. Resource name of the thread read state to retrieve.
53  //
54  // Only supports getting read state for the calling user.
55  //
56  // To refer to the calling user, set one of the following:
57  //
58  // - The `me` alias. For example,
59  // `users/me/spaces/{space}/threads/{thread}/threadReadState`.
60  //
61  // - Their Workspace email address. For example,
62  // `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`.
63  //
64  // - Their user id. For example,
65  // `users/123456789/spaces/{space}/threads/{thread}/threadReadState`.
66  //
67  // Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState
68  string name = 1 [
69    (google.api.field_behavior) = REQUIRED,
70    (google.api.resource_reference) = {
71      type: "chat.googleapis.com/ThreadReadState"
72    }
73  ];
74}
75