1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/// # Paginated Response
/// For pagination to work correctly, it is important that multiple calls to the same URL
/// (including query parameters): result in the same objects being returned by the server.
/// For this to be the case, the sequence of objects mustn’t change, or as little as possible.
/// It is best practice to return the oldest (by creation date, not the last_updated field) first.
/// While a client crawls over the pages (multiple GET requests every time to the 'next' page Link),
/// a new object might be created on the server.
/// The client detects this: the `X-Total-Count` will be higher on the next call.
/// But the client doesn’t have to correct for this.
/// Only the last page will be different (or an additional page).
/// So the client will not be required to crawl all pages all over again when the
/// client has reached to last page it has retrieved all relevant pages and is up to date.
///
///
/// ## NOTE
/// Some query parameters can cause concurrency problems.
/// For example the date_to query parameter. When there are for example 1000 objects
/// matching a query for all objects with date_to before 2016-01-01.
/// While crawling over the pages one of these objects is updated.
/// The client detects this: `X-Total-Count` will be lower in the next request.
/// It is advised to redo the previous GET but then with the offset lowered by 1
/// (if the offset was not 0) and after that continue crawling the 'next' page links.
/// When an object before this page has been updated, then the client has missed 1 object.
///