inbox_service.proto 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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/{user}
  33. string sender = 2;
  34. // Format: users/{user}
  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/{user}
  53. string user = 1;
  54. // The maximum number of inbox to return.
  55. int32 page_size = 2;
  56. // Provide this to retrieve the subsequent page.
  57. string page_token = 3;
  58. }
  59. message ListInboxesResponse {
  60. repeated Inbox inboxes = 1;
  61. // A token, which can be sent as `page_token` to retrieve the next page.
  62. // If this field is omitted, there are no subsequent pages.
  63. string next_page_token = 2;
  64. }
  65. message UpdateInboxRequest {
  66. Inbox inbox = 1;
  67. google.protobuf.FieldMask update_mask = 2;
  68. }
  69. message DeleteInboxRequest {
  70. // The name of the inbox to delete.
  71. // Format: inboxes/{id}
  72. string name = 1;
  73. }