Skip to content

Add pagination docs to list-connections #2369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4-docs/list-connections
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add pagination docs to `POST /list-connections`
1 change: 1 addition & 0 deletions libs/wire-api/src/Wire/API/Routes/Public/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ type ConnectionAPI =
:<|> Named
"list-connections"
( Summary "List the connections to other users, including remote users"
:> Description PaginationDocs
:> ZUser
:> "list-connections"
:> ReqBody '[JSON] ListConnectionsRequestPaginated
Expand Down
12 changes: 1 addition & 11 deletions libs/wire-api/src/Wire/API/Routes/Public/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,7 @@ type ConversationAPI =
:<|> Named
"list-conversation-ids"
( Summary "Get all conversation IDs."
:> Description
"The IDs returned by this endpoint are paginated. To\
\ get the first page, make a call with the `paging_state` field set to\
\ `null` (or omitted). Whenever the `has_more` field of the response is\
\ set to `true`, more results are available, and they can be obtained\
\ by calling the endpoint again, but this time passing the value of\
\ `paging_state` returned by the previous call. One can continue in\
\ this fashion until all results are returned, which is indicated by\
\ `has_more` being `false`. Note that `paging_state` should be\
\ considered an opaque token. It should not be inspected, or stored, or\
\ reused across multiple unrelated invokations of the endpoint."
:> Description PaginationDocs
:> ZLocalUser
:> "conversations"
:> "list-ids"
Expand Down
11 changes: 11 additions & 0 deletions libs/wire-api/src/Wire/API/Routes/Public/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,14 @@ instance
fromUnion (Z (I ())) = Unchanged
fromUnion (S (Z (I a))) = Updated a
fromUnion (S (S x)) = case x of

type PaginationDocs =
"The IDs returned by this endpoint are paginated. To get the first page, make\
\ a call with the `paging_state` field set to `null` (or omitted). Whenever the\
\ `has_more` field of the response is set to `true`, more results are available,\
\ and they can be obtained by calling the endpoint again, but this time passing\
\ the value of `paging_state` returned by the previous call. One can continue in\
\ this fashion until all results are returned, which is indicated by `has_more`\
\ being `false`. Note that `paging_state` should be considered an opaque token.\
\ It should not be inspected, or stored, or reused across multiple unrelated\
\ invocations of the endpoint."