.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::GitHub::V3::Repos 3pm" .TH Net::GitHub::V3::Repos 3pm "2012-03-22" "perl v5.14.2" "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" Net::GitHub::V3::Repos \- GitHub Repos API .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::GitHub::V3; \& \& my $gh = Net::GitHub::V3\->new; # read L to set right authentication info \& my $repos = $gh\->repos; \& \& # set :user/:repo for simple calls \& $repos\->set_default_user_repo(\*(Aqfayland\*(Aq, \*(Aqperl\-net\-github\*(Aq); \& my @contributors = $repos\->contributors; # don\*(Aqt need pass user and repos .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .SS "\s-1METHODS\s0" .IX Subsection "METHODS" \fIRepos\fR .IX Subsection "Repos" .PP .IP "list" 4 .IX Item "list" .PD 0 .IP "list_user" 4 .IX Item "list_user" .IP "list_org" 4 .IX Item "list_org" .PD .Vb 6 \& my @rp = $repos\->list; # or my $rp = $repos\->list; \& my @rp = $repos\->list(\*(Aqprivate\*(Aq); \& my @rp = $repos\->list_user(\*(Aqc9s\*(Aq); \& my @rp = $repos\->list_user(\*(Aqc9s\*(Aq, \*(Aqmember\*(Aq); \& my @rp = $repos\->list_org(\*(Aqperlchina\*(Aq); \& my @rp = $repos\->list_org(\*(Aqperlchina\*(Aq, \*(Aqpublic\*(Aq); .Ve .IP "create" 4 .IX Item "create" .Vb 10 \& # create for yourself \& my $rp = $repos\->create( { \& "name" => "Hello\-World", \& "description" => "This is your first repo", \& "homepage" => "https://github.com" \& } ); \& # create for organization \& my $rp = $repos\->create( { \& "org" => "perlchina", ## the organization \& "name" => "Hello\-World", \& "description" => "This is your first repo", \& "homepage" => "https://github.com" \& } ); .Ve .IP "get" 4 .IX Item "get" .Vb 1 \& my $rp = $repos\->get(\*(Aqfayland\*(Aq, \*(Aqperl\-net\-github\*(Aq); .Ve .PP \&\fBTo ease the keyboard, we provied two ways to call any method which starts with :user/:repo\fR .PP 1. \s-1SET\s0 user/repos before call methods below .PP .Vb 3 \& $gh\->set_default_user_repo(\*(Aqfayland\*(Aq, \*(Aqperl\-net\-github\*(Aq); # take effects for all $gh\-> \& $repos\->set_default_user_repo(\*(Aqfayland\*(Aq, \*(Aqperl\-net\-github\*(Aq); # only take effect to $gh\->repos \& my @contributors = $repos\->contributors; .Ve .PP 2. If it is just for once, we can pass :user, :repo before any arguments .PP .Vb 1 \& my @contributors = $repos\->contributors($user, $repo); .Ve .IP "update" 4 .IX Item "update" .Vb 1 \& $repos\->update({ homepage => \*(Aqhttps://metacpan.org/module/Net::GitHub\*(Aq }); .Ve .IP "contributors" 4 .IX Item "contributors" .PD 0 .IP "languages" 4 .IX Item "languages" .IP "teams" 4 .IX Item "teams" .IP "tags" 4 .IX Item "tags" .IP "contributors" 4 .IX Item "contributors" .PD .Vb 5 \& my @contributors = $repos\->contributors; \& my @languages = $repos\->languages; \& my @teams = $repos\->teams; \& my @tags = $repos\->tags; \& my @branches = $repos\->branches; .Ve .PP \fIRepo Collaborators \s-1API\s0\fR .IX Subsection "Repo Collaborators API" .PP .IP "collaborators" 4 .IX Item "collaborators" .PD 0 .IP "is_collaborator" 4 .IX Item "is_collaborator" .IP "add_collaborator" 4 .IX Item "add_collaborator" .IP "delete_collaborator" 4 .IX Item "delete_collaborator" .PD .Vb 4 \& my @collaborators = $repos\->collaborators; \& my $is = $repos\->is_collaborator(\*(Aqfayland\*(Aq); \& $repos\->add_collaborator(\*(Aqfayland\*(Aq); \& $repos\->delete_collaborator(\*(Aqfayland\*(Aq); .Ve .PP \fICommits \s-1API\s0\fR .IX Subsection "Commits API" .PP .IP "commits" 4 .IX Item "commits" .PD 0 .IP "commit" 4 .IX Item "commit" .PD .Vb 2 \& my @commits = $repos\->commits; \& my $commit = $repos\->commit($sha); .Ve .IP "comments" 4 .IX Item "comments" .PD 0 .IP "commit_comments" 4 .IX Item "commit_comments" .IP "create_comment" 4 .IX Item "create_comment" .IP "comment" 4 .IX Item "comment" .IP "update_comment" 4 .IX Item "update_comment" .IP "delete_comment" 4 .IX Item "delete_comment" .PD .Vb 10 \& my @comments = $repos\->comments; \& my @comments = $repos\->commit_comments($sha); \& my $comment = $repos\->create_comment($sha, { \& "body" => "Nice change", \& "commit_id" => "6dcb09b5b57875f334f61aebed695e2e4193db5e", \& "line" => 1, \& "path" => "file1.txt", \& "position" => 4 \& }); \& my $comment = $repos\->comment($comment_id); \& my $comment = $repos\->update_comment($comment_id, { \& "body" => "Nice change" \& }); \& my $st = $repos\->delete_comment($comment_id); .Ve .IP "compare_commits" 4 .IX Item "compare_commits" .Vb 1 \& my $diffs = $repos\->compare_commits($base, $head); .Ve .PP \fIDownloads\fR .IX Subsection "Downloads" .PP .IP "downloads" 4 .IX Item "downloads" .PD 0 .IP "download" 4 .IX Item "download" .IP "delete_download" 4 .IX Item "delete_download" .PD .Vb 3 \& my @downloads = $repos\->downloads; \& my $download = $repos\->download($download_id); \& my $st = $repos\->delete_download($download_id); .Ve .IP "create_download" 4 .IX Item "create_download" .PD 0 .IP "upload_download" 4 .IX Item "upload_download" .PD .Vb 7 \& my $download = $repos\->create_download( { \& "name" => "new_file.jpg", \& "size" => 114034, \& "description" => "Latest release", \& "content_type" => "text/plain" \& } ); \& my $st = $repos\->upload_download($download, "/path/to/new_file.jpg"); \& \& # or batch it \& my $st = $repos\->create_download( { \& "name" => "new_file.jpg", \& "size" => 114034, \& "description" => "Latest release", \& "content_type" => "text/plain", \& file => \*(Aq/path/to/new_file.jpg\*(Aq, \& } ); .Ve .PP \fIForks \s-1API\s0\fR .IX Subsection "Forks API" .PP .IP "forks" 4 .IX Item "forks" .PD 0 .IP "create_fork" 4 .IX Item "create_fork" .PD .Vb 3 \& my @forks = $repos\->forks; \& my $fork = $repos\->create_fork; \& my $fork = $repos\->create_fork($org); .Ve .PP \fIRepos Deploy Keys \s-1API\s0\fR .IX Subsection "Repos Deploy Keys API" .PP .IP "keys" 4 .IX Item "keys" .PD 0 .IP "key" 4 .IX Item "key" .IP "create_key" 4 .IX Item "create_key" .IP "update_key" 4 .IX Item "update_key" .IP "delete_key" 4 .IX Item "delete_key" .PD .Vb 11 \& my @keys = $repos\->keys; \& my $key = $repos\->key($key_id); # get key \& $repos\->create_key( { \& title => \*(Aqtitle\*(Aq, \& key => $key \& } ); \& $repos\->update_key($key_id, { \& title => $title, \& key => $key \& }); \& $repos\->delete_key($key_id); .Ve .PP \fIRepo Watching \s-1API\s0\fR .IX Subsection "Repo Watching API" .PP .IP "watchers" 4 .IX Item "watchers" .Vb 1 \& my @watchers = $repos\->watchers; .Ve .IP "watched" 4 .IX Item "watched" .Vb 2 \& my @repos = $repos\->watched; # what I watched \& my @repos = $repos\->watched(\*(Aqc9s\*(Aq); .Ve .IP "is_watching" 4 .IX Item "is_watching" .Vb 2 \& my $is_watching = $repos\->is_watching; \& my $is_watching = $repos\->is_watching(\*(Aqfayland\*(Aq, \*(Aqperl\-net\-github\*(Aq); .Ve .IP "watch" 4 .IX Item "watch" .PD 0 .IP "unwatch" 4 .IX Item "unwatch" .PD .Vb 4 \& my $st = $repos\->watch(); \& my $st = $repos\->watch(\*(Aqfayland\*(Aq, \*(Aqperl\-net\-github\*(Aq); \& my $st = $repos\->unwatch(); \& my $st = $repos\->unwatch(\*(Aqfayland\*(Aq, \*(Aqperl\-net\-github\*(Aq); .Ve .PP \fIHooks \s-1API\s0\fR .IX Subsection "Hooks API" .PP .IP "hooks" 4 .IX Item "hooks" .PD 0 .IP "hook" 4 .IX Item "hook" .IP "create_hook" 4 .IX Item "create_hook" .IP "update_hook" 4 .IX Item "update_hook" .IP "test_hook" 4 .IX Item "test_hook" .IP "delete_hook" 4 .IX Item "delete_hook" .PD .Vb 6 \& my @hooks = $repos\->hooks; \& my $hook = $repos\->hook($hook_id); \& my $hook = $repos\->create_hook($hook_hash); \& my $hook = $repos\->update_hook($hook_id, $new_hook_hash); \& my $st = $repos\->test_hook($hook_id); \& my $st = $repos\->delete_hook($hook_id); .Ve .SH "AUTHOR & COPYRIGHT & LICENSE" .IX Header "AUTHOR & COPYRIGHT & LICENSE" Refer Net::GitHub