logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

GitLab::API::v4::Paginator - Iterate through paginated GitLab v4 API records.

Authors

       See "AUTHORS" in GitLab::API::v4.

Description

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

License

       See "LICENSE" in GitLab::API::v4.

perl v5.36.0                                       2023-06-13                    GitLab::API::v4::Paginator(3pm)

Methods

next_page
           while (my $records = $paginator->next_page()) { ... }

       Returns an array ref of records for the next page.

   next
           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.

   all
           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.

   reset
           $paginator->reset();

       Reset the paginator back to its original state on the first page with no records retrieved yet.

Name

       GitLab::API::v4::Paginator - Iterate through paginated GitLab v4 API records.

Optional Arguments

args
       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.

Required Arguments

method
       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.

   api
       The GitLab::API::v4 object.

Support

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

See Also