memos/proto/api/v2/inbox_service.proto

86 lines
1.8 KiB
Protocol Buffer
Raw Normal View History

2023-10-27 09:01:17 +08:00
syntax = "proto3";
package memos.api.v2;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/protobuf/field_mask.proto";
2023-10-28 00:08:42 +08:00
import "google/protobuf/timestamp.proto";
2023-10-27 09:01:17 +08:00
option go_package = "gen/api/v2";
service InboxService {
2024-02-01 21:26:09 +08:00
// ListInboxes lists inboxes for a user.
2023-10-28 00:08:42 +08:00
rpc ListInboxes(ListInboxesRequest) returns (ListInboxesResponse) {
option (google.api.http) = {get: "/api/v2/inboxes"};
2023-10-27 09:01:17 +08:00
}
2024-02-01 21:26:09 +08:00
// UpdateInbox updates an inbox.
2023-10-27 09:01:17 +08:00
rpc UpdateInbox(UpdateInboxRequest) returns (UpdateInboxResponse) {
option (google.api.http) = {
2024-02-06 20:55:27 +08:00
patch: "/api/v2/{inbox.name=inboxes/*}"
2023-10-27 09:01:17 +08:00
body: "inbox"
};
2024-02-06 20:55:27 +08:00
option (google.api.method_signature) = "inbox,update_mask";
2023-10-27 09:01:17 +08:00
}
2024-02-01 21:26:09 +08:00
// DeleteInbox deletes an inbox.
2023-10-27 09:01:17 +08:00
rpc DeleteInbox(DeleteInboxRequest) returns (DeleteInboxResponse) {
2024-02-06 19:46:25 +08:00
option (google.api.http) = {delete: "/api/v2/{name=inboxes/*}"};
2023-10-27 09:01:17 +08:00
option (google.api.method_signature) = "name";
}
}
message Inbox {
// The name of the inbox.
2024-03-30 14:58:47 +08:00
// Format: inboxes/{id}
2023-10-27 09:01:17 +08:00
string name = 1;
2024-03-30 14:58:47 +08:00
// Format: users/{id}
2023-10-27 09:01:17 +08:00
string sender = 2;
2024-03-30 14:58:47 +08:00
// Format: users/{id}
2023-10-27 09:01:17 +08:00
string receiver = 3;
enum Status {
STATUS_UNSPECIFIED = 0;
UNREAD = 1;
2023-10-28 02:49:35 +08:00
ARCHIVED = 2;
2023-10-27 09:01:17 +08:00
}
Status status = 4;
2023-10-28 00:08:42 +08:00
google.protobuf.Timestamp create_time = 5;
enum Type {
TYPE_UNSPECIFIED = 0;
TYPE_MEMO_COMMENT = 1;
2023-11-06 22:53:55 +08:00
TYPE_VERSION_UPDATE = 2;
}
2023-10-28 00:08:42 +08:00
Type type = 6;
2023-10-27 09:01:17 +08:00
2023-10-28 00:08:42 +08:00
optional int32 activity_id = 7;
2023-10-27 09:01:17 +08:00
}
2023-10-28 00:08:42 +08:00
message ListInboxesRequest {
2024-03-30 14:58:47 +08:00
// Format: users/{id}
2023-10-27 09:01:17 +08:00
string user = 1;
}
2023-10-28 00:08:42 +08:00
message ListInboxesResponse {
repeated Inbox inboxes = 1;
2023-10-27 09:01:17 +08:00
}
message UpdateInboxRequest {
2024-02-06 20:55:27 +08:00
Inbox inbox = 1;
2023-10-27 09:01:17 +08:00
2024-02-06 20:55:27 +08:00
google.protobuf.FieldMask update_mask = 2;
2023-10-27 09:01:17 +08:00
}
message UpdateInboxResponse {
Inbox inbox = 1;
}
message DeleteInboxRequest {
// The name of the inbox to delete.
2024-03-30 14:58:47 +08:00
// Format: inboxes/{id}
2023-10-27 09:01:17 +08:00
string name = 1;
}
message DeleteInboxResponse {}