Skip to content

Commit

Permalink
refactor: renovate list memos endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyjoygh committed Feb 2, 2025
1 parent 14c72fa commit be5e24c
Show file tree
Hide file tree
Showing 15 changed files with 781 additions and 456 deletions.
6 changes: 6 additions & 0 deletions proto/api/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ message PageToken {
int32 limit = 1;
int32 offset = 2;
}

enum Direction {
DIRECTION_UNSPECIFIED = 0;
ASC = 1;
DESC = 2;
}
33 changes: 28 additions & 5 deletions proto/api/v1/memo_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ service MemoService {
}
// ListMemos lists memos with pagination and filter.
rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) {
option (google.api.http) = {get: "/api/v1/memos"};
option (google.api.http) = {
get: "/api/v1/memos"
additional_bindings: {get: "/api/v1/{parent=users/*}/memos"}
};
}
// GetMemo gets a memo.
rpc GetMemo(GetMemoRequest) returns (Memo) {
Expand Down Expand Up @@ -190,16 +193,36 @@ message CreateMemoRequest {
}

message ListMemosRequest {
// The parent is the owner of the memos.
// If not specified or `users/-`, it will list all memos.
string parent = 1;

// The maximum number of memos to return.
int32 page_size = 1;
int32 page_size = 2;

// A page token, received from a previous `ListMemos` call.
// Provide this to retrieve the subsequent page.
string page_token = 2;
string page_token = 3;

// The state of the memos to list.
// Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
State state = 4;

// What field to sort the results by.
// Default to display_time.
string sort = 5;

// The direction to sort the results by.
// Default to DESC.
Direction direction = 6;

// Filter is a CEL expression to filter memos.
// Refer to `Shortcut.filter`.
string filter = 7;

// Filter is used to filter memos returned in the list.
// [Deprecated] Old filter contains some specific conditions to filter memos.
// Format: "creator == 'users/{user}' && visibilities == ['PUBLIC', 'PROTECTED']"
string filter = 3;
string old_filter = 8;
}

message ListMemosResponse {
Expand Down
84 changes: 69 additions & 15 deletions proto/gen/api/v1/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit be5e24c

Please sign in to comment.