pagination.proto 780 B

1234567891011121314151617181920212223242526
  1. syntax = "proto3";
  2. package chatto.api.v1;
  3. import "buf/validate/validate.proto";
  4. // Offset-based page request for list RPCs whose result order is stable enough
  5. // for simple list browsing.
  6. message PageRequest {
  7. // Maximum number of items to request. Each RPC defines its default and
  8. // effective maximum; this shared request shape accepts values up to 500.
  9. int32 limit = 1 [(buf.validate.field).int32 = {
  10. gte: 0,
  11. lte: 500
  12. }];
  13. // Zero-based number of matching items to skip.
  14. int32 offset = 2 [(buf.validate.field).int32.gte = 0];
  15. }
  16. // Offset-based page metadata returned by list RPCs.
  17. message PageInfo {
  18. // Total matching item count before pagination.
  19. int64 total_count = 1;
  20. // True when another page exists after this response.
  21. bool has_more = 2;
  22. }