| 1 | package WWW::Gitea::API::Issues; | ||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Gitea issues API (issues and issue comments) | ||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use WWW::Gitea::Issue; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | use WWW::Gitea::Comment; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use WWW::Gitea::Attachment; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||
| 13 | 5 | has client => ( | |||||||||||||||||||||||||||||||||||
| 14 | is => 'ro', | ||||||||||||||||||||||||||||||||||||
| 15 | required => 1, | ||||||||||||||||||||||||||||||||||||
| 16 | weak_ref => 1, | ||||||||||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||
| 20 | has openapi_operations => ( | ||||||||||||||||||||||||||||||||||||
| 21 | is => 'lazy', | ||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | builder => sub { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_build_openapi_operations: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 23 | return { | ||||||||||||||||||||||||||||||||||||
| 24 | 1 | 'issues.list' => { method => 'GET', path => '/repos/{owner}/{repo}/issues' }, | |||||||||||||||||||||||||||||||||||
| 25 | 'issues.create' => { method => 'POST', path => '/repos/{owner}/{repo}/issues' }, | ||||||||||||||||||||||||||||||||||||
| 26 | 'issues.get' => { method => 'GET', path => '/repos/{owner}/{repo}/issues/{index}' }, | ||||||||||||||||||||||||||||||||||||
| 27 | 'issues.edit' => { method => 'PATCH', path => '/repos/{owner}/{repo}/issues/{index}' }, | ||||||||||||||||||||||||||||||||||||
| 28 | 'issues.search' => { method => 'GET', path => '/repos/issues/search' }, | ||||||||||||||||||||||||||||||||||||
| 29 | 'issues.list_comments' => { method => 'GET', path => '/repos/{owner}/{repo}/issues/{index}/comments' }, | ||||||||||||||||||||||||||||||||||||
| 30 | 'issues.create_comment' => { method => 'POST', path => '/repos/{owner}/{repo}/issues/{index}/comments' }, | ||||||||||||||||||||||||||||||||||||
| 31 | 'issues.list_attachments' => { method => 'GET', path => '/repos/{owner}/{repo}/issues/{index}/assets' }, | ||||||||||||||||||||||||||||||||||||
| 32 | 'issues.create_attachment' => { method => 'POST', path => '/repos/{owner}/{repo}/issues/{index}/assets' }, | ||||||||||||||||||||||||||||||||||||
| 33 | 'issues.get_attachment' => { method => 'GET', path => '/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}' }, | ||||||||||||||||||||||||||||||||||||
| 34 | 'issues.edit_attachment' => { method => 'PATCH', path => '/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}' }, | ||||||||||||||||||||||||||||||||||||
| 35 | 'issues.delete_attachment' => { method => 'DELETE', path => '/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}' }, | ||||||||||||||||||||||||||||||||||||
| 36 | 'issues.list_comment_attachments' => { method => 'GET', path => '/repos/{owner}/{repo}/issues/comments/{id}/assets' }, | ||||||||||||||||||||||||||||||||||||
| 37 | 'issues.create_comment_attachment' => { method => 'POST', path => '/repos/{owner}/{repo}/issues/comments/{id}/assets' }, | ||||||||||||||||||||||||||||||||||||
| 38 | 'issues.get_comment_attachment' => { method => 'GET', path => '/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}' }, | ||||||||||||||||||||||||||||||||||||
| 39 | 'issues.edit_comment_attachment' => { method => 'PATCH', path => '/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}' }, | ||||||||||||||||||||||||||||||||||||
| 40 | 'issues.delete_comment_attachment' => { method => 'DELETE', path => '/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}' }, | ||||||||||||||||||||||||||||||||||||
| 41 | }; | ||||||||||||||||||||||||||||||||||||
| 42 | }, | ||||||||||||||||||||||||||||||||||||
| 43 | 5 | ); | |||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||
| 46 | 5 | with 'WWW::Gitea::Role::OpenAPI'; | |||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | sub _wrap { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_wrap: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||
| 49 | 0 | my ($self, $data, $owner, $repo) = @_; | |||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | return WWW::Gitea::Issue->new( | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||
| 51 | client => $self->client, | ||||||||||||||||||||||||||||||||||||
| 52 | data => $data, | ||||||||||||||||||||||||||||||||||||
| 53 | (defined $owner ? (owner => $owner) : ()), | ||||||||||||||||||||||||||||||||||||
| 54 | (defined $repo ? (repo => $repo) : ()), | ||||||||||||||||||||||||||||||||||||
| 55 | ); | ||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||
| 58 | 1 | ▶ | sub list { | ||||||||||||||||||||||||||||||||||
|
Subroutine
list: called CC=4 SCAR=15.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 59 | 1 | my ($self, $owner, $repo, %query) = @_; | |||||||||||||||||||||||||||||||||||
| 60 | 1 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 61 | 1 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 62 | 1 | my $data = $self->call_operation('issues.list', | |||||||||||||||||||||||||||||||||||
| 63 | path => { owner => $owner, repo => $repo }, query => \%query); | ||||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | return [ map { $self->_wrap($_, $owner, $repo) } @{ $data || [] } ]; | ||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$data || []
MC/DC0%0/1
$data || []
$data
Truth table50%1/2
A
A= $data
| |||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | sub create { | ||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 69 | 0 | my ($self, $owner, $repo, %args) = @_; | |||||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | croak 'title required' unless defined $args{title}; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 73 | 0 | my $data = $self->call_operation('issues.create', | |||||||||||||||||||||||||||||||||||
| 74 | path => { owner => $owner, repo => $repo }, body => \%args); | ||||||||||||||||||||||||||||||||||||
| 75 | 0 | return $self->_wrap($data, $owner, $repo); | |||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | sub get { | ||||||||||||||||||||||||||||||||||
|
Subroutine
get: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 80 | 0 | my ($self, $owner, $repo, $index) = @_; | |||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 84 | 0 | my $data = $self->call_operation('issues.get', | |||||||||||||||||||||||||||||||||||
| 85 | path => { owner => $owner, repo => $repo, index => $index }); | ||||||||||||||||||||||||||||||||||||
| 86 | 0 | return $self->_wrap($data, $owner, $repo); | |||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | sub edit { | ||||||||||||||||||||||||||||||||||
|
Subroutine
edit: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 91 | 0 | my ($self, $owner, $repo, $index, %args) = @_; | |||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 95 | 0 | my $data = $self->call_operation('issues.edit', | |||||||||||||||||||||||||||||||||||
| 96 | path => { owner => $owner, repo => $repo, index => $index }, | ||||||||||||||||||||||||||||||||||||
| 97 | body => \%args); | ||||||||||||||||||||||||||||||||||||
| 98 | 0 | return $self->_wrap($data, $owner, $repo); | |||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | sub search { | ||||||||||||||||||||||||||||||||||
|
Subroutine
search: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 103 | 0 | my ($self, %query) = @_; | |||||||||||||||||||||||||||||||||||
| 104 | 0 | my $data = $self->call_operation('issues.search', query => \%query); | |||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | return [ map { $self->_wrap($_) } @{ $data || [] } ]; | ||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$data || []
MC/DC0%0/1
$data || []
$data
Truth table0%0/2
A
A= $data
| |||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||
| 109 | 1 | ▶ | sub comments { | ||||||||||||||||||||||||||||||||||
|
Subroutine
comments: called CC=5 SCAR=17.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 110 | 1 | my ($self, $owner, $repo, $index, %query) = @_; | |||||||||||||||||||||||||||||||||||
| 111 | 1 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 112 | 1 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 113 | 1 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 114 | 1 | my $data = $self->call_operation('issues.list_comments', | |||||||||||||||||||||||||||||||||||
| 115 | path => { owner => $owner, repo => $repo, index => $index }, query => \%query); | ||||||||||||||||||||||||||||||||||||
| 116 | return [ map { | ||||||||||||||||||||||||||||||||||||
| 117 | 0 | WWW::Gitea::Comment->new(client => $self->client, data => $_) | |||||||||||||||||||||||||||||||||||
| 118 | 1 | ▶ | } @{ $data || [] } ]; | ||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$data || []
MC/DC0%0/1
$data || []
$data
Truth table50%1/2
A
A= $data
| |||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | sub create_comment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
create_comment: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 123 | 0 | my ($self, $owner, $repo, $index, $body) = @_; | |||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | croak 'body required' unless defined $body; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 128 | 0 | my $data = $self->call_operation('issues.create_comment', | |||||||||||||||||||||||||||||||||||
| 129 | path => { owner => $owner, repo => $repo, index => $index }, | ||||||||||||||||||||||||||||||||||||
| 130 | body => { body => $body }); | ||||||||||||||||||||||||||||||||||||
| 131 | 0 | return WWW::Gitea::Comment->new(client => $self->client, data => $data); | |||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | sub _wrap_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_wrap_attachment: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||
| 136 | 0 | my ($self, $data) = @_; | |||||||||||||||||||||||||||||||||||
| 137 | 0 | return WWW::Gitea::Attachment->new(client => $self->client, data => $data); | |||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||
| 140 | 0 | ▶ | sub _build_upload { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_build_upload: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||
| 141 | 0 | my ($self, %args) = @_; | |||||||||||||||||||||||||||||||||||
| 142 | croak 'file or content required' | ||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | unless defined $args{file} || defined $args{content}; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $args{"file"} or defined $args{"content"}
MC/DC0%0/2
defined $args{"file"} or defined $args{"content"}
defined $args{"file"}
defined $args{"content"}
Truth table0%0/3
A or B
A= defined $args{"file"}B= defined $args{"content"}
| |||||||||||||||||||||||||||||||||||||
| 144 | return defined $args{file} | ||||||||||||||||||||||||||||||||||||
| 145 | ? { field => 'attachment', file => $args{file}, | ||||||||||||||||||||||||||||||||||||
| 146 | (defined $args{filename} ? (filename => $args{filename}) : ()) } | ||||||||||||||||||||||||||||||||||||
| 147 | : { field => 'attachment', content => $args{content}, | ||||||||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | filename => ($args{filename} // $args{name} // 'attachment') }; | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/5
($args{"filename"} // $args{"name"}) // "attachment"
$args{"filename"} // $args{"name"}
MC/DC0%0/2
($args{"filename"} // $args{"name"}) // "attachment"
$args{"filename"}
$args{"name"}
Truth table0%0/3
A // B
A= $args{"filename"}B= $args{"name"}
| |||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||
| 151 | # --- issue attachments ---------------------------------------------------- | ||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | sub attachments { | ||||||||||||||||||||||||||||||||||
|
Subroutine
attachments: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 154 | 0 | my ($self, $owner, $repo, $index, %query) = @_; | |||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 158 | 0 | my $data = $self->call_operation('issues.list_attachments', | |||||||||||||||||||||||||||||||||||
| 159 | path => { owner => $owner, repo => $repo, index => $index }, | ||||||||||||||||||||||||||||||||||||
| 160 | query => \%query); | ||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | return [ map { $self->_wrap_attachment($_) } @{ $data || [] } ]; | ||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$data || []
MC/DC0%0/1
$data || []
$data
Truth table0%0/2
A
A= $data
| |||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | sub create_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
create_attachment: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 166 | 0 | my ($self, $owner, $repo, $index, %args) = @_; | |||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 170 | 0 | my $upload = $self->_build_upload(%args); | |||||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | my %query = defined $args{name} ? (name => $args{name}) : (); | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | my $data = $self->call_operation('issues.create_attachment', | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 173 | path => { owner => $owner, repo => $repo, index => $index }, | ||||||||||||||||||||||||||||||||||||
| 174 | (%query ? (query => \%query) : ()), | ||||||||||||||||||||||||||||||||||||
| 175 | upload => $upload); | ||||||||||||||||||||||||||||||||||||
| 176 | 0 | return $self->_wrap_attachment($data); | |||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | sub get_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
get_attachment: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 181 | 0 | my ($self, $owner, $repo, $index, $attachment_id) = @_; | |||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 183 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 184 | 0 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | croak 'attachment_id required' unless defined $attachment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 186 | 0 | my $data = $self->call_operation('issues.get_attachment', | |||||||||||||||||||||||||||||||||||
| 187 | path => { owner => $owner, repo => $repo, index => $index, | ||||||||||||||||||||||||||||||||||||
| 188 | attachment_id => $attachment_id }); | ||||||||||||||||||||||||||||||||||||
| 189 | 0 | return $self->_wrap_attachment($data); | |||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | sub edit_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
edit_attachment: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 194 | 0 | my ($self, $owner, $repo, $index, $attachment_id, %args) = @_; | |||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 198 | 0 | ▶ | croak 'attachment_id required' unless defined $attachment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 199 | 0 | my $data = $self->call_operation('issues.edit_attachment', | |||||||||||||||||||||||||||||||||||
| 200 | path => { owner => $owner, repo => $repo, index => $index, | ||||||||||||||||||||||||||||||||||||
| 201 | attachment_id => $attachment_id }, | ||||||||||||||||||||||||||||||||||||
| 202 | body => \%args); | ||||||||||||||||||||||||||||||||||||
| 203 | 0 | return $self->_wrap_attachment($data); | |||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||
| 207 | 0 | ▶ | sub delete_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
delete_attachment: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 208 | 0 | my ($self, $owner, $repo, $index, $attachment_id) = @_; | |||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | croak 'index required' unless defined $index; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | croak 'attachment_id required' unless defined $attachment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 213 | 0 | return $self->call_operation('issues.delete_attachment', | |||||||||||||||||||||||||||||||||||
| 214 | path => { owner => $owner, repo => $repo, index => $index, | ||||||||||||||||||||||||||||||||||||
| 215 | attachment_id => $attachment_id }); | ||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||
| 219 | # --- comment attachments -------------------------------------------------- | ||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | sub comment_attachments { | ||||||||||||||||||||||||||||||||||
|
Subroutine
comment_attachments: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 222 | 0 | my ($self, $owner, $repo, $comment_id, %query) = @_; | |||||||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 225 | 0 | ▶ | croak 'comment_id required' unless defined $comment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 226 | 0 | my $data = $self->call_operation('issues.list_comment_attachments', | |||||||||||||||||||||||||||||||||||
| 227 | path => { owner => $owner, repo => $repo, id => $comment_id }, | ||||||||||||||||||||||||||||||||||||
| 228 | query => \%query); | ||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | return [ map { $self->_wrap_attachment($_) } @{ $data || [] } ]; | ||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$data || []
MC/DC0%0/1
$data || []
$data
Truth table0%0/2
A
A= $data
| |||||||||||||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||
| 233 | 0 | ▶ | sub create_comment_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
create_comment_attachment: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 234 | 0 | my ($self, $owner, $repo, $comment_id, %args) = @_; | |||||||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 236 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 237 | 0 | ▶ | croak 'comment_id required' unless defined $comment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 238 | 0 | my $upload = $self->_build_upload(%args); | |||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | my %query = defined $args{name} ? (name => $args{name}) : (); | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | my $data = $self->call_operation('issues.create_comment_attachment', | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 241 | path => { owner => $owner, repo => $repo, id => $comment_id }, | ||||||||||||||||||||||||||||||||||||
| 242 | (%query ? (query => \%query) : ()), | ||||||||||||||||||||||||||||||||||||
| 243 | upload => $upload); | ||||||||||||||||||||||||||||||||||||
| 244 | 0 | return $self->_wrap_attachment($data); | |||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | sub get_comment_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
get_comment_attachment: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 249 | 0 | my ($self, $owner, $repo, $comment_id, $attachment_id) = @_; | |||||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 252 | 0 | ▶ | croak 'comment_id required' unless defined $comment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 253 | 0 | ▶ | croak 'attachment_id required' unless defined $attachment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 254 | 0 | my $data = $self->call_operation('issues.get_comment_attachment', | |||||||||||||||||||||||||||||||||||
| 255 | path => { owner => $owner, repo => $repo, id => $comment_id, | ||||||||||||||||||||||||||||||||||||
| 256 | attachment_id => $attachment_id }); | ||||||||||||||||||||||||||||||||||||
| 257 | 0 | return $self->_wrap_attachment($data); | |||||||||||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | sub edit_comment_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
edit_comment_attachment: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 262 | 0 | my ($self, $owner, $repo, $comment_id, $attachment_id, %args) = @_; | |||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 264 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | croak 'comment_id required' unless defined $comment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | croak 'attachment_id required' unless defined $attachment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 267 | 0 | my $data = $self->call_operation('issues.edit_comment_attachment', | |||||||||||||||||||||||||||||||||||
| 268 | path => { owner => $owner, repo => $repo, id => $comment_id, | ||||||||||||||||||||||||||||||||||||
| 269 | attachment_id => $attachment_id }, | ||||||||||||||||||||||||||||||||||||
| 270 | body => \%args); | ||||||||||||||||||||||||||||||||||||
| 271 | 0 | return $self->_wrap_attachment($data); | |||||||||||||||||||||||||||||||||||
| 272 | } | ||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | sub delete_comment_attachment { | ||||||||||||||||||||||||||||||||||
|
Subroutine
delete_comment_attachment: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 276 | 0 | my ($self, $owner, $repo, $comment_id, $attachment_id) = @_; | |||||||||||||||||||||||||||||||||||
| 277 | 0 | ▶ | croak 'owner required' unless defined $owner; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 278 | 0 | ▶ | croak 'repo required' unless defined $repo; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 279 | 0 | ▶ | croak 'comment_id required' unless defined $comment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 280 | 0 | ▶ | croak 'attachment_id required' unless defined $attachment_id; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 281 | 0 | return $self->call_operation('issues.delete_comment_attachment', | |||||||||||||||||||||||||||||||||||
| 282 | path => { owner => $owner, repo => $repo, id => $comment_id, | ||||||||||||||||||||||||||||||||||||
| 283 | attachment_id => $attachment_id }); | ||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||
| 288 | 5 | 1; | |||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||
| 290 | __END__ | ||||||||||||||||||||||||||||||||||||