---
name: "Net::GitHub::V3::Query"
section: "3pm"
platform: "linux"
package: "libnet-github-perl"
version: "1.05-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Net::GitHub::V3::Query"
---

# Net::GitHub::V3::Query(3pm)

Base Query role for Net::GitHub::V3

## 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

  \<http://developer.github.com/\>

- 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"` with `"next_url"`. See Net::GitHub::V3

- prev\_page

  Calls `"query"` with `"prev_url"`. See Net::GitHub::V3

- first\_page

  Calls `"query"` with `"first_url"`. See Net::GitHub::V3

- last\_page

  Calls `"query"` with `"last_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
