-
-
17 Apr 2022 04:27:28 UTC
- Distribution: Net-GitHub
- Module version: 1.03
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (170 / 0 / 0)
- Kwalitee
Bus factor: 1- 28.39% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (43.36KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 52 contributors- Fayland Lam, C<< <fayland at gmail.com> >>
-
Alan Berndt
-
Alex Muntada
-
Alex Vandiver
-
brian d foy
-
c9s
-
Chris Nehren
-
Christine Spang
-
Chris Williams
-
Danijel Tasov
-
David Golden
-
David Precious
-
fayland
-
Finn Smith
-
franck cuny
-
Graham Knop
-
Grant McLean
-
gregor herrmann
-
Harald Jörg
-
hiroraba
-
Hristo Dragolov
-
Ioan Rogers
-
Jason Dorweiller
-
jddorweiler
-
Jesse Luehrs
-
Jesse Vincent
-
JJ Merelo
-
Johannes Kilian
-
John 'Warthog9' Hawley
-
Jonathan Gopel
-
J.R. Mash
-
Kevin Falcone
-
Kirk Kimmel
-
Leigh Hart
-
Lubomir Rintel
-
Makoto Sasaki
-
Michael G. Schwern
-
mikegrb
-
mschilli
-
nebulous
-
Neil Bowers
-
Nicolas R
-
PF4Public
-
sillymoose
-
sunnavy
-
Tim Vroom
-
Todd Rinaldo
-
unknown
-
Vincent Lequertier
-
Will Orr
-
Zak Wilcox
-
積丹尼 Dan Jacobson
NAME
Net::GitHub::V3::Query - Base Query role for Net::GitHub::V3
SYNOPSIS
package Net::GitHub::V3::XXX; use Moo; with 'Net::GitHub::V3::Query';
DESCRIPTION
set Authentication and call API
ATTRIBUTES
- login
- pass
- access_token
-
Either set access_token from OAuth or login:pass for Basic Authentication
- raw_string
- raw_response
- api_throttle
-
API throttling is enabled by default, set api_throttle to 0 to disable it.
- rate_limit
-
The maximum number of queries allowed per hour. 60 for anonymous users and 5,000 for authenticated users.
- rate_limit_remaining
-
The number of requests remaining in the current rate limit window.
- rate_limit_reset
-
The time the current rate limit resets in UTC epoch seconds.
- update_rate_limit
-
Query the /rate_limit API (for free) to update the cached values for rate_limit, rate_limit_remaining, rate_limit_reset
- last_page
-
Denotes the index of the last page in the pagination
- RaiseError
METHODS
- query
-
Refer Net::GitHub::V3
- next_page
-
Calls
query
withnext_url
. See Net::GitHub::V3 - prev_page
-
Calls
query
withprev_url
. See Net::GitHub::V3 - first_page
-
Calls
query
withfirst_url
. See Net::GitHub::V3 - last_page
-
Calls
query
withlast_url
. See Net::GitHub::V3 - set_next_page
-
Adjusts next_url to 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 provides an helper to iterate over APIs call using pagination, using the combo: has_next_page, next_page... for you.
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:
$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 a Net::GitHub::V3::ResultSet object.
- next($url)
-
Returns the next item for the query which started at $url, or undef if 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=1 to view the request URL
NG_DEBUG > 1 to view request/response string
AUTHOR & COPYRIGHT & LICENSE
Refer Net::GitHub
Module Install Instructions
To install Net::GitHub, copy and paste the appropriate command in to your terminal.
cpanm Net::GitHub
perl -MCPAN -e shell install Net::GitHub
For more information on module installation, please visit the detailed CPAN module installation guide.