GitLab::API::v4::Paginator - Iterate through paginated GitLab v4 API records.
There should be no need to create objects of this type
directly, instead use paginator in the GitLab::API::v4 manpage 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.
The the GitLab::API::v4 manpage 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.
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.
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.
See SUPPORT in the GitLab::API::v4 manpage.
See AUTHORS in the GitLab::API::v4 manpage.
See COPYRIGHT AND LICENSE in the GitLab::API::v4 manpage.
|