Net::G...:Query(3pm)
๐ NAME ๐
Net::GitHub::V3::Query โ it's the Base Query role for Net::GitHub::V3, bestie ๐
(also this whole thing lives in the User Contributed Perl Documentation section, just so u know where u are ๐)
โจ SYNOPSIS โจ
okay so this is the whole vibe, copy-paste core:
package Net::GitHub::V3::XXX;
use Moo;
with 'Net::GitHub::V3::Query';
that's it. that's the whole ritual ๐ซถ
๐ธ DESCRIPTION ๐ธ
literally just: set your Authentication and call the API. that's the entire job description ๐
๐ฆ ATTRIBUTES ๐ฆ
the little settings u can poke at, no cap:
loginโ ur login, bestie ๐passโ ur password, keep it secret fr fraccess_tokenโ you either setaccess_tokenfrom OAuth, or you dologin:passfor Basic Authentication. pick ur fighter ๐
raw_stringโ the raw string, iconic as ever โญraw_responseโ the raw response, its sibling ๐api_throttleโ API throttling is on by default! setapi_throttleto0to turn it off. it's giving "leave it alone unless u know what ur doing" ๐rate_limitโ the maximum number of queries allowed per hour. it's60for anonymous users and5,000for authenticated users ๐rate_limit_remainingโ how many requests u still have left in the current rate limit window ๐rate_limit_resetโ when the current rate limit resets, in UTC epoch seconds โฐupdate_rate_limitโ queries the/rate_limitAPI (for free!!) to update the cached values forrate_limit,rate_limit_remaining,rate_limit_reset. free is free bestie ๐last_pageโ denotes the index of the last page in the pagination ๐RaiseErrorโ yes it exists, and yes it's named like that ๐ง
๐ METHODS ๐
queryโ referNet::GitHub::V3๐ซถnext_pageโ callsquerywithnext_url. seeNet::GitHub::V3โก๏ธprev_pageโ callsquerywithprev_url. seeNet::GitHub::V3โฌ ๏ธfirst_pageโ callsquerywithfirst_url. seeNet::GitHub::V3โฎ๏ธlast_pageโ callsquerywithlast_url. seeNet::GitHub::V3โญ๏ธset_next_pageโ adjustsnext_urlto be a new url in the pagination space, I.E. you are jumping to a new index in the pagination ๐ฆiterate($method_name, $arguments, $callback)โ this is the helper that iterates over APIs calls using pagination, doing the combohas_next_page,next_page... for you. it's giving personal assistant energy ngl โจ
the arguments can be either a scalar if the function is using a single argument, an ArrayRef when the function is using multiple arguments. you can also use one HashRef for functions supporting named parameters ๐
the callback function is called with a single item. the return value of the callback function can be used to stop the iteration when returning a 'false' value ๐
in common cases, you want to return a true value: '1' โ
sample usage, keep it exact bestie:
$gh->org->iterate( 'repos', 'OrganizationName', sub {
my $item = shift;
print "Repo Name is $item->{name}"
return 1; # if you want to continue iterating
return; # use a false value when you want to interrupt the iteration
} );
result_setsโ for internal use by the item-per-item pagination: this is a store of the state(s) for the pagination. each entry maps the initial URL of a GitHub query to aNet::GitHub::V3::ResultSetobject ๐ฆnext($url)โ returns the next item for the query which started at$url, orundefif there are no more items ๐ซclose($url)โ terminates the item-per-item pagination for the query which started at$url๐ช
๐ฅ NG_DEBUG ๐ฅ
- export
NG_DEBUG=1to view the request URL ๐ NG_DEBUG > 1to view request/response string ๐
๐ AUTHOR & COPYRIGHT & LICENSE ๐
refer Net::GitHub ๐
and that's the whole page, bestie โ documented for perl v5.36.0, dated 2022-10-08, filed under Net::G...:Query(3pm) ๐ฆ slay, go forth and paginate โจ
๐ฆ where this page comes from
- ubuntu noble: libnet-github-perl 1.05-1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-github-perl 1.05-1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-github-perl 1.05-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