inbox_service.proto 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. syntax = "proto3";
  2. package memos.api.v1;
  3. import "google/api/annotations.proto";
  4. import "google/api/client.proto";
  5. import "google/protobuf/empty.proto";
  6. import "google/protobuf/field_mask.proto";
  7. import "google/protobuf/timestamp.proto";
  8. option go_package = "gen/api/v1";
  9. service InboxService {
  10. // ListInboxes lists inboxes for a user.
  11. rpc ListInboxes(ListInboxesRequest) returns (ListInboxesResponse) {
  12. option (google.api.http) = {get: "/api/v1/inboxes"};
  13. }
  14. // UpdateInbox updates an inbox.
  15. rpc UpdateInbox(UpdateInboxRequest) returns (Inbox) {
  16. option (google.api.http) = {
  17. patch: "/api/v1/{inbox.name=inboxes/*}"
  18. body: "inbox"
  19. };
  20. option (google.api.method_signature) = "inbox,update_mask";
  21. }
  22. // DeleteInbox deletes an inbox.
  23. rpc DeleteInbox(DeleteInboxRequest) returns (google.protobuf.Empty) {
  24. option (google.api.http) = {delete: "/api/v1/{name=inboxes/*}"};
  25. option (google.api.method_signature) = "name";
  26. }
  27. }
  28. message Inbox {
  29. // The name of the inbox.
  30. // Format: inboxes/{id}
  31. string name = 1;
  32. // Format: users/{id}
  33. string sender = 2;
  34. // Format: users/{id}
  35. string receiver = 3;
  36. enum Status {
  37. STATUS_UNSPECIFIED = 0;
  38. UNREAD = 1;
  39. ARCHIVED = 2;
  40. }
  41. Status status = 4;
  42. google.protobuf.Timestamp create_time = 5;
  43. enum Type {
  44. TYPE_UNSPECIFIED = 0;
  45. MEMO_COMMENT = 1;
  46. VERSION_UPDATE = 2;
  47. }
  48. Type type = 6;
  49. optional int32 activity_id = 7;
  50. }
  51. message ListInboxesRequest {
  52. // Format: users/{id}
  53. string user = 1;
  54. }
  55. message ListInboxesResponse {
  56. repeated Inbox inboxes = 1;
  57. }
  58. message UpdateInboxRequest {
  59. Inbox inbox = 1;
  60. google.protobuf.FieldMask update_mask = 2;
  61. }
  62. message DeleteInboxRequest {
  63. // The name of the inbox to delete.
  64. // Format: inboxes/{id}
  65. string name = 1;
  66. }