1Net::GitHub::V3::Query(U3s)er Contributed Perl DocumentatNieotn::GitHub::V3::Query(3)
2
3
4
6 Net::GitHub::V3::Query - Base Query role for Net::GitHub::V3
7
9 package Net::GitHub::V3::XXX;
10
11 use Moo;
12 with 'Net::GitHub::V3::Query';
13
15 set Authentication and call API
16
17 ATTRIBUTES
18 login
19 pass
20 access_token
21 Either set access_token from OAuth or login:pass for Basic
22 Authentication
23
24 <http://developer.github.com/>
25
26 raw_string
27 raw_response
28 api_throttle
29 API throttling is enabled by default, set api_throttle to 0 to
30 disable it.
31
32 rate_limit
33 The maximum number of queries allowed per hour. 60 for anonymous
34 users and 5,000 for authenticated users.
35
36 rate_limit_remaining
37 The number of requests remaining in the current rate limit window.
38
39 rate_limit_reset
40 The time the current rate limit resets in UTC epoch seconds.
41
42 update_rate_limit
43 Query the /rate_limit API (for free) to update the cached values
44 for rate_limit, rate_limit_remaining, rate_limit_reset
45
46 last_page
47 Denotes the index of the last page in the pagination
48
49 RaiseError
50
51 METHODS
52 query
53 Refer Net::GitHub::V3
54
55 next_page
56 Calls "query" with "next_url". See Net::GitHub::V3
57
58 prev_page
59 Calls "query" with "prev_url". See Net::GitHub::V3
60
61 first_page
62 Calls "query" with "first_url". See Net::GitHub::V3
63
64 last_page
65 Calls "query" with "last_url". See Net::GitHub::V3
66
67 set_next_page
68 Adjusts next_url to be a new url in the pagination space I.E. you
69 are jumping to a new index in the pagination
70
71 iterate($method_name, $arguments, $callback)
72 This provides an helper to iterate over APIs call using pagination,
73 using the combo: has_next_page, next_page... for you.
74
75 The arguments can be either a scalar if the function is using a
76 single argument, an ArrayRef when the function is using multiple
77 arguments. You can also use one HashRef for functions supporting
78 named parameters.
79
80 The callback function is called with a single item. The return
81 value of the callback function can be used to stop the iteration
82 when returning a 'false' value.
83
84 In common cases, you want to return a true value: '1'.
85
86 Sample usage:
87
88 $gh->org->iterate( 'repos', 'OrganizationName', sub {
89 my $item = shift;
90
91 print "Repo Name is $item->{name}"
92
93 return 1; # if you want to continue iterating
94 return; # use a false value when you want to interrupt the iteration
95 } );
96
97 result_sets
98 For internal use by the item-per-item pagination: This is a store
99 of the state(s) for the pagination. Each entry maps the initial
100 URL of a GitHub query to a Net::GitHub::V3::ResultSet object.
101
102 next($url)
103 Returns the next item for the query which started at $url, or undef
104 if there are no more items.
105
106 close($url)
107 Terminates the item-per-item pagination for the query which started
108 at $url.
109
110 NG_DEBUG
111
112 export NG_DEBUG=1 to view the request URL
113
114 NG_DEBUG > 1 to view request/response string
115
117 Refer Net::GitHub
118
119
120
121perl v5.36.0 2023-01-20 Net::GitHub::V3::Query(3)