GitLab::API::v3::Paginator - Iterate through paginated GitLab v3 API records.
There should be no need to create objects of this type directly, instead use "paginator" in GitLab::API::v3 which simplifies things a bit.
The name of the method subroutine to call on the "api" object to get records from.
This method must accept a hash ref of parameters as the last argument, adhere to the page and per_page parameters, and return an array ref.
page
per_page
The GitLab::API::v3 object.
The arguments to use when calling the "method", the same arguments you would use when you call the method yourself on the "api" object, minus the \%params hash ref.
\%params
The \%params hash ref argument.
while (my $records = $paginator->next_page()) { ... }
Returns an array ref of records for the next page.
while (my $record = $paginator->next()) { ... }
Returns the next record in the current page. If all records have been exhausted then "next_page" will automatically be called. This way if you want to ignore pagination you can just call next over and over again to walk through all the records.
next
my $records = $paginator->all();
This is just an alias for calling "next_page" over and over again to build an array ref of all records.
$paginator->reset();
Reset the paginator back to its original state on the first page with no records retrieved yet.
Aran Clary Deltac <bluefeet@gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install GitLab::API::v3, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GitLab::API::v3
CPAN shell
perl -MCPAN -e shell install GitLab::API::v3
For more information on module installation, please visit the detailed CPAN module installation guide.