| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package WWW::Gitea::API::Issues; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Gitea issues API (issues and issue comments) |
|
4
|
|
|
|
|
|
|
|
|
5
|
5
|
|
|
5
|
|
31
|
use Moo; |
|
|
5
|
|
|
|
|
8
|
|
|
|
5
|
|
|
|
|
29
|
|
|
6
|
5
|
|
|
5
|
|
1972
|
use Carp qw(croak); |
|
|
5
|
|
|
|
|
24
|
|
|
|
5
|
|
|
|
|
318
|
|
|
7
|
5
|
|
|
5
|
|
2426
|
use WWW::Gitea::Issue; |
|
|
5
|
|
|
|
|
19
|
|
|
|
5
|
|
|
|
|
225
|
|
|
8
|
5
|
|
|
5
|
|
2524
|
use WWW::Gitea::Comment; |
|
|
5
|
|
|
|
|
21
|
|
|
|
5
|
|
|
|
|
272
|
|
|
9
|
5
|
|
|
5
|
|
3146
|
use WWW::Gitea::Attachment; |
|
|
5
|
|
|
|
|
18
|
|
|
|
5
|
|
|
|
|
185
|
|
|
10
|
5
|
|
|
5
|
|
31
|
use namespace::clean; |
|
|
5
|
|
|
|
|
7
|
|
|
|
5
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has client => ( |
|
14
|
|
|
|
|
|
|
is => 'ro', |
|
15
|
|
|
|
|
|
|
required => 1, |
|
16
|
|
|
|
|
|
|
weak_ref => 1, |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has openapi_operations => ( |
|
21
|
|
|
|
|
|
|
is => 'lazy', |
|
22
|
|
|
|
|
|
|
builder => sub { |
|
23
|
|
|
|
|
|
|
return { |
|
24
|
2
|
|
|
2
|
|
100
|
'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
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
with 'WWW::Gitea::Role::OpenAPI'; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _wrap { |
|
49
|
0
|
|
|
0
|
|
0
|
my ($self, $data, $owner, $repo) = @_; |
|
50
|
0
|
0
|
|
|
|
0
|
return WWW::Gitea::Issue->new( |
|
|
|
0
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
client => $self->client, |
|
52
|
|
|
|
|
|
|
data => $data, |
|
53
|
|
|
|
|
|
|
(defined $owner ? (owner => $owner) : ()), |
|
54
|
|
|
|
|
|
|
(defined $repo ? (repo => $repo) : ()), |
|
55
|
|
|
|
|
|
|
); |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub list { |
|
59
|
1
|
|
|
1
|
1
|
2641
|
my ($self, $owner, $repo, %query) = @_; |
|
60
|
1
|
50
|
|
|
|
6
|
croak 'owner required' unless defined $owner; |
|
61
|
1
|
50
|
|
|
|
4
|
croak 'repo required' unless defined $repo; |
|
62
|
1
|
|
|
|
|
9
|
my $data = $self->call_operation('issues.list', |
|
63
|
|
|
|
|
|
|
path => { owner => $owner, repo => $repo }, query => \%query); |
|
64
|
1
|
50
|
|
|
|
4
|
return [ map { $self->_wrap($_, $owner, $repo) } @{ $data || [] } ]; |
|
|
0
|
|
|
|
|
0
|
|
|
|
1
|
|
|
|
|
9
|
|
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub create { |
|
69
|
0
|
|
|
0
|
1
|
0
|
my ($self, $owner, $repo, %args) = @_; |
|
70
|
0
|
0
|
|
|
|
0
|
croak 'owner required' unless defined $owner; |
|
71
|
0
|
0
|
|
|
|
0
|
croak 'repo required' unless defined $repo; |
|
72
|
0
|
0
|
|
|
|
0
|
croak 'title required' unless defined $args{title}; |
|
73
|
0
|
|
|
|
|
0
|
my $data = $self->call_operation('issues.create', |
|
74
|
|
|
|
|
|
|
path => { owner => $owner, repo => $repo }, body => \%args); |
|
75
|
0
|
|
|
|
|
0
|
return $self->_wrap($data, $owner, $repo); |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub get { |
|
80
|
0
|
|
|
0
|
1
|
0
|
my ($self, $owner, $repo, $index) = @_; |
|
81
|
0
|
0
|
|
|
|
0
|
croak 'owner required' unless defined $owner; |
|
82
|
0
|
0
|
|
|
|
0
|
croak 'repo required' unless defined $repo; |
|
83
|
0
|
0
|
|
|
|
0
|
croak 'index required' unless defined $index; |
|
84
|
0
|
|
|
|
|
0
|
my $data = $self->call_operation('issues.get', |
|
85
|
|
|
|
|
|
|
path => { owner => $owner, repo => $repo, index => $index }); |
|
86
|
0
|
|
|
|
|
0
|
return $self->_wrap($data, $owner, $repo); |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub edit { |
|
91
|
0
|
|
|
0
|
1
|
0
|
my ($self, $owner, $repo, $index, %args) = @_; |
|
92
|
0
|
0
|
|
|
|
0
|
croak 'owner required' unless defined $owner; |
|
93
|
0
|
0
|
|
|
|
0
|
croak 'repo required' unless defined $repo; |
|
94
|
0
|
0
|
|
|
|
0
|
croak 'index required' unless defined $index; |
|
95
|
0
|
|
|
|
|
0
|
my $data = $self->call_operation('issues.edit', |
|
96
|
|
|
|
|
|
|
path => { owner => $owner, repo => $repo, index => $index }, |
|
97
|
|
|
|
|
|
|
body => \%args); |
|
98
|
0
|
|
|
|
|
0
|
return $self->_wrap($data, $owner, $repo); |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub search { |
|
103
|
0
|
|
|
0
|
1
|
0
|
my ($self, %query) = @_; |
|
104
|
0
|
|
|
|
|
0
|
my $data = $self->call_operation('issues.search', query => \%query); |
|
105
|
0
|
0
|
|
|
|
0
|
return [ map { $self->_wrap($_) } @{ $data || [] } ]; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub comments { |
|
110
|
1
|
|
|
1
|
1
|
1947
|
my ($self, $owner, $repo, $index, %query) = @_; |
|
111
|
1
|
50
|
|
|
|
6
|
croak 'owner required' unless defined $owner; |
|
112
|
1
|
50
|
|
|
|
4
|
croak 'repo required' unless defined $repo; |
|
113
|
1
|
50
|
|
|
|
3
|
croak 'index required' unless defined $index; |
|
114
|
1
|
|
|
|
|
12
|
my $data = $self->call_operation('issues.list_comments', |
|
115
|
|
|
|
|
|
|
path => { owner => $owner, repo => $repo, index => $index }, query => \%query); |
|
116
|
|
|
|
|
|
|
return [ map { |
|
117
|
0
|
|
|
|
|
0
|
WWW::Gitea::Comment->new(client => $self->client, data => $_) |
|
118
|
1
|
50
|
|
|
|
5
|
} @{ $data || [] } ]; |
|
|
1
|
|
|
|
|
9
|
|
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub create_comment { |
|
123
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $index, $body) = @_; |
|
124
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
125
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
126
|
0
|
0
|
|
|
|
|
croak 'index required' unless defined $index; |
|
127
|
0
|
0
|
|
|
|
|
croak 'body required' unless defined $body; |
|
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
|
|
|
|
|
|
|
sub _wrap_attachment { |
|
136
|
0
|
|
|
0
|
|
|
my ($self, $data) = @_; |
|
137
|
0
|
|
|
|
|
|
return WWW::Gitea::Attachment->new(client => $self->client, data => $data); |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub _build_upload { |
|
141
|
0
|
|
|
0
|
|
|
my ($self, %args) = @_; |
|
142
|
|
|
|
|
|
|
croak 'file or content required' |
|
143
|
0
|
0
|
0
|
|
|
|
unless defined $args{file} || 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
|
0
|
0
|
|
|
|
filename => ($args{filename} // $args{name} // 'attachment') }; |
|
|
|
0
|
0
|
|
|
|
|
|
149
|
|
|
|
|
|
|
} |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
# --- issue attachments ---------------------------------------------------- |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
sub attachments { |
|
154
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $index, %query) = @_; |
|
155
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
156
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
157
|
0
|
0
|
|
|
|
|
croak 'index required' unless defined $index; |
|
158
|
0
|
|
|
|
|
|
my $data = $self->call_operation('issues.list_attachments', |
|
159
|
|
|
|
|
|
|
path => { owner => $owner, repo => $repo, index => $index }, |
|
160
|
|
|
|
|
|
|
query => \%query); |
|
161
|
0
|
0
|
|
|
|
|
return [ map { $self->_wrap_attachment($_) } @{ $data || [] } ]; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
} |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub create_attachment { |
|
166
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $index, %args) = @_; |
|
167
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
168
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
169
|
0
|
0
|
|
|
|
|
croak 'index required' unless defined $index; |
|
170
|
0
|
|
|
|
|
|
my $upload = $self->_build_upload(%args); |
|
171
|
0
|
0
|
|
|
|
|
my %query = defined $args{name} ? (name => $args{name}) : (); |
|
172
|
0
|
0
|
|
|
|
|
my $data = $self->call_operation('issues.create_attachment', |
|
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
|
|
|
|
|
|
|
sub get_attachment { |
|
181
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $index, $attachment_id) = @_; |
|
182
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
183
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
184
|
0
|
0
|
|
|
|
|
croak 'index required' unless defined $index; |
|
185
|
0
|
0
|
|
|
|
|
croak 'attachment_id required' unless defined $attachment_id; |
|
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
|
|
|
|
|
|
|
sub edit_attachment { |
|
194
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $index, $attachment_id, %args) = @_; |
|
195
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
196
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
197
|
0
|
0
|
|
|
|
|
croak 'index required' unless defined $index; |
|
198
|
0
|
0
|
|
|
|
|
croak 'attachment_id required' unless defined $attachment_id; |
|
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
|
|
|
|
|
|
|
sub delete_attachment { |
|
208
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $index, $attachment_id) = @_; |
|
209
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
210
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
211
|
0
|
0
|
|
|
|
|
croak 'index required' unless defined $index; |
|
212
|
0
|
0
|
|
|
|
|
croak 'attachment_id required' unless defined $attachment_id; |
|
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
|
|
|
|
|
|
|
sub comment_attachments { |
|
222
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $comment_id, %query) = @_; |
|
223
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
224
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
225
|
0
|
0
|
|
|
|
|
croak 'comment_id required' unless defined $comment_id; |
|
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
|
0
|
|
|
|
|
return [ map { $self->_wrap_attachment($_) } @{ $data || [] } ]; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
} |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
sub create_comment_attachment { |
|
234
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $comment_id, %args) = @_; |
|
235
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
236
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
237
|
0
|
0
|
|
|
|
|
croak 'comment_id required' unless defined $comment_id; |
|
238
|
0
|
|
|
|
|
|
my $upload = $self->_build_upload(%args); |
|
239
|
0
|
0
|
|
|
|
|
my %query = defined $args{name} ? (name => $args{name}) : (); |
|
240
|
0
|
0
|
|
|
|
|
my $data = $self->call_operation('issues.create_comment_attachment', |
|
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
|
|
|
|
|
|
|
sub get_comment_attachment { |
|
249
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $comment_id, $attachment_id) = @_; |
|
250
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
251
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
252
|
0
|
0
|
|
|
|
|
croak 'comment_id required' unless defined $comment_id; |
|
253
|
0
|
0
|
|
|
|
|
croak 'attachment_id required' unless defined $attachment_id; |
|
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
|
|
|
|
|
|
|
sub edit_comment_attachment { |
|
262
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $comment_id, $attachment_id, %args) = @_; |
|
263
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
264
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
265
|
0
|
0
|
|
|
|
|
croak 'comment_id required' unless defined $comment_id; |
|
266
|
0
|
0
|
|
|
|
|
croak 'attachment_id required' unless defined $attachment_id; |
|
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
|
|
|
|
|
|
|
sub delete_comment_attachment { |
|
276
|
0
|
|
|
0
|
1
|
|
my ($self, $owner, $repo, $comment_id, $attachment_id) = @_; |
|
277
|
0
|
0
|
|
|
|
|
croak 'owner required' unless defined $owner; |
|
278
|
0
|
0
|
|
|
|
|
croak 'repo required' unless defined $repo; |
|
279
|
0
|
0
|
|
|
|
|
croak 'comment_id required' unless defined $comment_id; |
|
280
|
0
|
0
|
|
|
|
|
croak 'attachment_id required' unless defined $attachment_id; |
|
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
|
|
|
|
|
|
|
1; |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
__END__ |