1GitLab::API::v4::PaginaUtsoerr(3Cpomn)tributed Perl DocuGmietnLtaabt:i:oAnPI::v4::Paginator(3pm)
2
3
4

NAME

6       GitLab::API::v4::Paginator - Iterate through paginated GitLab v4 API
7       records.
8

DESCRIPTION

10       There should be no need to create objects of this type directly,
11       instead use "paginator" in GitLab::API::v4 which simplifies things a
12       bit.
13

REQUIRED ARGUMENTS

15   method
16       The name of the method subroutine to call on the "api" object to get
17       records from.
18
19       This method must accept a hash ref of parameters as the last argument,
20       adhere to the "page" and "per_page" parameters, and return an array
21       ref.
22
23   api
24       The GitLab::API::v4 object.
25

OPTIONAL ARGUMENTS

27   args
28       The arguments to use when calling the "method", the same arguments you
29       would use when you call the method yourself on the "api" object, minus
30       the "\%params" hash ref.
31
32   params
33       The "\%params" hash ref argument.
34

METHODS

36   next_page
37           while (my $records = $paginator->next_page()) { ... }
38
39       Returns an array ref of records for the next page.
40
41   next
42           while (my $record = $paginator->next()) { ... }
43
44       Returns the next record in the current page.  If all records have been
45       exhausted then "next_page" will automatically be called.  This way if
46       you want to ignore pagination you can just call "next" over and over
47       again to walk through all the records.
48
49   all
50           my $records = $paginator->all();
51
52       This is just an alias for calling "next_page" over and over again to
53       build an array ref of all records.
54
55   reset
56           $paginator->reset();
57
58       Reset the paginator back to its original state on the first page with
59       no records retrieved yet.
60

SUPPORT

62       See "SUPPORT" in GitLab::API::v4.
63

AUTHORS

65       See "AUTHORS" in GitLab::API::v4.
66
68       See "COPYRIGHT AND LICENSE" in GitLab::API::v4.
69
70
71
72perl v5.32.0                      2020-07-28   GitLab::API::v4::Paginator(3pm)
Impressum