.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Pithub 3pm" .TH Pithub 3pm "2021-02-15" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Pithub \- Github v3 API .SH "VERSION" .IX Header "VERSION" version 0.01036 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Pithub; \& use Data::Dumper; \& \& my $p = Pithub\->new; \& # my $p = Pithub\->new(utf8 => 0); # enable compatibility options for version 0.01029 or lower \& my $result = $p\->repos\->get( user => \*(Aqplu\*(Aq, repo => \*(AqPithub\*(Aq ); \& \& # $result\->content is either an arrayref or an hashref \& # depending on the API call that has been made \& printf "%s\en", $result\->content\->{html_url}; # prints https://github.com/plu/Pithub \& printf "%s\en", $result\->content\->{clone_url}; # prints https://github.com/plu/Pithub.git \& \& # if the result is an arrayref, you can use the result iterator \& my $result = $p\->repos\->list( user => \*(Aqplu\*(Aq ); \& while ( my $row = $result\->next ) { \& printf "%s\en", $row\->{name}; \& } \& \& # Connect to your local GitHub Enterprise instance \& my $p = Pithub\->new( \& api_uri => \*(Aqhttps://github.yourdomain.com/api/v3/\*(Aq \& ); \& \& # No need to provide user/repo to each module: \& my $pit = Pithub\->new( \& user => \*(Aqplu\*(Aq, \& repo => \*(Aqpithub\*(Aq, \& token => \*(Aqmy_oauth_token\*(Aq, \& ); \& \& $pit\->repos\->get; \& $pit\->repos\->commits\->list; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Pithub (\fBP\fRerl + G\fBithub\fR) provides a set of modules to access the Github v3 \s-1API\s0 in an object oriented way. There is also Net::GitHub which does the same for all the versions (v1, v2, v3) of the Github \s-1API.\s0 Pithub supports all \s-1API\s0 calls so far, but only for v3. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "search_api" .IX Subsection "search_api" .Vb 2 \& my $p = Pithub\->new({ search_api => \*(Aqv3\*(Aq }); \& my $search = $p\->search; # $search\->isa(\*(AqPithub::SearchV3\*(Aq); .Ve .PP This attribute allows the default for the \s-1API\s0 to use for searches to be specified. The two accepted values are \f(CW\*(C`v3\*(C'\fR and \f(CW\*(C`legacy\*(C'\fR. For compatibility reasons the default is \f(CW\*(C`legacy\*(C'\fR. .SH "METHODS" .IX Header "METHODS" .SS "events" .IX Subsection "events" Provides access to Pithub::Events. .SS "gists" .IX Subsection "gists" Provides access to Pithub::Gists. .SS "git_data" .IX Subsection "git_data" Provides access to Pithub::GitData. .SS "issues" .IX Subsection "issues" Provides access to Pithub::Issues. .SS "markdown" .IX Subsection "markdown" Provides access to Pithub::Markdown. .SS "orgs" .IX Subsection "orgs" Provides access to Pithub::Orgs. .SS "pull_requests" .IX Subsection "pull_requests" Provides access to Pithub::PullRequests. .SS "repos" .IX Subsection "repos" Provides access to Pithub::Repos. .SS "search" .IX Subsection "search" .Vb 3 \& my $legacy_search = $p\->search(search_api => \*(Aqlegacy\*(Aq); \& my $v3_search = $p\->search(search_api => \*(Aqv3\*(Aq); \& my $default_search = $p\->search; .Ve .PP Provides access to Pithub::Search and Pithub::SearchV3. When no \&\f(CW\*(C`search_api\*(C'\fR option is given, the value provided by the \f(CW\*(C`search_api\*(C'\fR attribute is used. .SS "users" .IX Subsection "users" Provides access to Pithub::Users. .SH "DOCUMENTATION" .IX Header "DOCUMENTATION" Quite a lot of the Pithub documentation has been taken directly from the great \s-1API\s0 documentation at Github . Please also read the documentation there, since it might be more complete and more up-to-date. .PP Pithub::Base contains documentation for attributes inherited by all Pithub modules. .SH "WARNING" .IX Header "WARNING" Pithub as well as the Github v3 \s-1API\s0 are still under development. So there might be things broken on both sides. Besides that it's possible that the \s-1API\s0 will change. This applies to Pithub itself as well as the Github v3 \s-1API\s0 . .SH "CONTRIBUTE" .IX Header "CONTRIBUTE" This module is hosted on Github , so feel free to fork it and send pull requests. There are two different kinds of test suites, one is just checking the \s-1HTTP\s0 requests that are created by the method calls, without actually sending them. The second one is sending real requests to the Github \s-1API.\s0 If you want to contribute to this project, I highly recommend to run the live tests on a test account, because it will generate a lof of activity. .SH "MODULES" .IX Header "MODULES" There are different ways of using the Pithub library. You can either use the main module Pithub to get access to all other modules, like Pithub::Repos for example. Or you can use Pithub::Repos directly and create an instance of it. All modules accept the same attributes, either in the constructor or later by calling the setters. .PP Besides that there are other modules involved. Every method call which maps directly to a Github \s-1API\s0 call returns a Pithub::Result object. This contains everything interesting about the response returned from the \s-1API\s0 call. .PP Pithub::Base might be interesting for two reasons: .IP "\(bu" 4 The list of attributes which all modules accept. .IP "\(bu" 4 The request method: In case Github adds a new \s-1API\s0 call which is not supported yet by Pithub the request method can be used directly to perform this new \s-1API\s0 call, there's some documentation on how to use it. .RS 4 .IP "\(bu" 4 Pithub::Events .Sp See also: .Sp .Vb 2 \& my $events = Pithub\->new\->events; \& my $events = Pithub::Events\->new; .Ve .IP "\(bu" 4 Pithub::Gists .Sp See also: .Sp .Vb 2 \& my $gists = Pithub\->new\->gists; \& my $gists = Pithub::Gists\->new; .Ve .RS 4 .IP "\(bu" 4 Pithub::Gists::Comments .Sp See also: .Sp .Vb 3 \& my $comments = Pithub\->new\->gists\->comments; \& my $comments = Pithub::Gists\->new\->comments; \& my $comments = Pithub::Gists::Comments\->new; .Ve .RE .RS 4 .RE .RE .RS 4 .IP "\(bu" 4 Pithub::GitData .Sp See also: .Sp .Vb 2 \& my $git_data = Pithub\->new\->git_data; \& my $git_data = Pithub::GitData\->new; .Ve .RS 4 .IP "\(bu" 4 Pithub::GitData::Blobs .Sp See also: .Sp .Vb 3 \& my $blobs = Pithub\->new\->git_data\->blobs; \& my $blobs = Pithub::GitData\->new\->blobs; \& my $blobs = Pithub::GitData::Blobs\->new; .Ve .IP "\(bu" 4 Pithub::GitData::Commits .Sp See also: .Sp .Vb 3 \& my $commits = Pithub\->new\->git_data\->commits; \& my $commits = Pithub::GitData\->new\->commits; \& my $commits = Pithub::GitData::Commits\->new; .Ve .IP "\(bu" 4 Pithub::GitData::References .Sp See also: .Sp .Vb 3 \& my $references = Pithub\->new\->git_data\->references; \& my $references = Pithub::GitData\->new\->references; \& my $references = Pithub::GitData::References\->new; .Ve .IP "\(bu" 4 Pithub::GitData::Tags .Sp See also: .Sp .Vb 3 \& my $tags = Pithub\->new\->git_data\->tags; \& my $tags = Pithub::GitData\->new\->tags; \& my $tags = Pithub::GitData::Tags\->new; .Ve .IP "\(bu" 4 Pithub::GitData::Trees .Sp See also: .Sp .Vb 3 \& my $trees = Pithub\->new\->git_data\->trees; \& my $trees = Pithub::GitData\->new\->trees; \& my $trees = Pithub::GitData::Trees\->new; .Ve .RE .RS 4 .RE .RE .RS 4 .IP "\(bu" 4 Pithub::Issues .Sp See also: .Sp .Vb 2 \& my $issues = Pithub\->new\->issues; \& my $issues = Pithub::Issues\->new; .Ve .RS 4 .IP "\(bu" 4 Pithub::Issues::Assignees .Sp See also: .Sp .Vb 3 \& my $assignees = Pithub\->new\->issues\->assignees; \& my $assignees = Pithub::Issues\->new\->assignees; \& my $assignees = Pithub::Issues::Assignees\->new; .Ve .IP "\(bu" 4 Pithub::Issues::Comments .Sp See also: .Sp .Vb 3 \& my $comments = Pithub\->new\->issues\->comments; \& my $comments = Pithub::Issues\->new\->comments; \& my $comments = Pithub::Issues::Comments\->new; .Ve .IP "\(bu" 4 Pithub::Issues::Events .Sp See also: .Sp .Vb 3 \& my $events = Pithub\->new\->issues\->events; \& my $events = Pithub::Issues\->new\->events; \& my $events = Pithub::Issues::Events\->new; .Ve .IP "\(bu" 4 Pithub::Issues::Labels .Sp See also: .Sp .Vb 3 \& my $labels = Pithub\->new\->issues\->labels; \& my $labels = Pithub::Issues\->new\->labels; \& my $labels = Pithub::Issues::Labels\->new; .Ve .IP "\(bu" 4 Pithub::Issues::Milestones .Sp See also: .Sp .Vb 3 \& my $milestones = Pithub\->new\->issues\->milestones; \& my $milestones = Pithub::Issues\->new\->milestones; \& my $milestones = Pithub::Issues::Milestones\->new; .Ve .RE .RS 4 .RE .RE .RS 4 .IP "\(bu" 4 Pithub::Orgs .Sp See also: .Sp .Vb 2 \& my $orgs = Pithub\->new\->orgs; \& my $orgs = Pithub::Orgs\->new; .Ve .RS 4 .IP "\(bu" 4 Pithub::Orgs::Members .Sp See also: .Sp .Vb 3 \& my $members = Pithub\->new\->orgs\->members; \& my $members = Pithub::Orgs\->new\->members; \& my $members = Pithub::Orgs::Members\->new; .Ve .IP "\(bu" 4 Pithub::Orgs::Teams .Sp See also: .Sp .Vb 3 \& my $teams = Pithub\->new\->orgs\->teams; \& my $teams = Pithub::Orgs\->new\->teams; \& my $teams = Pithub::Orgs::Teams\->new; .Ve .RE .RS 4 .RE .RE .RS 4 .IP "\(bu" 4 Pithub::PullRequests .Sp See also: .Sp .Vb 2 \& my $pull_requests = Pithub\->new\->pull_requests; \& my $pull_requests = Pithub::PullRequests\->new; .Ve .RS 4 .IP "\(bu" 4 Pithub::PullRequests::Comments .Sp See also: .Sp .Vb 3 \& my $comments = Pithub\->new\->pull_requests\->comments; \& my $comments = Pithub::PullRequests\->new\->comments; \& my $comments = Pithub::PullRequests::Comments\->new; .Ve .IP "\(bu" 4 Pithub::PullRequests::Reviewers .Sp See also: .Sp .Vb 3 \& my $reviewers = Pithub\->new\->pull_requests\->reviewers; \& my $reviewers = Pithub::PullRequests\->new\->reviewers; \& my $reviewers = Pithub::PullRequests::Reviewers\->new; .Ve .RE .RS 4 .RE .RE .RS 4 .IP "\(bu" 4 Pithub::Repos .Sp See also: .Sp .Vb 2 \& my $repos = Pithub\->new\->repos; \& my $repos = Pithub::Repos\->new; .Ve .RS 4 .IP "\(bu" 4 Pithub::Repos::Collaborators .Sp See also: .Sp .Vb 3 \& my $collaborators = Pithub\->new\->repos\->collaborators; \& my $collaborators = Pithub::Repos\->new\->collaborators; \& my $collaborators = Pithub::Repos::Collaborators\->new; .Ve .IP "\(bu" 4 Pithub::Repos::Commits .Sp See also: .Sp .Vb 3 \& my $commits = Pithub\->new\->repos\->commits; \& my $commits = Pithub::Repos\->new\->commits; \& my $commits = Pithub::Repos::Commits\->new; .Ve .IP "\(bu" 4 Pithub::Repos::Contents .Sp See also: .Sp .Vb 3 \& my $contents = Pithub\->new\->repos\->contents; \& my $contents = Pithub::Repos\->new\->contents; \& my $contents = Pithub::Repos::Contents\->new; .Ve .IP "\(bu" 4 Pithub::Repos::Downloads .Sp Github says: The Downloads \s-1API\s0 (described below) was deprecated on December 11, 2012. It will be removed at a future date. We recommend using Pithub::Repos::Releases instead. .Sp See also: .Sp .Vb 3 \& my $downloads = Pithub\->new\->repos\->downloads; \& my $downloads = Pithub::Repos\->new\->downloads; \& my $downloads = Pithub::Repos::Downloads\->new; .Ve .IP "\(bu" 4 Pithub::Repos::Forks .Sp See also: .Sp .Vb 3 \& my $forks = Pithub\->new\->repos\->forks; \& my $forks = Pithub::Repos\->new\->forks; \& my $forks = Pithub::Repos::Forks\->new; .Ve .IP "\(bu" 4 Pithub::Repos::Keys .Sp See also: .Sp .Vb 3 \& my $keys = Pithub\->new\->repos\->keys; \& my $keys = Pithub::Repos\->new\->keys; \& my $keys = Pithub::Repos::Keys\->new; .Ve .IP "\(bu" 4 Pithub::Repos::Releases .Sp See also: .Sp .Vb 3 \& my $releases = Pithub\->new\->repos\->releases; \& my $releases = Pithub::Repos\->new\->releases; \& my $releases = Pithub::Repos::Releases\->new; .Ve .RS 4 .IP "\(bu" 4 Pithub::Repos::Releases::Assets .Sp See also: .Sp .Vb 4 \& my $assets = Pithub\->new\->repos\->releases\->assets; \& my $assets = Pithub::Repos\->new\->releases\->assets; \& my $assets = Pithub::Repos::Releases\->new\->assets; \& my $assets = Pithub::Repos::Releases::Assets\->new; .Ve .RE .RS 4 .RE .IP "\(bu" 4 Pithub::Repos::Stats .Sp See also: .Sp .Vb 3 \& my $watching = Pithub\->new\->repos\->stats; \& my $watching = Pithub::Repos\->new\->stats; \& my $watching = Pithub::Repos::Stats\->new; .Ve .IP "\(bu" 4 Pithub::Repos::Statuses .Sp See also: .Sp .Vb 3 \& my $watching = Pithub\->new\->repos\->statuses; \& my $watching = Pithub::Repos\->new\->statuses; \& my $watching = Pithub::Repos::Statuses\->new; .Ve .IP "\(bu" 4 Pithub::Repos::Watching .Sp See also: .Sp .Vb 3 \& my $watching = Pithub\->new\->repos\->watching; \& my $watching = Pithub::Repos\->new\->watching; \& my $watching = Pithub::Repos::Watching\->new; .Ve .RE .RS 4 .RE .RE .RS 4 .IP "\(bu" 4 Pithub::Users .Sp See also: .Sp .Vb 2 \& my $users = Pithub\->new\->users; \& my $users = Pithub::Users\->new; .Ve .RS 4 .IP "\(bu" 4 Pithub::Users::Emails .Sp See also: .Sp .Vb 3 \& my $emails = Pithub\->new\->users\->emails; \& my $emails = Pithub::Users\->new\->emails; \& my $emails = Pithub::Users::Emails\->new; .Ve .IP "\(bu" 4 Pithub::Users::Followers .Sp See also: .Sp .Vb 3 \& my $followers = Pithub\->new\->users\->followers; \& my $followers = Pithub::Users\->new\->followers; \& my $followers = Pithub::Users::Followers\->new; .Ve .IP "\(bu" 4 Pithub::Users::Keys .Sp See also: .Sp .Vb 3 \& my $keys = Pithub\->new\->users\->keys; \& my $keys = Pithub::Users\->new\->keys; \& my $keys = Pithub::Users::Keys\->new; .Ve .RE .RS 4 .RE .RE .RS 4 .RE .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" .IP "\(bu" 4 Andreas Marienborg .IP "\(bu" 4 Alessandro Ghedini .IP "\(bu" 4 Michael G Schwern .SH "AUTHOR" .IX Header "AUTHOR" Johannes Plunien .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2011\-2019 by Johannes Plunien. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.