GitLab...inator(3pm)
π GitLab::API::v4::Paginator β the 3pm page bestie π
okay so real talk, this is the GitLab::API::v4::Paginator page from the User Contributed Perl Documentation, and it's literally just the little goblin that walks you through paginated GitLab v4 API records. page by page. record by record. no cap. π¦
β¨ NAME β¨
GitLab::API::v4::Paginator β iterate through paginated GitLab v4 API records. that's it, that's the whole job. π
πΈ DESCRIPTION πΈ
so, bestie, there should be no need to create objects of this type directly. like, none. instead use "paginator" in GitLab::API::v4 which simplifies things a bit. it's giving "let the nice wrapper handle it" energy. π
π 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. those are the rules, periodt. β¨
api
the GitLab::API::v4 object. your main character. π
π§ 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. so like, everything except that one thing. π
params
the \%params hash ref argument. yep. that's the one. π
π₯ METHODS π₯
next_page
while (my $records = $paginator->next_page()) { ... }
returns an array ref of records for the next page. one page at a time, bestie, we love a slow reveal. π
next
while (my $record = $paginator->next()) { ... }
returns the next record in the current page. and if all records have been exhausted then "next_page" will automatically be called. so if you wanna ignore pagination entirely you can literally just call "next" over and over again to walk through all the records. obsessed with the convenience ngl. πβ¨
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. it ate and left no crumbs. π₯
reset
$paginator->reset();
reset the paginator back to its original state on the first page with no records retrieved yet. a little refresh, a little glow-up, a little back-to-square-one moment. π π¦
π«Ά SUPPORT π«Ά
see "SUPPORT" in GitLab::API::v4.
π AUTHORS π
see "AUTHORS" in GitLab::API::v4.
π LICENSE π
see "LICENSE" in GitLab::API::v4.
and that's the whole page, bestie!! π this little love letter was baked with perl v5.36.0 and dated 2023-06-13, so shoutout to that exact vintage. stay paginated, stay iconic, iykyk. πβ¨π
π¦ where this page comes from
- debian trixie: libgitlab-api-v4-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgitlab-api-v4-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgitlab-api-v4-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgitlab-api-v4-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms