memos/proto/api/v1/inbox_service.proto

81 lines
1.8 KiB
Protocol Buffer
Raw Permalink Normal View History

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