memos/proto/api/v2/inbox_service.proto

84 lines
1.7 KiB
Protocol Buffer
Raw Normal View History

2023-10-27 04:01:17 +03: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-27 19:08:42 +03:00
import "google/protobuf/timestamp.proto";
2023-10-27 04:01:17 +03:00
option go_package = "gen/api/v2";
service InboxService {
2023-10-27 19:08:42 +03:00
rpc ListInboxes(ListInboxesRequest) returns (ListInboxesResponse) {
option (google.api.http) = {get: "/api/v2/inboxes"};
2023-10-27 04:01:17 +03:00
}
rpc UpdateInbox(UpdateInboxRequest) returns (UpdateInboxResponse) {
option (google.api.http) = {
2023-10-27 19:08:42 +03:00
patch: "/v2/inboxes"
2023-10-27 04:01:17 +03:00
body: "inbox"
};
option (google.api.method_signature) = "inbox,update_mask";
}
rpc DeleteInbox(DeleteInboxRequest) returns (DeleteInboxResponse) {
2023-10-27 19:08:42 +03:00
option (google.api.http) = {delete: "/v2/{name=inboxes/*}"};
2023-10-27 04:01:17 +03:00
option (google.api.method_signature) = "name";
}
}
message Inbox {
// The name of the inbox.
2023-10-27 19:08:42 +03:00
// Format: inboxes/{id}
2023-10-27 04:01:17 +03:00
string name = 1;
// Format: users/{username}
string sender = 2;
// Format: users/{username}
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;
TYPE_MEMO_COMMENT = 1;
}
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 {
// Format: users/{username}
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 {
Inbox inbox = 1;
google.protobuf.FieldMask update_mask = 2;
}
message UpdateInboxResponse {
Inbox inbox = 1;
}
message DeleteInboxRequest {
// The name of the inbox to delete.
2023-10-27 19:08:42 +03:00
// Format: inboxes/{inbox}
2023-10-27 04:01:17 +03:00
string name = 1;
}
message DeleteInboxResponse {}