Skip to content

Commit

Permalink
Add ordering for list methods (#39)
Browse files Browse the repository at this point in the history
Add `order_desc` bool to list methods for ordering.
  • Loading branch information
emcfarlane authored Nov 28, 2023
1 parent af95221 commit 97498ee
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions buf/registry/module/v1beta1/branch_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ message ListBranchesRequest {
// - Is a Branch is referenced, this Branch is returned.
// - If a Digest is referenced, all Branches that contain a Commit with this Digest are returned.
ResourceRef resource_ref = 3 [(buf.validate.field).required = true];
// Whether to sort the Branches in descending order.
bool sort_desc = 4;
}

message ListBranchesResponse {
Expand Down
2 changes: 2 additions & 0 deletions buf/registry/module/v1beta1/commit_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ message ListCommitHistoryRequest {
bool has_tag = 4;
// Only return Commits that have one or more associated VCSCommits.
bool has_vcs_commit = 5;
// Whether to sory the Commits in descending order.
bool sort_desc = 6;
}

message ListCommitHistoryResponse {
Expand Down
2 changes: 2 additions & 0 deletions buf/registry/module/v1beta1/module_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ message ListModulesRequest {
// If empty, all Modules for all owners are listed, but this functionality
// is limited to Users with the necessary permissions.
repeated buf.registry.owner.v1beta1.OwnerRef owner_refs = 3;
// Whether to sort the Modules in descending order.
bool sort_desc = 4;
}

message ListModulesResponse {
Expand Down
2 changes: 2 additions & 0 deletions buf/registry/module/v1beta1/tag_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ message ListTagsRequest {
// - Is a Branch is referenced, all Tags for Commits on the Branch are returned.
// - If a Digest is referenced, all Tags that contain a Commit with this Digest are returned.
ResourceRef resource_ref = 3 [(buf.validate.field).required = true];
// Whether to sort the Tags in descending order.
bool sort_desc = 4;
}

message ListTagsResponse {
Expand Down
2 changes: 2 additions & 0 deletions buf/registry/module/v1beta1/vcs_commit_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,6 @@ message ListVCSCommitsResponse {
string next_page_token = 1 [(buf.validate.field).string.max_len = 4096];
// The listed VCSCommits.
repeated VCSCommit vcs_commits = 2;
// Whether to sort the VCSCommits in descending order.
bool sort_desc = 4;
}
2 changes: 2 additions & 0 deletions buf/registry/owner/v1beta1/organization_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ message ListOrganizationsRequest {
// If this is empty, all Organizations are listed, but this functionality
// is limited to Users with the necessary permissions.
repeated UserRef user_refs = 3;
// Whether to sort the Organizations in descending order.
bool sort_desc = 4;
}

message ListOrganizationsResponse {
Expand Down
2 changes: 2 additions & 0 deletions buf/registry/owner/v1beta1/user_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ message ListUsersRequest {
// If this is empty, all Users for all Organizations are listed, but this functionality
// is limited to Users with the necessary permissions.
repeated OrganizationRef organization_refs = 3;
// Whether to sort the Users in descending order.
bool sort_desc = 4;
}

message ListUsersResponse {
Expand Down

0 comments on commit 97498ee

Please sign in to comment.