line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GitLab::API::v3; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '1.05'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=encoding utf8 |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
GitLab::API::v3 - A complete GitLab API v3 client. (DEPRECATED) |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use GitLab::API::v3; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $api = GitLab::API::v3->new( |
16
|
|
|
|
|
|
|
url => $v3_api_url, |
17
|
|
|
|
|
|
|
token => $token, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $branches = $api->branches( $project_id ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head2 DEPRECATED |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This module is at the end of it's life as the latest GitLab no longer supports |
25
|
|
|
|
|
|
|
the v3 API. Instead, use L<GitLab::API::v4>. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
This module provides a one-to-one interface with the GitLab |
30
|
|
|
|
|
|
|
API v3. Much is not documented here as it would just be duplicating |
31
|
|
|
|
|
|
|
GitLab's own L<API Documentation|http://doc.gitlab.com/ce/api/README.html>. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Note that this distribution also includes the L<gitlab-api-v3> command-line |
34
|
|
|
|
|
|
|
interface (CLI). |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 CREDENTIALS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Authentication credentials may be defined by setting either the L</token>, |
39
|
|
|
|
|
|
|
the L</login> and L</password>, or the L</email> and L</password> arguments. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
When the object is constructed the L</login>, L</email>, and L</password> |
42
|
|
|
|
|
|
|
arguments are used to call L</session> to generate a token. The token is |
43
|
|
|
|
|
|
|
saved in the L</token> attribute, and the login/email/password arguments |
44
|
|
|
|
|
|
|
are discarded. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
If no credentials are supplied then the client will be anonymous and greatly |
47
|
|
|
|
|
|
|
limited in what it can do with the API. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 CONSTANTS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Several values in the GitLab API require looking up the numeric value |
52
|
|
|
|
|
|
|
for a meaning (such as C<access_level> and C<visibility_level>). |
53
|
|
|
|
|
|
|
Instead of doing that, you can use L<GitLab::API::v3::Constants>. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 EXCEPTIONS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
The API methods will all throw (hopefully) a useful exception if |
58
|
|
|
|
|
|
|
an unsuccessful response is received from the API. That is except for |
59
|
|
|
|
|
|
|
C<GET> requests that return a C<404> response - these will return C<undef> |
60
|
|
|
|
|
|
|
for methods that return a value. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
If you'd like to catch and handle these exceptions consider using |
63
|
|
|
|
|
|
|
L<Try::Tiny>. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 LOGGING |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This module uses L<Log::Any> and produces some debug messages here |
68
|
|
|
|
|
|
|
and there, but the most useful bits are the info messages produced |
69
|
|
|
|
|
|
|
just before each API call. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 PROJECT ID |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Note that many API calls require a C<$project_id>. This can be |
74
|
|
|
|
|
|
|
specified as either a numeric project C<ID>, or as a |
75
|
|
|
|
|
|
|
C<NAMESPACE_PATH/PROJECT_PATH> in many cases. Perhaps even |
76
|
|
|
|
|
|
|
all cases, but the GitLab documentation on this point is vague. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 RETURN VALUES |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Many of this module's methods should return a value but do not |
81
|
|
|
|
|
|
|
currently. This is due to the fact that this module was built |
82
|
|
|
|
|
|
|
as a strict representation of GitLab's own documentation which |
83
|
|
|
|
|
|
|
is often inconsistent. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
If you find a method that should provide a return value, but |
86
|
|
|
|
|
|
|
doesn't currently, please verify that GitLab actually does |
87
|
|
|
|
|
|
|
return a value and then submit a pull request or open an issue. |
88
|
|
|
|
|
|
|
See L</CONTRIBUTING> for more info. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
91
|
|
|
|
|
|
|
|
92
|
1
|
|
|
1
|
|
174558
|
use GitLab::API::v3::RESTClient; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
31
|
|
93
|
1
|
|
|
1
|
|
451
|
use GitLab::API::v3::Paginator; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
45
|
|
94
|
|
|
|
|
|
|
|
95
|
1
|
|
|
1
|
|
7
|
use Types::Standard -types; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
96
|
1
|
|
|
1
|
|
4468
|
use Types::Common::String -types; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
97
|
1
|
|
|
1
|
|
1420
|
use URI::Escape; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
59
|
|
98
|
1
|
|
|
1
|
|
6
|
use Carp qw( croak ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
99
|
1
|
|
|
1
|
|
6
|
use Log::Any qw( $log ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
100
|
|
|
|
|
|
|
|
101
|
1
|
|
|
1
|
|
246
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
102
|
1
|
|
|
1
|
|
387
|
use strictures 1; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
35
|
|
103
|
1
|
|
|
1
|
|
83
|
use namespace::clean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
around BUILDARGS => sub{ |
106
|
|
|
|
|
|
|
my $orig = shift; |
107
|
|
|
|
|
|
|
my $class = shift; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my $args = $class->$orig( @_ ); |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
my $session_args = {}; |
112
|
|
|
|
|
|
|
foreach my $key (qw( login email password )) { |
113
|
|
|
|
|
|
|
next if !exists $args->{$key}; |
114
|
|
|
|
|
|
|
$session_args->{$key} = delete $args->{$key}; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
if (%$session_args) { |
118
|
|
|
|
|
|
|
my $api = $class->new( $args ); |
119
|
|
|
|
|
|
|
my $session = $api->session( $session_args ); |
120
|
|
|
|
|
|
|
$args->{token} = $session->{private_token}; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
return $args; |
124
|
|
|
|
|
|
|
}; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub BUILD { |
127
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
128
|
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
|
$log->debugf( "An instance of %s has been created.", ref($self) ); |
130
|
|
|
|
|
|
|
|
131
|
0
|
0
|
|
|
|
|
$self->rest_client->set_persistent_header( |
132
|
|
|
|
|
|
|
'PRIVATE-TOKEN' => $self->token(), |
133
|
|
|
|
|
|
|
) if $self->has_token(); |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
|
return; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 REQUIRED ARGUMENTS |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head2 url |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
The URL to your v3 API endpoint. Typically this will be something |
143
|
|
|
|
|
|
|
like C<http://git.example.com/api/v3>. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
has url => ( |
148
|
|
|
|
|
|
|
is => 'ro', |
149
|
|
|
|
|
|
|
isa => NonEmptySimpleStr, |
150
|
|
|
|
|
|
|
required => 1, |
151
|
|
|
|
|
|
|
); |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 OPTIONAL ARGUMENTS |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head2 token |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
A GitLab API token. |
158
|
|
|
|
|
|
|
If set then neither L</login> or L</email> may be set. |
159
|
|
|
|
|
|
|
Read more in L</CREDENTIALS>. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=cut |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
has token => ( |
164
|
|
|
|
|
|
|
is => 'ro', |
165
|
|
|
|
|
|
|
isa => NonEmptySimpleStr, |
166
|
|
|
|
|
|
|
predicate => 'has_token', |
167
|
|
|
|
|
|
|
); |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head2 login |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
A GitLab user login name. |
172
|
|
|
|
|
|
|
If set then L</password> must be set. |
173
|
|
|
|
|
|
|
Read more in L</CREDENTIALS>. |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head2 email |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
A GitLab user email. |
178
|
|
|
|
|
|
|
If set then L</password> must be set. |
179
|
|
|
|
|
|
|
Read more in L</CREDENTIALS>. |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head2 password |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
A GitLab user password. |
184
|
|
|
|
|
|
|
This must be set if either L</login> or L</email> are set. |
185
|
|
|
|
|
|
|
Read more in L</CREDENTIALS>. |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=cut |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
# The above three args are virtual and get stripped out in BUILDARGS. |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=head2 rest_client |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
An instance of L<GitLab::API::v3::RESTClient>. Typically you will not |
194
|
|
|
|
|
|
|
be setting this as it defaults to a new instance and customization |
195
|
|
|
|
|
|
|
should not be necessary. |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=cut |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
has rest_client => ( |
200
|
|
|
|
|
|
|
is => 'lazy', |
201
|
|
|
|
|
|
|
isa => InstanceOf[ 'GitLab::API::v3::RESTClient' ], |
202
|
|
|
|
|
|
|
handles => [qw( post get head put delete options )], |
203
|
|
|
|
|
|
|
); |
204
|
|
|
|
|
|
|
sub _build_rest_client { |
205
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
206
|
|
|
|
|
|
|
|
207
|
0
|
|
|
|
|
|
my $url = '' . $self->url(); |
208
|
0
|
|
|
|
|
|
my $class = 'GitLab::API::v3::RESTClient'; |
209
|
|
|
|
|
|
|
|
210
|
0
|
|
|
|
|
|
$log->debugf( 'Creating a %s instance pointed at %s.', $class, $url ); |
211
|
|
|
|
|
|
|
|
212
|
0
|
|
|
|
|
|
my $rest = $class->new( |
213
|
|
|
|
|
|
|
server => $url, |
214
|
|
|
|
|
|
|
type => 'application/json', |
215
|
|
|
|
|
|
|
retries => $self->retries, |
216
|
|
|
|
|
|
|
); |
217
|
|
|
|
|
|
|
|
218
|
0
|
|
|
|
|
|
return $rest; |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
=head2 retries |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
The number of times the request should be retried in case it does not succeed. |
224
|
|
|
|
|
|
|
Defaults to 0, meaning that a failed request will not be retried. |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=cut |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
has retries => ( |
229
|
|
|
|
|
|
|
is => 'ro', |
230
|
|
|
|
|
|
|
isa => Int, |
231
|
|
|
|
|
|
|
lazy => 1, |
232
|
|
|
|
|
|
|
default => 0, |
233
|
|
|
|
|
|
|
); |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=head1 UTILITY METHODS |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=head2 paginator |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
my $paginator = $api->paginator( $method, @method_args ); |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
my $members = $api->paginator('group_members', $group_id); |
242
|
|
|
|
|
|
|
while (my $member = $members->next()) { |
243
|
|
|
|
|
|
|
... |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
my $users_pager = $api->paginator('users'); |
247
|
|
|
|
|
|
|
while (my $users = $users_pager->next_page()) { |
248
|
|
|
|
|
|
|
... |
249
|
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
my $all_open_issues = $api->paginator( |
252
|
|
|
|
|
|
|
'issues', |
253
|
|
|
|
|
|
|
$project_id, |
254
|
|
|
|
|
|
|
{ state=>'opened' }, |
255
|
|
|
|
|
|
|
)->all(); |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
Given a method who supports the C<page> and C<per_page> parameters, |
258
|
|
|
|
|
|
|
and returns an array ref, this will return a L<GitLab::API::v3::Paginator> |
259
|
|
|
|
|
|
|
object that will allow you to walk the records one page or one record |
260
|
|
|
|
|
|
|
at a time. |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=cut |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
sub paginator { |
265
|
0
|
|
|
0
|
1
|
|
my ($self, $method, @args) = @_; |
266
|
|
|
|
|
|
|
|
267
|
0
|
0
|
|
|
|
|
my $params = (ref($args[-1]) eq 'HASH') ? pop(@args) : {}; |
268
|
|
|
|
|
|
|
|
269
|
0
|
|
|
|
|
|
return GitLab::API::v3::Paginator->new( |
270
|
|
|
|
|
|
|
api => $self, |
271
|
|
|
|
|
|
|
method => $method, |
272
|
|
|
|
|
|
|
args => \@args, |
273
|
|
|
|
|
|
|
params => $params, |
274
|
|
|
|
|
|
|
); |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
=head1 AWARD EMOJI METHODS |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/award_emoji.html>. |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=head2 issue_award_emojis |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
my $award_emojis = $api->issue_award_emojis( |
284
|
|
|
|
|
|
|
$id, |
285
|
|
|
|
|
|
|
$issue_id, |
286
|
|
|
|
|
|
|
); |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/issues/:issue_id/award_emoji> and returns the decoded/deserialized response body. |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=cut |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub issue_award_emojis { |
293
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
294
|
0
|
0
|
|
|
|
|
croak 'issue_award_emojis must be called with 2 arguments' if @_ != 2; |
295
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to issue_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); |
296
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to issue_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); |
297
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s/award_emoji', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
298
|
0
|
|
|
|
|
|
return $self->get( $path ); |
299
|
|
|
|
|
|
|
} |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=head2 merge_request_award_emojis |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
my $award_emojis = $api->merge_request_award_emojis( |
304
|
|
|
|
|
|
|
$id, |
305
|
|
|
|
|
|
|
$merge_request_id, |
306
|
|
|
|
|
|
|
); |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/merge_requests/:merge_request_id/award_emoji> and returns the decoded/deserialized response body. |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=cut |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
sub merge_request_award_emojis { |
313
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
314
|
0
|
0
|
|
|
|
|
croak 'merge_request_award_emojis must be called with 2 arguments' if @_ != 2; |
315
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to merge_request_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); |
316
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to merge_request_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); |
317
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/award_emoji', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
318
|
0
|
|
|
|
|
|
return $self->get( $path ); |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=head2 issue_award_emoji |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
my $award_emoji = $api->issue_award_emoji( |
324
|
|
|
|
|
|
|
$id, |
325
|
|
|
|
|
|
|
$issue_id, |
326
|
|
|
|
|
|
|
$award_id, |
327
|
|
|
|
|
|
|
); |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/issues/:issue_id/award_emoji/:award_id> and returns the decoded/deserialized response body. |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
=cut |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
sub issue_award_emoji { |
334
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
335
|
0
|
0
|
|
|
|
|
croak 'issue_award_emoji must be called with 3 arguments' if @_ != 3; |
336
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
337
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
338
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($award_id) to issue_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
339
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s/award_emoji/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
340
|
0
|
|
|
|
|
|
return $self->get( $path ); |
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
=head2 merge_request_award_emoji |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
my $award_emoji = $api->merge_request_award_emoji( |
346
|
|
|
|
|
|
|
$id, |
347
|
|
|
|
|
|
|
$merge_request_id, |
348
|
|
|
|
|
|
|
$award_id, |
349
|
|
|
|
|
|
|
); |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/merge_requests/:merge_request_id/award_emoji/:award_id> and returns the decoded/deserialized response body. |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
=cut |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
sub merge_request_award_emoji { |
356
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
357
|
0
|
0
|
|
|
|
|
croak 'merge_request_award_emoji must be called with 3 arguments' if @_ != 3; |
358
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
359
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
360
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($award_id) to merge_request_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
361
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/award_emoji/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
362
|
0
|
|
|
|
|
|
return $self->get( $path ); |
363
|
|
|
|
|
|
|
} |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=head2 create_issue_award_emoji |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
my $award_emoji = $api->create_issue_award_emoji( |
368
|
|
|
|
|
|
|
$id, |
369
|
|
|
|
|
|
|
$issue_id, |
370
|
|
|
|
|
|
|
\%params, |
371
|
|
|
|
|
|
|
); |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/issues/:issue_id/award_emoji> and returns the decoded/deserialized response body. |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
=cut |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
sub create_issue_award_emoji { |
378
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
379
|
0
|
0
|
0
|
|
|
|
croak 'create_issue_award_emoji must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
380
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to create_issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
381
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to create_issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
382
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_issue_award_emoji must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
383
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
384
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s/award_emoji', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
385
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=head2 create_merge_request_award_emoji |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
my $award_emoji = $api->create_merge_request_award_emoji( |
391
|
|
|
|
|
|
|
$id, |
392
|
|
|
|
|
|
|
$merge_request_id, |
393
|
|
|
|
|
|
|
\%params, |
394
|
|
|
|
|
|
|
); |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/merge_requests/:merge_request_id/award_emoji> and returns the decoded/deserialized response body. |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=cut |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
sub create_merge_request_award_emoji { |
401
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
402
|
0
|
0
|
0
|
|
|
|
croak 'create_merge_request_award_emoji must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
403
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to create_merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
404
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to create_merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
405
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_merge_request_award_emoji must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
406
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
407
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/award_emoji', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
408
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
409
|
|
|
|
|
|
|
} |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=head2 delete_issue_award_emoji |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
my $award_emoji = $api->delete_issue_award_emoji( |
414
|
|
|
|
|
|
|
$id, |
415
|
|
|
|
|
|
|
$issue_id, |
416
|
|
|
|
|
|
|
$award_id, |
417
|
|
|
|
|
|
|
); |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:id/issues/:issue_id/award_emoji/:award_id> and returns the decoded/deserialized response body. |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
=cut |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
sub delete_issue_award_emoji { |
424
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
425
|
0
|
0
|
|
|
|
|
croak 'delete_issue_award_emoji must be called with 3 arguments' if @_ != 3; |
426
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to delete_issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
427
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to delete_issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
428
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($award_id) to delete_issue_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
429
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s/award_emoji/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
430
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
431
|
|
|
|
|
|
|
} |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=head2 delete_merge_request_award_emoji |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
my $award_emoji = $api->delete_merge_request_award_emoji( |
436
|
|
|
|
|
|
|
$id, |
437
|
|
|
|
|
|
|
$merge_request_id, |
438
|
|
|
|
|
|
|
$award_id, |
439
|
|
|
|
|
|
|
); |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:id/merge_requests/:merge_request_id/award_emoji/:award_id> and returns the decoded/deserialized response body. |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
=cut |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
sub delete_merge_request_award_emoji { |
446
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
447
|
0
|
0
|
|
|
|
|
croak 'delete_merge_request_award_emoji must be called with 3 arguments' if @_ != 3; |
448
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to delete_merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
449
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to delete_merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
450
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($award_id) to delete_merge_request_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
451
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/award_emoji/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
452
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
453
|
|
|
|
|
|
|
} |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
=head2 issue_note_award_emojis |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
my $award_emojis = $api->issue_note_award_emojis( |
458
|
|
|
|
|
|
|
$id, |
459
|
|
|
|
|
|
|
$issue_id, |
460
|
|
|
|
|
|
|
$note_id, |
461
|
|
|
|
|
|
|
); |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/issues/:issue_id/notes/:note_id/award_emoji> and returns the decoded/deserialized response body. |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
=cut |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
sub issue_note_award_emojis { |
468
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
469
|
0
|
0
|
|
|
|
|
croak 'issue_note_award_emojis must be called with 3 arguments' if @_ != 3; |
470
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to issue_note_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); |
471
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to issue_note_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); |
472
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($note_id) to issue_note_award_emojis must be a scalar' if ref($_[2]) or (!defined $_[2]); |
473
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s/notes/%s/award_emoji', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
474
|
0
|
|
|
|
|
|
return $self->get( $path ); |
475
|
|
|
|
|
|
|
} |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
=head2 issue_note_award_emoji |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
my $award_emoji = $api->issue_note_award_emoji( |
480
|
|
|
|
|
|
|
$id, |
481
|
|
|
|
|
|
|
$issue_id, |
482
|
|
|
|
|
|
|
$note_id, |
483
|
|
|
|
|
|
|
$award_id, |
484
|
|
|
|
|
|
|
); |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/issues/:issue_id/notes/:note_id/award_emoji/:award_id> and returns the decoded/deserialized response body. |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
=cut |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
sub issue_note_award_emoji { |
491
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
492
|
0
|
0
|
|
|
|
|
croak 'issue_note_award_emoji must be called with 4 arguments' if @_ != 4; |
493
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
494
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
495
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($note_id) to issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
496
|
0
|
0
|
0
|
|
|
|
croak 'The #4 argument ($award_id) to issue_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); |
497
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s/notes/%s/award_emoji/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
498
|
0
|
|
|
|
|
|
return $self->get( $path ); |
499
|
|
|
|
|
|
|
} |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
=head2 create_issue_note_award_emoji |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
my $award_emoji = $api->create_issue_note_award_emoji( |
504
|
|
|
|
|
|
|
$id, |
505
|
|
|
|
|
|
|
$issue_id, |
506
|
|
|
|
|
|
|
$note_id, |
507
|
|
|
|
|
|
|
\%params, |
508
|
|
|
|
|
|
|
); |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/issues/:issue_id/notes/:note_id/award_emoji> and returns the decoded/deserialized response body. |
511
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
=cut |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
sub create_issue_note_award_emoji { |
515
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
516
|
0
|
0
|
0
|
|
|
|
croak 'create_issue_note_award_emoji must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; |
517
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to create_issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
518
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to create_issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
519
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($note_id) to create_issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
520
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_issue_note_award_emoji must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; |
521
|
0
|
0
|
|
|
|
|
my $params = (@_ == 4) ? pop() : undef; |
522
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s/notes/%s/award_emoji', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
523
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
524
|
|
|
|
|
|
|
} |
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
=head2 delete_issue_note_award_emoji |
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
my $award_emoji = $api->delete_issue_note_award_emoji( |
529
|
|
|
|
|
|
|
$id, |
530
|
|
|
|
|
|
|
$issue_id, |
531
|
|
|
|
|
|
|
$note_id, |
532
|
|
|
|
|
|
|
$award_id, |
533
|
|
|
|
|
|
|
); |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:id/issues/:issue_id/notes/:note_id/award_emoji/:award_id> and returns the decoded/deserialized response body. |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
=cut |
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
sub delete_issue_note_award_emoji { |
540
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
541
|
0
|
0
|
|
|
|
|
croak 'delete_issue_note_award_emoji must be called with 4 arguments' if @_ != 4; |
542
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to delete_issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
543
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
544
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($note_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
545
|
0
|
0
|
0
|
|
|
|
croak 'The #4 argument ($award_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); |
546
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s/notes/%s/award_emoji/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
547
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
548
|
|
|
|
|
|
|
} |
549
|
|
|
|
|
|
|
|
550
|
|
|
|
|
|
|
=head2 merge_request_note_award_emojis |
551
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
my $award_emojis = $api->merge_request_note_award_emojis( |
553
|
|
|
|
|
|
|
$id, |
554
|
|
|
|
|
|
|
$merge_request_id, |
555
|
|
|
|
|
|
|
$note_id, |
556
|
|
|
|
|
|
|
); |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/merge_requests/:merge_request_id/notes/:note_id/award_emoji> and returns the decoded/deserialized response body. |
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
=cut |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
sub merge_request_note_award_emojis { |
563
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
564
|
0
|
0
|
|
|
|
|
croak 'merge_request_note_award_emojis must be called with 3 arguments' if @_ != 3; |
565
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to merge_request_note_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); |
566
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to merge_request_note_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); |
567
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($note_id) to merge_request_note_award_emojis must be a scalar' if ref($_[2]) or (!defined $_[2]); |
568
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/notes/%s/award_emoji', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
569
|
0
|
|
|
|
|
|
return $self->get( $path ); |
570
|
|
|
|
|
|
|
} |
571
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
=head2 merge_request_note_award_emoji |
573
|
|
|
|
|
|
|
|
574
|
|
|
|
|
|
|
my $award_emoji = $api->merge_request_note_award_emoji( |
575
|
|
|
|
|
|
|
$id, |
576
|
|
|
|
|
|
|
$merge_request_id, |
577
|
|
|
|
|
|
|
$note_id, |
578
|
|
|
|
|
|
|
$award_id, |
579
|
|
|
|
|
|
|
); |
580
|
|
|
|
|
|
|
|
581
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/merge_requests/:merge_request_id/notes/:note_id/award_emoji/:award_id> and returns the decoded/deserialized response body. |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
=cut |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
sub merge_request_note_award_emoji { |
586
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
587
|
0
|
0
|
|
|
|
|
croak 'merge_request_note_award_emoji must be called with 4 arguments' if @_ != 4; |
588
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
589
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
590
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($note_id) to merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
591
|
0
|
0
|
0
|
|
|
|
croak 'The #4 argument ($award_id) to merge_request_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); |
592
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/notes/%s/award_emoji/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
593
|
0
|
|
|
|
|
|
return $self->get( $path ); |
594
|
|
|
|
|
|
|
} |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
=head2 create_merge_request_note_award_emoji |
597
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
my $award_emoji = $api->create_merge_request_note_award_emoji( |
599
|
|
|
|
|
|
|
$id, |
600
|
|
|
|
|
|
|
$merge_request_id, |
601
|
|
|
|
|
|
|
$note_id, |
602
|
|
|
|
|
|
|
\%params, |
603
|
|
|
|
|
|
|
); |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/merge_requests/:merge_request_id/notes/:note_id/award_emoji> and returns the decoded/deserialized response body. |
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
=cut |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
sub create_merge_request_note_award_emoji { |
610
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
611
|
0
|
0
|
0
|
|
|
|
croak 'create_merge_request_note_award_emoji must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; |
612
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to create_merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
613
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to create_merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
614
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($note_id) to create_merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
615
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_merge_request_note_award_emoji must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; |
616
|
0
|
0
|
|
|
|
|
my $params = (@_ == 4) ? pop() : undef; |
617
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/notes/%s/award_emoji', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
618
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
619
|
|
|
|
|
|
|
} |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
=head2 delete_merge_request_note_award_emoji |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
my $award_emoji = $api->delete_merge_request_note_award_emoji( |
624
|
|
|
|
|
|
|
$id, |
625
|
|
|
|
|
|
|
$merge_request_id, |
626
|
|
|
|
|
|
|
$note_id, |
627
|
|
|
|
|
|
|
$award_id, |
628
|
|
|
|
|
|
|
); |
629
|
|
|
|
|
|
|
|
630
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:id/merge_requests/:merge_request_id/notes/:note_id/award_emoji/:award_id> and returns the decoded/deserialized response body. |
631
|
|
|
|
|
|
|
|
632
|
|
|
|
|
|
|
=cut |
633
|
|
|
|
|
|
|
|
634
|
|
|
|
|
|
|
sub delete_merge_request_note_award_emoji { |
635
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
636
|
0
|
0
|
|
|
|
|
croak 'delete_merge_request_note_award_emoji must be called with 4 arguments' if @_ != 4; |
637
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); |
638
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); |
639
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($note_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); |
640
|
0
|
0
|
0
|
|
|
|
croak 'The #4 argument ($award_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); |
641
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/notes/%s/award_emoji/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
642
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
643
|
|
|
|
|
|
|
} |
644
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
=head1 BRANCH METHODS |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/branches.html>. |
648
|
|
|
|
|
|
|
|
649
|
|
|
|
|
|
|
=head2 branches |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
my $branches = $api->branches( |
652
|
|
|
|
|
|
|
$project_id, |
653
|
|
|
|
|
|
|
); |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/branches> and returns the decoded/deserialized response body. |
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
=cut |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
sub branches { |
660
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
661
|
0
|
0
|
|
|
|
|
croak 'branches must be called with 1 arguments' if @_ != 1; |
662
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to branches must be a scalar' if ref($_[0]) or (!defined $_[0]); |
663
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/branches', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
664
|
0
|
|
|
|
|
|
return $self->get( $path ); |
665
|
|
|
|
|
|
|
} |
666
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
=head2 branch |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
my $branch = $api->branch( |
670
|
|
|
|
|
|
|
$project_id, |
671
|
|
|
|
|
|
|
$branch_name, |
672
|
|
|
|
|
|
|
); |
673
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/branches/:branch_name> and returns the decoded/deserialized response body. |
675
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
=cut |
677
|
|
|
|
|
|
|
|
678
|
|
|
|
|
|
|
sub branch { |
679
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
680
|
0
|
0
|
|
|
|
|
croak 'branch must be called with 2 arguments' if @_ != 2; |
681
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to branch must be a scalar' if ref($_[0]) or (!defined $_[0]); |
682
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($branch_name) to branch must be a scalar' if ref($_[1]) or (!defined $_[1]); |
683
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/branches/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
684
|
0
|
|
|
|
|
|
return $self->get( $path ); |
685
|
|
|
|
|
|
|
} |
686
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
=head2 protect_branch |
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
$api->protect_branch( |
690
|
|
|
|
|
|
|
$project_id, |
691
|
|
|
|
|
|
|
$branch_name, |
692
|
|
|
|
|
|
|
\%params, |
693
|
|
|
|
|
|
|
); |
694
|
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/repository/branches/:branch_name/protect>. |
696
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
=cut |
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
sub protect_branch { |
700
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
701
|
0
|
0
|
0
|
|
|
|
croak 'protect_branch must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
702
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to protect_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); |
703
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($branch_name) to protect_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); |
704
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to protect_branch must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
705
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
706
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/branches/%s/protect', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
707
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
708
|
0
|
|
|
|
|
|
return; |
709
|
|
|
|
|
|
|
} |
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
=head2 unprotect_branch |
712
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
$api->unprotect_branch( |
714
|
|
|
|
|
|
|
$project_id, |
715
|
|
|
|
|
|
|
$branch_name, |
716
|
|
|
|
|
|
|
); |
717
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/repository/branches/:branch_name/unprotect>. |
719
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
=cut |
721
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
sub unprotect_branch { |
723
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
724
|
0
|
0
|
|
|
|
|
croak 'unprotect_branch must be called with 2 arguments' if @_ != 2; |
725
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to unprotect_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); |
726
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($branch_name) to unprotect_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); |
727
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/branches/%s/unprotect', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
728
|
0
|
|
|
|
|
|
$self->put( $path ); |
729
|
0
|
|
|
|
|
|
return; |
730
|
|
|
|
|
|
|
} |
731
|
|
|
|
|
|
|
|
732
|
|
|
|
|
|
|
=head2 create_branch |
733
|
|
|
|
|
|
|
|
734
|
|
|
|
|
|
|
my $branch = $api->create_branch( |
735
|
|
|
|
|
|
|
$project_id, |
736
|
|
|
|
|
|
|
\%params, |
737
|
|
|
|
|
|
|
); |
738
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/repository/branches> and returns the decoded/deserialized response body. |
740
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
=cut |
742
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
sub create_branch { |
744
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
745
|
0
|
0
|
0
|
|
|
|
croak 'create_branch must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
746
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); |
747
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_branch must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
748
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
749
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/branches', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
750
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
751
|
|
|
|
|
|
|
} |
752
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
=head2 delete_branch |
754
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
$api->delete_branch( |
756
|
|
|
|
|
|
|
$project_id, |
757
|
|
|
|
|
|
|
$branch_name, |
758
|
|
|
|
|
|
|
); |
759
|
|
|
|
|
|
|
|
760
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/repository/branches/:branch_name>. |
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
=cut |
763
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
sub delete_branch { |
765
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
766
|
0
|
0
|
|
|
|
|
croak 'delete_branch must be called with 2 arguments' if @_ != 2; |
767
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); |
768
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($branch_name) to delete_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); |
769
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/branches/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
770
|
0
|
|
|
|
|
|
$self->delete( $path ); |
771
|
0
|
|
|
|
|
|
return; |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
=head1 BUILD METHODS |
775
|
|
|
|
|
|
|
|
776
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/builds.html>. |
777
|
|
|
|
|
|
|
|
778
|
|
|
|
|
|
|
=head2 builds |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
my $builds = $api->builds( |
781
|
|
|
|
|
|
|
$id, |
782
|
|
|
|
|
|
|
\%params, |
783
|
|
|
|
|
|
|
); |
784
|
|
|
|
|
|
|
|
785
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/builds> and returns the decoded/deserialized response body. |
786
|
|
|
|
|
|
|
|
787
|
|
|
|
|
|
|
=cut |
788
|
|
|
|
|
|
|
|
789
|
|
|
|
|
|
|
sub builds { |
790
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
791
|
0
|
0
|
0
|
|
|
|
croak 'builds must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
792
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to builds must be a scalar' if ref($_[0]) or (!defined $_[0]); |
793
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to builds must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
794
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
795
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/builds', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
796
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
797
|
|
|
|
|
|
|
} |
798
|
|
|
|
|
|
|
|
799
|
|
|
|
|
|
|
=head2 commit_builds |
800
|
|
|
|
|
|
|
|
801
|
|
|
|
|
|
|
my $builds = $api->commit_builds( |
802
|
|
|
|
|
|
|
$id, |
803
|
|
|
|
|
|
|
$sha, |
804
|
|
|
|
|
|
|
\%params, |
805
|
|
|
|
|
|
|
); |
806
|
|
|
|
|
|
|
|
807
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/repository/commits/:sha/builds> and returns the decoded/deserialized response body. |
808
|
|
|
|
|
|
|
|
809
|
|
|
|
|
|
|
=cut |
810
|
|
|
|
|
|
|
|
811
|
|
|
|
|
|
|
sub commit_builds { |
812
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
813
|
0
|
0
|
0
|
|
|
|
croak 'commit_builds must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
814
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to commit_builds must be a scalar' if ref($_[0]) or (!defined $_[0]); |
815
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($sha) to commit_builds must be a scalar' if ref($_[1]) or (!defined $_[1]); |
816
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to commit_builds must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
817
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
818
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/commits/%s/builds', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
819
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
820
|
|
|
|
|
|
|
} |
821
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
=head2 build |
823
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
my $build = $api->build( |
825
|
|
|
|
|
|
|
$id, |
826
|
|
|
|
|
|
|
$build_id, |
827
|
|
|
|
|
|
|
); |
828
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/builds/:build_id> and returns the decoded/deserialized response body. |
830
|
|
|
|
|
|
|
|
831
|
|
|
|
|
|
|
=cut |
832
|
|
|
|
|
|
|
|
833
|
|
|
|
|
|
|
sub build { |
834
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
835
|
0
|
0
|
|
|
|
|
croak 'build must be called with 2 arguments' if @_ != 2; |
836
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to build must be a scalar' if ref($_[0]) or (!defined $_[0]); |
837
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($build_id) to build must be a scalar' if ref($_[1]) or (!defined $_[1]); |
838
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/builds/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
839
|
0
|
|
|
|
|
|
return $self->get( $path ); |
840
|
|
|
|
|
|
|
} |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
=head2 build_artifacts |
843
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
my $artifacts = $api->build_artifacts( |
845
|
|
|
|
|
|
|
$id, |
846
|
|
|
|
|
|
|
$build_id, |
847
|
|
|
|
|
|
|
); |
848
|
|
|
|
|
|
|
|
849
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/builds/:build_id/artifacts> and returns the decoded/deserialized response body. |
850
|
|
|
|
|
|
|
|
851
|
|
|
|
|
|
|
=cut |
852
|
|
|
|
|
|
|
|
853
|
|
|
|
|
|
|
sub build_artifacts { |
854
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
855
|
0
|
0
|
|
|
|
|
croak 'build_artifacts must be called with 2 arguments' if @_ != 2; |
856
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to build_artifacts must be a scalar' if ref($_[0]) or (!defined $_[0]); |
857
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($build_id) to build_artifacts must be a scalar' if ref($_[1]) or (!defined $_[1]); |
858
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/builds/%s/artifacts', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
859
|
0
|
|
|
|
|
|
return $self->get( $path ); |
860
|
|
|
|
|
|
|
} |
861
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
=head2 build_trace |
863
|
|
|
|
|
|
|
|
864
|
|
|
|
|
|
|
my $trace = $api->build_trace( |
865
|
|
|
|
|
|
|
$id, |
866
|
|
|
|
|
|
|
$build_id, |
867
|
|
|
|
|
|
|
); |
868
|
|
|
|
|
|
|
|
869
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/builds/:build_id/trace> and returns the decoded/deserialized response body. |
870
|
|
|
|
|
|
|
|
871
|
|
|
|
|
|
|
=cut |
872
|
|
|
|
|
|
|
|
873
|
|
|
|
|
|
|
sub build_trace { |
874
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
875
|
0
|
0
|
|
|
|
|
croak 'build_trace must be called with 2 arguments' if @_ != 2; |
876
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to build_trace must be a scalar' if ref($_[0]) or (!defined $_[0]); |
877
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($build_id) to build_trace must be a scalar' if ref($_[1]) or (!defined $_[1]); |
878
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/builds/%s/trace', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
879
|
0
|
|
|
|
|
|
return $self->get( $path ); |
880
|
|
|
|
|
|
|
} |
881
|
|
|
|
|
|
|
|
882
|
|
|
|
|
|
|
=head2 cancel_build |
883
|
|
|
|
|
|
|
|
884
|
|
|
|
|
|
|
my $build = $api->cancel_build( |
885
|
|
|
|
|
|
|
$id, |
886
|
|
|
|
|
|
|
$build_id, |
887
|
|
|
|
|
|
|
); |
888
|
|
|
|
|
|
|
|
889
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/builds/:build_id/cancel> and returns the decoded/deserialized response body. |
890
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
=cut |
892
|
|
|
|
|
|
|
|
893
|
|
|
|
|
|
|
sub cancel_build { |
894
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
895
|
0
|
0
|
|
|
|
|
croak 'cancel_build must be called with 2 arguments' if @_ != 2; |
896
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to cancel_build must be a scalar' if ref($_[0]) or (!defined $_[0]); |
897
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($build_id) to cancel_build must be a scalar' if ref($_[1]) or (!defined $_[1]); |
898
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/builds/%s/cancel', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
899
|
0
|
|
|
|
|
|
return $self->post( $path ); |
900
|
|
|
|
|
|
|
} |
901
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
=head2 retry_build |
903
|
|
|
|
|
|
|
|
904
|
|
|
|
|
|
|
my $build = $api->retry_build( |
905
|
|
|
|
|
|
|
$id, |
906
|
|
|
|
|
|
|
$build_id, |
907
|
|
|
|
|
|
|
); |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/builds/:build_id/retry> and returns the decoded/deserialized response body. |
910
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
=cut |
912
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
sub retry_build { |
914
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
915
|
0
|
0
|
|
|
|
|
croak 'retry_build must be called with 2 arguments' if @_ != 2; |
916
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to retry_build must be a scalar' if ref($_[0]) or (!defined $_[0]); |
917
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($build_id) to retry_build must be a scalar' if ref($_[1]) or (!defined $_[1]); |
918
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/builds/%s/retry', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
919
|
0
|
|
|
|
|
|
return $self->post( $path ); |
920
|
|
|
|
|
|
|
} |
921
|
|
|
|
|
|
|
|
922
|
|
|
|
|
|
|
=head2 erase_build |
923
|
|
|
|
|
|
|
|
924
|
|
|
|
|
|
|
my $build = $api->erase_build( |
925
|
|
|
|
|
|
|
$id, |
926
|
|
|
|
|
|
|
$build_id, |
927
|
|
|
|
|
|
|
); |
928
|
|
|
|
|
|
|
|
929
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/builds/:build_id/erase> and returns the decoded/deserialized response body. |
930
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
=cut |
932
|
|
|
|
|
|
|
|
933
|
|
|
|
|
|
|
sub erase_build { |
934
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
935
|
0
|
0
|
|
|
|
|
croak 'erase_build must be called with 2 arguments' if @_ != 2; |
936
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to erase_build must be a scalar' if ref($_[0]) or (!defined $_[0]); |
937
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($build_id) to erase_build must be a scalar' if ref($_[1]) or (!defined $_[1]); |
938
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/builds/%s/erase', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
939
|
0
|
|
|
|
|
|
return $self->post( $path ); |
940
|
|
|
|
|
|
|
} |
941
|
|
|
|
|
|
|
|
942
|
|
|
|
|
|
|
=head2 keep_build_artifacts |
943
|
|
|
|
|
|
|
|
944
|
|
|
|
|
|
|
my $build = $api->keep_build_artifacts( |
945
|
|
|
|
|
|
|
$id, |
946
|
|
|
|
|
|
|
$build_id, |
947
|
|
|
|
|
|
|
); |
948
|
|
|
|
|
|
|
|
949
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/builds/:build_id/artifacts/keep> and returns the decoded/deserialized response body. |
950
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
=cut |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
sub keep_build_artifacts { |
954
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
955
|
0
|
0
|
|
|
|
|
croak 'keep_build_artifacts must be called with 2 arguments' if @_ != 2; |
956
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to keep_build_artifacts must be a scalar' if ref($_[0]) or (!defined $_[0]); |
957
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($build_id) to keep_build_artifacts must be a scalar' if ref($_[1]) or (!defined $_[1]); |
958
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/builds/%s/artifacts/keep', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
959
|
0
|
|
|
|
|
|
return $self->post( $path ); |
960
|
|
|
|
|
|
|
} |
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
=head1 BUILD TRIGGER METHODS |
963
|
|
|
|
|
|
|
|
964
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/build_triggers.html>. |
965
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
=head2 triggers |
967
|
|
|
|
|
|
|
|
968
|
|
|
|
|
|
|
my $triggers = $api->triggers( |
969
|
|
|
|
|
|
|
$id, |
970
|
|
|
|
|
|
|
); |
971
|
|
|
|
|
|
|
|
972
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/triggers> and returns the decoded/deserialized response body. |
973
|
|
|
|
|
|
|
|
974
|
|
|
|
|
|
|
=cut |
975
|
|
|
|
|
|
|
|
976
|
|
|
|
|
|
|
sub triggers { |
977
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
978
|
0
|
0
|
|
|
|
|
croak 'triggers must be called with 1 arguments' if @_ != 1; |
979
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to triggers must be a scalar' if ref($_[0]) or (!defined $_[0]); |
980
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/triggers', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
981
|
0
|
|
|
|
|
|
return $self->get( $path ); |
982
|
|
|
|
|
|
|
} |
983
|
|
|
|
|
|
|
|
984
|
|
|
|
|
|
|
=head2 trigger |
985
|
|
|
|
|
|
|
|
986
|
|
|
|
|
|
|
my $trigger = $api->trigger( |
987
|
|
|
|
|
|
|
$id, |
988
|
|
|
|
|
|
|
$token, |
989
|
|
|
|
|
|
|
); |
990
|
|
|
|
|
|
|
|
991
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/triggers/:token> and returns the decoded/deserialized response body. |
992
|
|
|
|
|
|
|
|
993
|
|
|
|
|
|
|
=cut |
994
|
|
|
|
|
|
|
|
995
|
|
|
|
|
|
|
sub trigger { |
996
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
997
|
0
|
0
|
|
|
|
|
croak 'trigger must be called with 2 arguments' if @_ != 2; |
998
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); |
999
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($token) to trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1000
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/triggers/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1001
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1002
|
|
|
|
|
|
|
} |
1003
|
|
|
|
|
|
|
|
1004
|
|
|
|
|
|
|
=head2 create_trigger |
1005
|
|
|
|
|
|
|
|
1006
|
|
|
|
|
|
|
my $trigger = $api->create_trigger( |
1007
|
|
|
|
|
|
|
$id, |
1008
|
|
|
|
|
|
|
); |
1009
|
|
|
|
|
|
|
|
1010
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/triggers> and returns the decoded/deserialized response body. |
1011
|
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
|
=cut |
1013
|
|
|
|
|
|
|
|
1014
|
|
|
|
|
|
|
sub create_trigger { |
1015
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1016
|
0
|
0
|
|
|
|
|
croak 'create_trigger must be called with 1 arguments' if @_ != 1; |
1017
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to create_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1018
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/triggers', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1019
|
0
|
|
|
|
|
|
return $self->post( $path ); |
1020
|
|
|
|
|
|
|
} |
1021
|
|
|
|
|
|
|
|
1022
|
|
|
|
|
|
|
=head2 delete_trigger |
1023
|
|
|
|
|
|
|
|
1024
|
|
|
|
|
|
|
my $trigger = $api->delete_trigger( |
1025
|
|
|
|
|
|
|
$id, |
1026
|
|
|
|
|
|
|
$token, |
1027
|
|
|
|
|
|
|
); |
1028
|
|
|
|
|
|
|
|
1029
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:id/triggers/:token> and returns the decoded/deserialized response body. |
1030
|
|
|
|
|
|
|
|
1031
|
|
|
|
|
|
|
=cut |
1032
|
|
|
|
|
|
|
|
1033
|
|
|
|
|
|
|
sub delete_trigger { |
1034
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1035
|
0
|
0
|
|
|
|
|
croak 'delete_trigger must be called with 2 arguments' if @_ != 2; |
1036
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to delete_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1037
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($token) to delete_trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1038
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/triggers/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1039
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
1040
|
|
|
|
|
|
|
} |
1041
|
|
|
|
|
|
|
|
1042
|
|
|
|
|
|
|
=head1 BUILD VARIABLE METHODS |
1043
|
|
|
|
|
|
|
|
1044
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/build_variables.html>. |
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
=head2 variables |
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
my $variables = $api->variables( |
1049
|
|
|
|
|
|
|
$id, |
1050
|
|
|
|
|
|
|
); |
1051
|
|
|
|
|
|
|
|
1052
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/variables> and returns the decoded/deserialized response body. |
1053
|
|
|
|
|
|
|
|
1054
|
|
|
|
|
|
|
=cut |
1055
|
|
|
|
|
|
|
|
1056
|
|
|
|
|
|
|
sub variables { |
1057
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1058
|
0
|
0
|
|
|
|
|
croak 'variables must be called with 1 arguments' if @_ != 1; |
1059
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to variables must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1060
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/variables', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1061
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1062
|
|
|
|
|
|
|
} |
1063
|
|
|
|
|
|
|
|
1064
|
|
|
|
|
|
|
=head2 variable |
1065
|
|
|
|
|
|
|
|
1066
|
|
|
|
|
|
|
my $variable = $api->variable( |
1067
|
|
|
|
|
|
|
$id, |
1068
|
|
|
|
|
|
|
$key, |
1069
|
|
|
|
|
|
|
); |
1070
|
|
|
|
|
|
|
|
1071
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/variables/:key> and returns the decoded/deserialized response body. |
1072
|
|
|
|
|
|
|
|
1073
|
|
|
|
|
|
|
=cut |
1074
|
|
|
|
|
|
|
|
1075
|
|
|
|
|
|
|
sub variable { |
1076
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1077
|
0
|
0
|
|
|
|
|
croak 'variable must be called with 2 arguments' if @_ != 2; |
1078
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to variable must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1079
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($key) to variable must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1080
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/variables/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1081
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1082
|
|
|
|
|
|
|
} |
1083
|
|
|
|
|
|
|
|
1084
|
|
|
|
|
|
|
=head2 create_variable |
1085
|
|
|
|
|
|
|
|
1086
|
|
|
|
|
|
|
my $variable = $api->create_variable( |
1087
|
|
|
|
|
|
|
$id, |
1088
|
|
|
|
|
|
|
\%params, |
1089
|
|
|
|
|
|
|
); |
1090
|
|
|
|
|
|
|
|
1091
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/variables> and returns the decoded/deserialized response body. |
1092
|
|
|
|
|
|
|
|
1093
|
|
|
|
|
|
|
=cut |
1094
|
|
|
|
|
|
|
|
1095
|
|
|
|
|
|
|
sub create_variable { |
1096
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1097
|
0
|
0
|
0
|
|
|
|
croak 'create_variable must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1098
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to create_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1099
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_variable must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1100
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1101
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/variables', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1102
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
1103
|
|
|
|
|
|
|
} |
1104
|
|
|
|
|
|
|
|
1105
|
|
|
|
|
|
|
=head2 update_variable |
1106
|
|
|
|
|
|
|
|
1107
|
|
|
|
|
|
|
my $variable = $api->update_variable( |
1108
|
|
|
|
|
|
|
$id, |
1109
|
|
|
|
|
|
|
$key, |
1110
|
|
|
|
|
|
|
\%params, |
1111
|
|
|
|
|
|
|
); |
1112
|
|
|
|
|
|
|
|
1113
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:id/variables/:key> and returns the decoded/deserialized response body. |
1114
|
|
|
|
|
|
|
|
1115
|
|
|
|
|
|
|
=cut |
1116
|
|
|
|
|
|
|
|
1117
|
|
|
|
|
|
|
sub update_variable { |
1118
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1119
|
0
|
0
|
0
|
|
|
|
croak 'update_variable must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
1120
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to update_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1121
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($key) to update_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1122
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to update_variable must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
1123
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
1124
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/variables/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1125
|
0
|
0
|
|
|
|
|
return $self->put( $path, ( defined($params) ? $params : () ) ); |
1126
|
|
|
|
|
|
|
} |
1127
|
|
|
|
|
|
|
|
1128
|
|
|
|
|
|
|
=head2 delete_variable |
1129
|
|
|
|
|
|
|
|
1130
|
|
|
|
|
|
|
my $variable = $api->delete_variable( |
1131
|
|
|
|
|
|
|
$id, |
1132
|
|
|
|
|
|
|
$key, |
1133
|
|
|
|
|
|
|
); |
1134
|
|
|
|
|
|
|
|
1135
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:id/variables/:key> and returns the decoded/deserialized response body. |
1136
|
|
|
|
|
|
|
|
1137
|
|
|
|
|
|
|
=cut |
1138
|
|
|
|
|
|
|
|
1139
|
|
|
|
|
|
|
sub delete_variable { |
1140
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1141
|
0
|
0
|
|
|
|
|
croak 'delete_variable must be called with 2 arguments' if @_ != 2; |
1142
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to delete_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1143
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($key) to delete_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1144
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/variables/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1145
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
1146
|
|
|
|
|
|
|
} |
1147
|
|
|
|
|
|
|
|
1148
|
|
|
|
|
|
|
=head1 COMMIT METHODS |
1149
|
|
|
|
|
|
|
|
1150
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/commits.html>. |
1151
|
|
|
|
|
|
|
|
1152
|
|
|
|
|
|
|
=head2 commits |
1153
|
|
|
|
|
|
|
|
1154
|
|
|
|
|
|
|
my $commits = $api->commits( |
1155
|
|
|
|
|
|
|
$project_id, |
1156
|
|
|
|
|
|
|
\%params, |
1157
|
|
|
|
|
|
|
); |
1158
|
|
|
|
|
|
|
|
1159
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/commits> and returns the decoded/deserialized response body. |
1160
|
|
|
|
|
|
|
|
1161
|
|
|
|
|
|
|
=cut |
1162
|
|
|
|
|
|
|
|
1163
|
|
|
|
|
|
|
sub commits { |
1164
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1165
|
0
|
0
|
0
|
|
|
|
croak 'commits must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1166
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to commits must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1167
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to commits must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1168
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1169
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/commits', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1170
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
1171
|
|
|
|
|
|
|
} |
1172
|
|
|
|
|
|
|
|
1173
|
|
|
|
|
|
|
=head2 commit |
1174
|
|
|
|
|
|
|
|
1175
|
|
|
|
|
|
|
my $commit = $api->commit( |
1176
|
|
|
|
|
|
|
$project_id, |
1177
|
|
|
|
|
|
|
$commit_sha, |
1178
|
|
|
|
|
|
|
); |
1179
|
|
|
|
|
|
|
|
1180
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/commits/:commit_sha> and returns the decoded/deserialized response body. |
1181
|
|
|
|
|
|
|
|
1182
|
|
|
|
|
|
|
=cut |
1183
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
sub commit { |
1185
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1186
|
0
|
0
|
|
|
|
|
croak 'commit must be called with 2 arguments' if @_ != 2; |
1187
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to commit must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1188
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($commit_sha) to commit must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1189
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/commits/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1190
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1191
|
|
|
|
|
|
|
} |
1192
|
|
|
|
|
|
|
|
1193
|
|
|
|
|
|
|
=head2 commit_diff |
1194
|
|
|
|
|
|
|
|
1195
|
|
|
|
|
|
|
my $diff = $api->commit_diff( |
1196
|
|
|
|
|
|
|
$project_id, |
1197
|
|
|
|
|
|
|
$commit_sha, |
1198
|
|
|
|
|
|
|
); |
1199
|
|
|
|
|
|
|
|
1200
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/commits/:commit_sha/diff> and returns the decoded/deserialized response body. |
1201
|
|
|
|
|
|
|
|
1202
|
|
|
|
|
|
|
=cut |
1203
|
|
|
|
|
|
|
|
1204
|
|
|
|
|
|
|
sub commit_diff { |
1205
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1206
|
0
|
0
|
|
|
|
|
croak 'commit_diff must be called with 2 arguments' if @_ != 2; |
1207
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to commit_diff must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1208
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($commit_sha) to commit_diff must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1209
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/commits/%s/diff', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1210
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1211
|
|
|
|
|
|
|
} |
1212
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
=head2 commit_comments |
1214
|
|
|
|
|
|
|
|
1215
|
|
|
|
|
|
|
my $comments = $api->commit_comments( |
1216
|
|
|
|
|
|
|
$project_id, |
1217
|
|
|
|
|
|
|
$commit_sha, |
1218
|
|
|
|
|
|
|
); |
1219
|
|
|
|
|
|
|
|
1220
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/commits/:commit_sha/comments> and returns the decoded/deserialized response body. |
1221
|
|
|
|
|
|
|
|
1222
|
|
|
|
|
|
|
=cut |
1223
|
|
|
|
|
|
|
|
1224
|
|
|
|
|
|
|
sub commit_comments { |
1225
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1226
|
0
|
0
|
|
|
|
|
croak 'commit_comments must be called with 2 arguments' if @_ != 2; |
1227
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to commit_comments must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1228
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($commit_sha) to commit_comments must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1229
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/commits/%s/comments', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1230
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1231
|
|
|
|
|
|
|
} |
1232
|
|
|
|
|
|
|
|
1233
|
|
|
|
|
|
|
=head2 add_commit_comment |
1234
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
$api->add_commit_comment( |
1236
|
|
|
|
|
|
|
$project_id, |
1237
|
|
|
|
|
|
|
$commit_sha, |
1238
|
|
|
|
|
|
|
\%params, |
1239
|
|
|
|
|
|
|
); |
1240
|
|
|
|
|
|
|
|
1241
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/repository/commits/:commit_sha/comments>. |
1242
|
|
|
|
|
|
|
|
1243
|
|
|
|
|
|
|
=cut |
1244
|
|
|
|
|
|
|
|
1245
|
|
|
|
|
|
|
sub add_commit_comment { |
1246
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1247
|
0
|
0
|
0
|
|
|
|
croak 'add_commit_comment must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
1248
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to add_commit_comment must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1249
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($commit_sha) to add_commit_comment must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1250
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to add_commit_comment must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
1251
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
1252
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/commits/%s/comments', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1253
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
1254
|
0
|
|
|
|
|
|
return; |
1255
|
|
|
|
|
|
|
} |
1256
|
|
|
|
|
|
|
|
1257
|
|
|
|
|
|
|
=head1 DEPLOY KEY METHODS |
1258
|
|
|
|
|
|
|
|
1259
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/deploy_keys.html>. |
1260
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
=head2 deploy_keys |
1262
|
|
|
|
|
|
|
|
1263
|
|
|
|
|
|
|
my $keys = $api->deploy_keys( |
1264
|
|
|
|
|
|
|
$project_id, |
1265
|
|
|
|
|
|
|
); |
1266
|
|
|
|
|
|
|
|
1267
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/keys> and returns the decoded/deserialized response body. |
1268
|
|
|
|
|
|
|
|
1269
|
|
|
|
|
|
|
=cut |
1270
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
sub deploy_keys { |
1272
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1273
|
0
|
0
|
|
|
|
|
croak 'deploy_keys must be called with 1 arguments' if @_ != 1; |
1274
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to deploy_keys must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1275
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/keys', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1276
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1277
|
|
|
|
|
|
|
} |
1278
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
=head2 deploy_key |
1280
|
|
|
|
|
|
|
|
1281
|
|
|
|
|
|
|
my $key = $api->deploy_key( |
1282
|
|
|
|
|
|
|
$project_id, |
1283
|
|
|
|
|
|
|
$key_id, |
1284
|
|
|
|
|
|
|
); |
1285
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/keys/:key_id> and returns the decoded/deserialized response body. |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
=cut |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
sub deploy_key { |
1291
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1292
|
0
|
0
|
|
|
|
|
croak 'deploy_key must be called with 2 arguments' if @_ != 2; |
1293
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1294
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($key_id) to deploy_key must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1295
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/keys/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1296
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1297
|
|
|
|
|
|
|
} |
1298
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
=head2 create_deploy_key |
1300
|
|
|
|
|
|
|
|
1301
|
|
|
|
|
|
|
$api->create_deploy_key( |
1302
|
|
|
|
|
|
|
$project_id, |
1303
|
|
|
|
|
|
|
\%params, |
1304
|
|
|
|
|
|
|
); |
1305
|
|
|
|
|
|
|
|
1306
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/keys>. |
1307
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
=cut |
1309
|
|
|
|
|
|
|
|
1310
|
|
|
|
|
|
|
sub create_deploy_key { |
1311
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1312
|
0
|
0
|
0
|
|
|
|
croak 'create_deploy_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1313
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1314
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_deploy_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1315
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1316
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/keys', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1317
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
1318
|
0
|
|
|
|
|
|
return; |
1319
|
|
|
|
|
|
|
} |
1320
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
=head2 delete_deploy_key |
1322
|
|
|
|
|
|
|
|
1323
|
|
|
|
|
|
|
$api->delete_deploy_key( |
1324
|
|
|
|
|
|
|
$project_id, |
1325
|
|
|
|
|
|
|
$key_id, |
1326
|
|
|
|
|
|
|
); |
1327
|
|
|
|
|
|
|
|
1328
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/keys/:key_id>. |
1329
|
|
|
|
|
|
|
|
1330
|
|
|
|
|
|
|
=cut |
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
sub delete_deploy_key { |
1333
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1334
|
0
|
0
|
|
|
|
|
croak 'delete_deploy_key must be called with 2 arguments' if @_ != 2; |
1335
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1336
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($key_id) to delete_deploy_key must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1337
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/keys/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1338
|
0
|
|
|
|
|
|
$self->delete( $path ); |
1339
|
0
|
|
|
|
|
|
return; |
1340
|
|
|
|
|
|
|
} |
1341
|
|
|
|
|
|
|
|
1342
|
|
|
|
|
|
|
=head1 GROUP METHODS |
1343
|
|
|
|
|
|
|
|
1344
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/groups.html>. |
1345
|
|
|
|
|
|
|
|
1346
|
|
|
|
|
|
|
=head2 groups |
1347
|
|
|
|
|
|
|
|
1348
|
|
|
|
|
|
|
my $groups = $api->groups(); |
1349
|
|
|
|
|
|
|
|
1350
|
|
|
|
|
|
|
Sends a C<GET> request to C</groups> and returns the decoded/deserialized response body. |
1351
|
|
|
|
|
|
|
|
1352
|
|
|
|
|
|
|
=cut |
1353
|
|
|
|
|
|
|
|
1354
|
|
|
|
|
|
|
sub groups { |
1355
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1356
|
0
|
0
|
|
|
|
|
croak "The groups method does not take any arguments" if @_; |
1357
|
0
|
|
|
|
|
|
my $path = sprintf('/groups', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1358
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1359
|
|
|
|
|
|
|
} |
1360
|
|
|
|
|
|
|
|
1361
|
|
|
|
|
|
|
=head2 group |
1362
|
|
|
|
|
|
|
|
1363
|
|
|
|
|
|
|
my $group = $api->group( |
1364
|
|
|
|
|
|
|
$group_id, |
1365
|
|
|
|
|
|
|
); |
1366
|
|
|
|
|
|
|
|
1367
|
|
|
|
|
|
|
Sends a C<GET> request to C</groups/:group_id> and returns the decoded/deserialized response body. |
1368
|
|
|
|
|
|
|
|
1369
|
|
|
|
|
|
|
=cut |
1370
|
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
|
sub group { |
1372
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1373
|
0
|
0
|
|
|
|
|
croak 'group must be called with 1 arguments' if @_ != 1; |
1374
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($group_id) to group must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1375
|
0
|
|
|
|
|
|
my $path = sprintf('/groups/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1376
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1377
|
|
|
|
|
|
|
} |
1378
|
|
|
|
|
|
|
|
1379
|
|
|
|
|
|
|
=head2 create_group |
1380
|
|
|
|
|
|
|
|
1381
|
|
|
|
|
|
|
$api->create_group( |
1382
|
|
|
|
|
|
|
\%params, |
1383
|
|
|
|
|
|
|
); |
1384
|
|
|
|
|
|
|
|
1385
|
|
|
|
|
|
|
Sends a C<POST> request to C</groups>. |
1386
|
|
|
|
|
|
|
|
1387
|
|
|
|
|
|
|
=cut |
1388
|
|
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
sub create_group { |
1390
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1391
|
0
|
0
|
0
|
|
|
|
croak 'create_group must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
1392
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_group must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
1393
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
1394
|
0
|
|
|
|
|
|
my $path = sprintf('/groups', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1395
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
1396
|
0
|
|
|
|
|
|
return; |
1397
|
|
|
|
|
|
|
} |
1398
|
|
|
|
|
|
|
|
1399
|
|
|
|
|
|
|
=head2 transfer_project |
1400
|
|
|
|
|
|
|
|
1401
|
|
|
|
|
|
|
$api->transfer_project( |
1402
|
|
|
|
|
|
|
$group_id, |
1403
|
|
|
|
|
|
|
$project_id, |
1404
|
|
|
|
|
|
|
); |
1405
|
|
|
|
|
|
|
|
1406
|
|
|
|
|
|
|
Sends a C<POST> request to C</groups/:group_id/projects/:project_id>. |
1407
|
|
|
|
|
|
|
|
1408
|
|
|
|
|
|
|
=cut |
1409
|
|
|
|
|
|
|
|
1410
|
|
|
|
|
|
|
sub transfer_project { |
1411
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1412
|
0
|
0
|
|
|
|
|
croak 'transfer_project must be called with 2 arguments' if @_ != 2; |
1413
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($group_id) to transfer_project must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1414
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($project_id) to transfer_project must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1415
|
0
|
|
|
|
|
|
my $path = sprintf('/groups/%s/projects/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1416
|
0
|
|
|
|
|
|
$self->post( $path ); |
1417
|
0
|
|
|
|
|
|
return; |
1418
|
|
|
|
|
|
|
} |
1419
|
|
|
|
|
|
|
|
1420
|
|
|
|
|
|
|
=head2 delete_group |
1421
|
|
|
|
|
|
|
|
1422
|
|
|
|
|
|
|
$api->delete_group( |
1423
|
|
|
|
|
|
|
$group_id, |
1424
|
|
|
|
|
|
|
); |
1425
|
|
|
|
|
|
|
|
1426
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</groups/:group_id>. |
1427
|
|
|
|
|
|
|
|
1428
|
|
|
|
|
|
|
=cut |
1429
|
|
|
|
|
|
|
|
1430
|
|
|
|
|
|
|
sub delete_group { |
1431
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1432
|
0
|
0
|
|
|
|
|
croak 'delete_group must be called with 1 arguments' if @_ != 1; |
1433
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($group_id) to delete_group must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1434
|
0
|
|
|
|
|
|
my $path = sprintf('/groups/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1435
|
0
|
|
|
|
|
|
$self->delete( $path ); |
1436
|
0
|
|
|
|
|
|
return; |
1437
|
|
|
|
|
|
|
} |
1438
|
|
|
|
|
|
|
|
1439
|
|
|
|
|
|
|
=head2 search_groups |
1440
|
|
|
|
|
|
|
|
1441
|
|
|
|
|
|
|
my $groups = $api->search_groups( |
1442
|
|
|
|
|
|
|
\%params, |
1443
|
|
|
|
|
|
|
); |
1444
|
|
|
|
|
|
|
|
1445
|
|
|
|
|
|
|
Sends a C<GET> request to C</groups> and returns the decoded/deserialized response body. |
1446
|
|
|
|
|
|
|
|
1447
|
|
|
|
|
|
|
=cut |
1448
|
|
|
|
|
|
|
|
1449
|
|
|
|
|
|
|
sub search_groups { |
1450
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1451
|
0
|
0
|
0
|
|
|
|
croak 'search_groups must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
1452
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to search_groups must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
1453
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
1454
|
0
|
|
|
|
|
|
my $path = sprintf('/groups', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1455
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
1456
|
|
|
|
|
|
|
} |
1457
|
|
|
|
|
|
|
|
1458
|
|
|
|
|
|
|
=head2 group_members |
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
my $members = $api->group_members( |
1461
|
|
|
|
|
|
|
$group_id, |
1462
|
|
|
|
|
|
|
); |
1463
|
|
|
|
|
|
|
|
1464
|
|
|
|
|
|
|
Sends a C<GET> request to C</groups/:group_id/members> and returns the decoded/deserialized response body. |
1465
|
|
|
|
|
|
|
|
1466
|
|
|
|
|
|
|
=cut |
1467
|
|
|
|
|
|
|
|
1468
|
|
|
|
|
|
|
sub group_members { |
1469
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1470
|
0
|
0
|
|
|
|
|
croak 'group_members must be called with 1 arguments' if @_ != 1; |
1471
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($group_id) to group_members must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1472
|
0
|
|
|
|
|
|
my $path = sprintf('/groups/%s/members', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1473
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1474
|
|
|
|
|
|
|
} |
1475
|
|
|
|
|
|
|
|
1476
|
|
|
|
|
|
|
=head2 group_projects |
1477
|
|
|
|
|
|
|
|
1478
|
|
|
|
|
|
|
my $projects = $api->group_projects( |
1479
|
|
|
|
|
|
|
$group_id, |
1480
|
|
|
|
|
|
|
\%params, |
1481
|
|
|
|
|
|
|
); |
1482
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
Sends a C<GET> request to C</groups/:group_id/projects> and returns the decoded/deserialized response body. |
1484
|
|
|
|
|
|
|
|
1485
|
|
|
|
|
|
|
=cut |
1486
|
|
|
|
|
|
|
|
1487
|
|
|
|
|
|
|
sub group_projects { |
1488
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1489
|
0
|
0
|
0
|
|
|
|
croak 'group_projects must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1490
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($group_id) to group_projects must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1491
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to group_projects must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1492
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1493
|
0
|
|
|
|
|
|
my $path = sprintf('/groups/%s/projects', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1494
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
1495
|
|
|
|
|
|
|
} |
1496
|
|
|
|
|
|
|
|
1497
|
|
|
|
|
|
|
=head2 add_group_member |
1498
|
|
|
|
|
|
|
|
1499
|
|
|
|
|
|
|
$api->add_group_member( |
1500
|
|
|
|
|
|
|
$group_id, |
1501
|
|
|
|
|
|
|
\%params, |
1502
|
|
|
|
|
|
|
); |
1503
|
|
|
|
|
|
|
|
1504
|
|
|
|
|
|
|
Sends a C<POST> request to C</groups/:group_id/members>. |
1505
|
|
|
|
|
|
|
|
1506
|
|
|
|
|
|
|
=cut |
1507
|
|
|
|
|
|
|
|
1508
|
|
|
|
|
|
|
sub add_group_member { |
1509
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1510
|
0
|
0
|
0
|
|
|
|
croak 'add_group_member must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1511
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($group_id) to add_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1512
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to add_group_member must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1513
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1514
|
0
|
|
|
|
|
|
my $path = sprintf('/groups/%s/members', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1515
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
1516
|
0
|
|
|
|
|
|
return; |
1517
|
|
|
|
|
|
|
} |
1518
|
|
|
|
|
|
|
|
1519
|
|
|
|
|
|
|
=head2 edit_group_member |
1520
|
|
|
|
|
|
|
|
1521
|
|
|
|
|
|
|
$api->edit_group_member( |
1522
|
|
|
|
|
|
|
$group_id, |
1523
|
|
|
|
|
|
|
$user_id, |
1524
|
|
|
|
|
|
|
\%params, |
1525
|
|
|
|
|
|
|
); |
1526
|
|
|
|
|
|
|
|
1527
|
|
|
|
|
|
|
Sends a C<PUT> request to C</groups/:group_id/members/:user_id>. |
1528
|
|
|
|
|
|
|
|
1529
|
|
|
|
|
|
|
=cut |
1530
|
|
|
|
|
|
|
|
1531
|
|
|
|
|
|
|
sub edit_group_member { |
1532
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1533
|
0
|
0
|
0
|
|
|
|
croak 'edit_group_member must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
1534
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($group_id) to edit_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1535
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($user_id) to edit_group_member must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1536
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_group_member must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
1537
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
1538
|
0
|
|
|
|
|
|
my $path = sprintf('/groups/%s/members/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1539
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
1540
|
0
|
|
|
|
|
|
return; |
1541
|
|
|
|
|
|
|
} |
1542
|
|
|
|
|
|
|
|
1543
|
|
|
|
|
|
|
=head2 remove_group_member |
1544
|
|
|
|
|
|
|
|
1545
|
|
|
|
|
|
|
$api->remove_group_member( |
1546
|
|
|
|
|
|
|
$group_id, |
1547
|
|
|
|
|
|
|
$user_id, |
1548
|
|
|
|
|
|
|
); |
1549
|
|
|
|
|
|
|
|
1550
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</groups/:group_id/members/:user_id>. |
1551
|
|
|
|
|
|
|
|
1552
|
|
|
|
|
|
|
=cut |
1553
|
|
|
|
|
|
|
|
1554
|
|
|
|
|
|
|
sub remove_group_member { |
1555
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1556
|
0
|
0
|
|
|
|
|
croak 'remove_group_member must be called with 2 arguments' if @_ != 2; |
1557
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($group_id) to remove_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1558
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($user_id) to remove_group_member must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1559
|
0
|
|
|
|
|
|
my $path = sprintf('/groups/%s/members/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1560
|
0
|
|
|
|
|
|
$self->delete( $path ); |
1561
|
0
|
|
|
|
|
|
return; |
1562
|
|
|
|
|
|
|
} |
1563
|
|
|
|
|
|
|
|
1564
|
|
|
|
|
|
|
=head1 ISSUE METHODS |
1565
|
|
|
|
|
|
|
|
1566
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/issues.html>. |
1567
|
|
|
|
|
|
|
|
1568
|
|
|
|
|
|
|
=head2 all_issues |
1569
|
|
|
|
|
|
|
|
1570
|
|
|
|
|
|
|
my $issues = $api->all_issues( |
1571
|
|
|
|
|
|
|
\%params, |
1572
|
|
|
|
|
|
|
); |
1573
|
|
|
|
|
|
|
|
1574
|
|
|
|
|
|
|
Sends a C<GET> request to C</issues> and returns the decoded/deserialized response body. |
1575
|
|
|
|
|
|
|
|
1576
|
|
|
|
|
|
|
=cut |
1577
|
|
|
|
|
|
|
|
1578
|
|
|
|
|
|
|
sub all_issues { |
1579
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1580
|
0
|
0
|
0
|
|
|
|
croak 'all_issues must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
1581
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to all_issues must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
1582
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
1583
|
0
|
|
|
|
|
|
my $path = sprintf('/issues', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1584
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
1585
|
|
|
|
|
|
|
} |
1586
|
|
|
|
|
|
|
|
1587
|
|
|
|
|
|
|
=head2 issues |
1588
|
|
|
|
|
|
|
|
1589
|
|
|
|
|
|
|
my $issues = $api->issues( |
1590
|
|
|
|
|
|
|
$project_id, |
1591
|
|
|
|
|
|
|
\%params, |
1592
|
|
|
|
|
|
|
); |
1593
|
|
|
|
|
|
|
|
1594
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/issues> and returns the decoded/deserialized response body. |
1595
|
|
|
|
|
|
|
|
1596
|
|
|
|
|
|
|
=cut |
1597
|
|
|
|
|
|
|
|
1598
|
|
|
|
|
|
|
sub issues { |
1599
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1600
|
0
|
0
|
0
|
|
|
|
croak 'issues must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1601
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to issues must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1602
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to issues must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1603
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1604
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1605
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
1606
|
|
|
|
|
|
|
} |
1607
|
|
|
|
|
|
|
|
1608
|
|
|
|
|
|
|
=head2 issue |
1609
|
|
|
|
|
|
|
|
1610
|
|
|
|
|
|
|
my $issue = $api->issue( |
1611
|
|
|
|
|
|
|
$project_id, |
1612
|
|
|
|
|
|
|
$issue_id, |
1613
|
|
|
|
|
|
|
); |
1614
|
|
|
|
|
|
|
|
1615
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/issues/:issue_id> and returns the decoded/deserialized response body. |
1616
|
|
|
|
|
|
|
|
1617
|
|
|
|
|
|
|
=cut |
1618
|
|
|
|
|
|
|
|
1619
|
|
|
|
|
|
|
sub issue { |
1620
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1621
|
0
|
0
|
|
|
|
|
croak 'issue must be called with 2 arguments' if @_ != 2; |
1622
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to issue must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1623
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to issue must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1624
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1625
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1626
|
|
|
|
|
|
|
} |
1627
|
|
|
|
|
|
|
|
1628
|
|
|
|
|
|
|
=head2 create_issue |
1629
|
|
|
|
|
|
|
|
1630
|
|
|
|
|
|
|
my $issue = $api->create_issue( |
1631
|
|
|
|
|
|
|
$project_id, |
1632
|
|
|
|
|
|
|
\%params, |
1633
|
|
|
|
|
|
|
); |
1634
|
|
|
|
|
|
|
|
1635
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/issues> and returns the decoded/deserialized response body. |
1636
|
|
|
|
|
|
|
|
1637
|
|
|
|
|
|
|
=cut |
1638
|
|
|
|
|
|
|
|
1639
|
|
|
|
|
|
|
sub create_issue { |
1640
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1641
|
0
|
0
|
0
|
|
|
|
croak 'create_issue must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1642
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1643
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_issue must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1644
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1645
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1646
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
1647
|
|
|
|
|
|
|
} |
1648
|
|
|
|
|
|
|
|
1649
|
|
|
|
|
|
|
=head2 edit_issue |
1650
|
|
|
|
|
|
|
|
1651
|
|
|
|
|
|
|
my $issue = $api->edit_issue( |
1652
|
|
|
|
|
|
|
$project_id, |
1653
|
|
|
|
|
|
|
$issue_id, |
1654
|
|
|
|
|
|
|
\%params, |
1655
|
|
|
|
|
|
|
); |
1656
|
|
|
|
|
|
|
|
1657
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/issues/:issue_id> and returns the decoded/deserialized response body. |
1658
|
|
|
|
|
|
|
|
1659
|
|
|
|
|
|
|
=cut |
1660
|
|
|
|
|
|
|
|
1661
|
|
|
|
|
|
|
sub edit_issue { |
1662
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1663
|
0
|
0
|
0
|
|
|
|
croak 'edit_issue must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
1664
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1665
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($issue_id) to edit_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1666
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_issue must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
1667
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
1668
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/issues/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1669
|
0
|
0
|
|
|
|
|
return $self->put( $path, ( defined($params) ? $params : () ) ); |
1670
|
|
|
|
|
|
|
} |
1671
|
|
|
|
|
|
|
|
1672
|
|
|
|
|
|
|
=head1 KEY METHODS |
1673
|
|
|
|
|
|
|
|
1674
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/keys.html>. |
1675
|
|
|
|
|
|
|
|
1676
|
|
|
|
|
|
|
=head2 key |
1677
|
|
|
|
|
|
|
|
1678
|
|
|
|
|
|
|
my $key = $api->key( |
1679
|
|
|
|
|
|
|
$key_id, |
1680
|
|
|
|
|
|
|
); |
1681
|
|
|
|
|
|
|
|
1682
|
|
|
|
|
|
|
Sends a C<GET> request to C</keys/:key_id> and returns the decoded/deserialized response body. |
1683
|
|
|
|
|
|
|
|
1684
|
|
|
|
|
|
|
=cut |
1685
|
|
|
|
|
|
|
|
1686
|
|
|
|
|
|
|
sub key { |
1687
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1688
|
0
|
0
|
|
|
|
|
croak 'key must be called with 1 arguments' if @_ != 1; |
1689
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($key_id) to key must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1690
|
0
|
|
|
|
|
|
my $path = sprintf('/keys/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1691
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1692
|
|
|
|
|
|
|
} |
1693
|
|
|
|
|
|
|
|
1694
|
|
|
|
|
|
|
=head1 LABEL METHODS |
1695
|
|
|
|
|
|
|
|
1696
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/labels.html>. |
1697
|
|
|
|
|
|
|
|
1698
|
|
|
|
|
|
|
=head2 labels |
1699
|
|
|
|
|
|
|
|
1700
|
|
|
|
|
|
|
my $labels = $api->labels( |
1701
|
|
|
|
|
|
|
$project_id, |
1702
|
|
|
|
|
|
|
); |
1703
|
|
|
|
|
|
|
|
1704
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/labels> and returns the decoded/deserialized response body. |
1705
|
|
|
|
|
|
|
|
1706
|
|
|
|
|
|
|
=cut |
1707
|
|
|
|
|
|
|
|
1708
|
|
|
|
|
|
|
sub labels { |
1709
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1710
|
0
|
0
|
|
|
|
|
croak 'labels must be called with 1 arguments' if @_ != 1; |
1711
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to labels must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1712
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/labels', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1713
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1714
|
|
|
|
|
|
|
} |
1715
|
|
|
|
|
|
|
|
1716
|
|
|
|
|
|
|
=head2 create_label |
1717
|
|
|
|
|
|
|
|
1718
|
|
|
|
|
|
|
my $label = $api->create_label( |
1719
|
|
|
|
|
|
|
$project_id, |
1720
|
|
|
|
|
|
|
\%params, |
1721
|
|
|
|
|
|
|
); |
1722
|
|
|
|
|
|
|
|
1723
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/labels> and returns the decoded/deserialized response body. |
1724
|
|
|
|
|
|
|
|
1725
|
|
|
|
|
|
|
=cut |
1726
|
|
|
|
|
|
|
|
1727
|
|
|
|
|
|
|
sub create_label { |
1728
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1729
|
0
|
0
|
0
|
|
|
|
croak 'create_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1730
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_label must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1731
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1732
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1733
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/labels', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1734
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
1735
|
|
|
|
|
|
|
} |
1736
|
|
|
|
|
|
|
|
1737
|
|
|
|
|
|
|
=head2 delete_label |
1738
|
|
|
|
|
|
|
|
1739
|
|
|
|
|
|
|
$api->delete_label( |
1740
|
|
|
|
|
|
|
$project_id, |
1741
|
|
|
|
|
|
|
\%params, |
1742
|
|
|
|
|
|
|
); |
1743
|
|
|
|
|
|
|
|
1744
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/labels>. |
1745
|
|
|
|
|
|
|
|
1746
|
|
|
|
|
|
|
=cut |
1747
|
|
|
|
|
|
|
|
1748
|
|
|
|
|
|
|
sub delete_label { |
1749
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1750
|
0
|
0
|
0
|
|
|
|
croak 'delete_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1751
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_label must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1752
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to delete_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1753
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1754
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/labels', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1755
|
0
|
0
|
|
|
|
|
$self->delete( $path, ( defined($params) ? $params : () ) ); |
1756
|
0
|
|
|
|
|
|
return; |
1757
|
|
|
|
|
|
|
} |
1758
|
|
|
|
|
|
|
|
1759
|
|
|
|
|
|
|
=head2 edit_label |
1760
|
|
|
|
|
|
|
|
1761
|
|
|
|
|
|
|
my $label = $api->edit_label( |
1762
|
|
|
|
|
|
|
$project_id, |
1763
|
|
|
|
|
|
|
\%params, |
1764
|
|
|
|
|
|
|
); |
1765
|
|
|
|
|
|
|
|
1766
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/labels> and returns the decoded/deserialized response body. |
1767
|
|
|
|
|
|
|
|
1768
|
|
|
|
|
|
|
=cut |
1769
|
|
|
|
|
|
|
|
1770
|
|
|
|
|
|
|
sub edit_label { |
1771
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1772
|
0
|
0
|
0
|
|
|
|
croak 'edit_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1773
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_label must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1774
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1775
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1776
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/labels', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1777
|
0
|
0
|
|
|
|
|
return $self->put( $path, ( defined($params) ? $params : () ) ); |
1778
|
|
|
|
|
|
|
} |
1779
|
|
|
|
|
|
|
|
1780
|
|
|
|
|
|
|
=head1 MERGE REQUEST METHODS |
1781
|
|
|
|
|
|
|
|
1782
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/merge_requests.html>. |
1783
|
|
|
|
|
|
|
|
1784
|
|
|
|
|
|
|
=head2 merge_requests |
1785
|
|
|
|
|
|
|
|
1786
|
|
|
|
|
|
|
my $merge_requests = $api->merge_requests( |
1787
|
|
|
|
|
|
|
$project_id, |
1788
|
|
|
|
|
|
|
\%params, |
1789
|
|
|
|
|
|
|
); |
1790
|
|
|
|
|
|
|
|
1791
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/merge_requests> and returns the decoded/deserialized response body. |
1792
|
|
|
|
|
|
|
|
1793
|
|
|
|
|
|
|
=cut |
1794
|
|
|
|
|
|
|
|
1795
|
|
|
|
|
|
|
sub merge_requests { |
1796
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1797
|
0
|
0
|
0
|
|
|
|
croak 'merge_requests must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1798
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to merge_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1799
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to merge_requests must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1800
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1801
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1802
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
1803
|
|
|
|
|
|
|
} |
1804
|
|
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
=head2 merge_request |
1806
|
|
|
|
|
|
|
|
1807
|
|
|
|
|
|
|
my $merge_request = $api->merge_request( |
1808
|
|
|
|
|
|
|
$project_id, |
1809
|
|
|
|
|
|
|
$merge_request_id, |
1810
|
|
|
|
|
|
|
); |
1811
|
|
|
|
|
|
|
|
1812
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/merge_request/:merge_request_id> and returns the decoded/deserialized response body. |
1813
|
|
|
|
|
|
|
|
1814
|
|
|
|
|
|
|
=cut |
1815
|
|
|
|
|
|
|
|
1816
|
|
|
|
|
|
|
sub merge_request { |
1817
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1818
|
0
|
0
|
|
|
|
|
croak 'merge_request must be called with 2 arguments' if @_ != 2; |
1819
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1820
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1821
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_request/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1822
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1823
|
|
|
|
|
|
|
} |
1824
|
|
|
|
|
|
|
|
1825
|
|
|
|
|
|
|
=head2 create_merge_request |
1826
|
|
|
|
|
|
|
|
1827
|
|
|
|
|
|
|
my $merge_request = $api->create_merge_request( |
1828
|
|
|
|
|
|
|
$project_id, |
1829
|
|
|
|
|
|
|
\%params, |
1830
|
|
|
|
|
|
|
); |
1831
|
|
|
|
|
|
|
|
1832
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/merge_requests> and returns the decoded/deserialized response body. |
1833
|
|
|
|
|
|
|
|
1834
|
|
|
|
|
|
|
=cut |
1835
|
|
|
|
|
|
|
|
1836
|
|
|
|
|
|
|
sub create_merge_request { |
1837
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1838
|
0
|
0
|
0
|
|
|
|
croak 'create_merge_request must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1839
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1840
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_merge_request must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1841
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1842
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1843
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
1844
|
|
|
|
|
|
|
} |
1845
|
|
|
|
|
|
|
|
1846
|
|
|
|
|
|
|
=head2 edit_merge_request |
1847
|
|
|
|
|
|
|
|
1848
|
|
|
|
|
|
|
my $merge_request = $api->edit_merge_request( |
1849
|
|
|
|
|
|
|
$project_id, |
1850
|
|
|
|
|
|
|
$merge_request_id, |
1851
|
|
|
|
|
|
|
\%params, |
1852
|
|
|
|
|
|
|
); |
1853
|
|
|
|
|
|
|
|
1854
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/merge_requests/:merge_request_id> and returns the decoded/deserialized response body. |
1855
|
|
|
|
|
|
|
|
1856
|
|
|
|
|
|
|
=cut |
1857
|
|
|
|
|
|
|
|
1858
|
|
|
|
|
|
|
sub edit_merge_request { |
1859
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1860
|
0
|
0
|
0
|
|
|
|
croak 'edit_merge_request must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
1861
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1862
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to edit_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1863
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_merge_request must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
1864
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
1865
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1866
|
0
|
0
|
|
|
|
|
return $self->put( $path, ( defined($params) ? $params : () ) ); |
1867
|
|
|
|
|
|
|
} |
1868
|
|
|
|
|
|
|
|
1869
|
|
|
|
|
|
|
=head2 accept_merge_request |
1870
|
|
|
|
|
|
|
|
1871
|
|
|
|
|
|
|
$api->accept_merge_request( |
1872
|
|
|
|
|
|
|
$project_id, |
1873
|
|
|
|
|
|
|
$merge_request_id, |
1874
|
|
|
|
|
|
|
\%params, |
1875
|
|
|
|
|
|
|
); |
1876
|
|
|
|
|
|
|
|
1877
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/merge_requests/:merge_request_id/merge>. |
1878
|
|
|
|
|
|
|
|
1879
|
|
|
|
|
|
|
=cut |
1880
|
|
|
|
|
|
|
|
1881
|
|
|
|
|
|
|
sub accept_merge_request { |
1882
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1883
|
0
|
0
|
0
|
|
|
|
croak 'accept_merge_request must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
1884
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to accept_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1885
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to accept_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1886
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to accept_merge_request must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
1887
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
1888
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/merge', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1889
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
1890
|
0
|
|
|
|
|
|
return; |
1891
|
|
|
|
|
|
|
} |
1892
|
|
|
|
|
|
|
|
1893
|
|
|
|
|
|
|
=head2 add_merge_request_comment |
1894
|
|
|
|
|
|
|
|
1895
|
|
|
|
|
|
|
$api->add_merge_request_comment( |
1896
|
|
|
|
|
|
|
$project_id, |
1897
|
|
|
|
|
|
|
$merge_request_id, |
1898
|
|
|
|
|
|
|
\%params, |
1899
|
|
|
|
|
|
|
); |
1900
|
|
|
|
|
|
|
|
1901
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/merge_requests/:merge_request_id/comments>. |
1902
|
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
=cut |
1904
|
|
|
|
|
|
|
|
1905
|
|
|
|
|
|
|
sub add_merge_request_comment { |
1906
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1907
|
0
|
0
|
0
|
|
|
|
croak 'add_merge_request_comment must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
1908
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to add_merge_request_comment must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1909
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to add_merge_request_comment must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1910
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to add_merge_request_comment must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
1911
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
1912
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/comments', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1913
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
1914
|
0
|
|
|
|
|
|
return; |
1915
|
|
|
|
|
|
|
} |
1916
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
=head2 merge_request_comments |
1918
|
|
|
|
|
|
|
|
1919
|
|
|
|
|
|
|
my $comments = $api->merge_request_comments( |
1920
|
|
|
|
|
|
|
$project_id, |
1921
|
|
|
|
|
|
|
$merge_request_id, |
1922
|
|
|
|
|
|
|
); |
1923
|
|
|
|
|
|
|
|
1924
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/merge_requests/:merge_request_id/comments> and returns the decoded/deserialized response body. |
1925
|
|
|
|
|
|
|
|
1926
|
|
|
|
|
|
|
=cut |
1927
|
|
|
|
|
|
|
|
1928
|
|
|
|
|
|
|
sub merge_request_comments { |
1929
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1930
|
0
|
0
|
|
|
|
|
croak 'merge_request_comments must be called with 2 arguments' if @_ != 2; |
1931
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to merge_request_comments must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1932
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($merge_request_id) to merge_request_comments must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1933
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/merge_requests/%s/comments', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1934
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1935
|
|
|
|
|
|
|
} |
1936
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
=head1 MILESTONE METHODS |
1938
|
|
|
|
|
|
|
|
1939
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/milestones.html>. |
1940
|
|
|
|
|
|
|
|
1941
|
|
|
|
|
|
|
=head2 milestones |
1942
|
|
|
|
|
|
|
|
1943
|
|
|
|
|
|
|
my $milestones = $api->milestones( |
1944
|
|
|
|
|
|
|
$project_id, |
1945
|
|
|
|
|
|
|
\%params, |
1946
|
|
|
|
|
|
|
); |
1947
|
|
|
|
|
|
|
|
1948
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/milestones> and returns the decoded/deserialized response body. |
1949
|
|
|
|
|
|
|
|
1950
|
|
|
|
|
|
|
=cut |
1951
|
|
|
|
|
|
|
|
1952
|
|
|
|
|
|
|
sub milestones { |
1953
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1954
|
0
|
0
|
0
|
|
|
|
croak 'milestones must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1955
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to milestones must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1956
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to milestones must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1957
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1958
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/milestones', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1959
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
1960
|
|
|
|
|
|
|
} |
1961
|
|
|
|
|
|
|
|
1962
|
|
|
|
|
|
|
=head2 milestone |
1963
|
|
|
|
|
|
|
|
1964
|
|
|
|
|
|
|
my $milestone = $api->milestone( |
1965
|
|
|
|
|
|
|
$project_id, |
1966
|
|
|
|
|
|
|
$milestone_id, |
1967
|
|
|
|
|
|
|
); |
1968
|
|
|
|
|
|
|
|
1969
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/milestones/:milestone_id> and returns the decoded/deserialized response body. |
1970
|
|
|
|
|
|
|
|
1971
|
|
|
|
|
|
|
=cut |
1972
|
|
|
|
|
|
|
|
1973
|
|
|
|
|
|
|
sub milestone { |
1974
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1975
|
0
|
0
|
|
|
|
|
croak 'milestone must be called with 2 arguments' if @_ != 2; |
1976
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1977
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($milestone_id) to milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); |
1978
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/milestones/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
1979
|
0
|
|
|
|
|
|
return $self->get( $path ); |
1980
|
|
|
|
|
|
|
} |
1981
|
|
|
|
|
|
|
|
1982
|
|
|
|
|
|
|
=head2 create_milestone |
1983
|
|
|
|
|
|
|
|
1984
|
|
|
|
|
|
|
$api->create_milestone( |
1985
|
|
|
|
|
|
|
$project_id, |
1986
|
|
|
|
|
|
|
\%params, |
1987
|
|
|
|
|
|
|
); |
1988
|
|
|
|
|
|
|
|
1989
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/milestones>. |
1990
|
|
|
|
|
|
|
|
1991
|
|
|
|
|
|
|
=cut |
1992
|
|
|
|
|
|
|
|
1993
|
|
|
|
|
|
|
sub create_milestone { |
1994
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
1995
|
0
|
0
|
0
|
|
|
|
croak 'create_milestone must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
1996
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); |
1997
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_milestone must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
1998
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
1999
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/milestones', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2000
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
2001
|
0
|
|
|
|
|
|
return; |
2002
|
|
|
|
|
|
|
} |
2003
|
|
|
|
|
|
|
|
2004
|
|
|
|
|
|
|
=head2 edit_milestone |
2005
|
|
|
|
|
|
|
|
2006
|
|
|
|
|
|
|
$api->edit_milestone( |
2007
|
|
|
|
|
|
|
$project_id, |
2008
|
|
|
|
|
|
|
$milestone_id, |
2009
|
|
|
|
|
|
|
\%params, |
2010
|
|
|
|
|
|
|
); |
2011
|
|
|
|
|
|
|
|
2012
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/milestones/:milestone_id>. |
2013
|
|
|
|
|
|
|
|
2014
|
|
|
|
|
|
|
=cut |
2015
|
|
|
|
|
|
|
|
2016
|
|
|
|
|
|
|
sub edit_milestone { |
2017
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2018
|
0
|
0
|
0
|
|
|
|
croak 'edit_milestone must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
2019
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2020
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($milestone_id) to edit_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2021
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_milestone must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
2022
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
2023
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/milestones/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2024
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
2025
|
0
|
|
|
|
|
|
return; |
2026
|
|
|
|
|
|
|
} |
2027
|
|
|
|
|
|
|
|
2028
|
|
|
|
|
|
|
=head2 milestone_issues |
2029
|
|
|
|
|
|
|
|
2030
|
|
|
|
|
|
|
my $issues = $api->milestone_issues( |
2031
|
|
|
|
|
|
|
$project_id, |
2032
|
|
|
|
|
|
|
$milestone_id, |
2033
|
|
|
|
|
|
|
); |
2034
|
|
|
|
|
|
|
|
2035
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/milestones/:milestone_id/issues> and returns the decoded/deserialized response body. |
2036
|
|
|
|
|
|
|
|
2037
|
|
|
|
|
|
|
=cut |
2038
|
|
|
|
|
|
|
|
2039
|
|
|
|
|
|
|
sub milestone_issues { |
2040
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2041
|
0
|
0
|
|
|
|
|
croak 'milestone_issues must be called with 2 arguments' if @_ != 2; |
2042
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to milestone_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2043
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($milestone_id) to milestone_issues must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2044
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/milestones/%s/issues', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2045
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2046
|
|
|
|
|
|
|
} |
2047
|
|
|
|
|
|
|
|
2048
|
|
|
|
|
|
|
=head1 OPEN SOURCE LICENSES METHODS |
2049
|
|
|
|
|
|
|
|
2050
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/licenses.html>. |
2051
|
|
|
|
|
|
|
|
2052
|
|
|
|
|
|
|
=head2 licenses |
2053
|
|
|
|
|
|
|
|
2054
|
|
|
|
|
|
|
my $licenses = $api->licenses( |
2055
|
|
|
|
|
|
|
\%params, |
2056
|
|
|
|
|
|
|
); |
2057
|
|
|
|
|
|
|
|
2058
|
|
|
|
|
|
|
Sends a C<GET> request to C</licenses> and returns the decoded/deserialized response body. |
2059
|
|
|
|
|
|
|
|
2060
|
|
|
|
|
|
|
=cut |
2061
|
|
|
|
|
|
|
|
2062
|
|
|
|
|
|
|
sub licenses { |
2063
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2064
|
0
|
0
|
0
|
|
|
|
croak 'licenses must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
2065
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to licenses must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
2066
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
2067
|
0
|
|
|
|
|
|
my $path = sprintf('/licenses', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2068
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2069
|
|
|
|
|
|
|
} |
2070
|
|
|
|
|
|
|
|
2071
|
|
|
|
|
|
|
=head2 license |
2072
|
|
|
|
|
|
|
|
2073
|
|
|
|
|
|
|
my $license = $api->license( |
2074
|
|
|
|
|
|
|
$license_key, |
2075
|
|
|
|
|
|
|
\%params, |
2076
|
|
|
|
|
|
|
); |
2077
|
|
|
|
|
|
|
|
2078
|
|
|
|
|
|
|
Sends a C<GET> request to C</licenses/:license_key> and returns the decoded/deserialized response body. |
2079
|
|
|
|
|
|
|
|
2080
|
|
|
|
|
|
|
=cut |
2081
|
|
|
|
|
|
|
|
2082
|
|
|
|
|
|
|
sub license { |
2083
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2084
|
0
|
0
|
0
|
|
|
|
croak 'license must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2085
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($license_key) to license must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2086
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to license must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2087
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2088
|
0
|
|
|
|
|
|
my $path = sprintf('/licenses/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2089
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2090
|
|
|
|
|
|
|
} |
2091
|
|
|
|
|
|
|
|
2092
|
|
|
|
|
|
|
=head1 NAMESPACE METHODS |
2093
|
|
|
|
|
|
|
|
2094
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/namespaces.html>. |
2095
|
|
|
|
|
|
|
|
2096
|
|
|
|
|
|
|
=head2 namespaces |
2097
|
|
|
|
|
|
|
|
2098
|
|
|
|
|
|
|
my $namespaces = $api->namespaces( |
2099
|
|
|
|
|
|
|
\%params, |
2100
|
|
|
|
|
|
|
); |
2101
|
|
|
|
|
|
|
|
2102
|
|
|
|
|
|
|
Sends a C<GET> request to C</namespaces> and returns the decoded/deserialized response body. |
2103
|
|
|
|
|
|
|
|
2104
|
|
|
|
|
|
|
=cut |
2105
|
|
|
|
|
|
|
|
2106
|
|
|
|
|
|
|
sub namespaces { |
2107
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2108
|
0
|
0
|
0
|
|
|
|
croak 'namespaces must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
2109
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to namespaces must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
2110
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
2111
|
0
|
|
|
|
|
|
my $path = sprintf('/namespaces', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2112
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2113
|
|
|
|
|
|
|
} |
2114
|
|
|
|
|
|
|
|
2115
|
|
|
|
|
|
|
=head1 NOTE METHODS |
2116
|
|
|
|
|
|
|
|
2117
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/notes.html>. |
2118
|
|
|
|
|
|
|
|
2119
|
|
|
|
|
|
|
=head2 notes |
2120
|
|
|
|
|
|
|
|
2121
|
|
|
|
|
|
|
my $notes = $api->notes( |
2122
|
|
|
|
|
|
|
$project_id, |
2123
|
|
|
|
|
|
|
$thing_type, |
2124
|
|
|
|
|
|
|
$thing_id, |
2125
|
|
|
|
|
|
|
); |
2126
|
|
|
|
|
|
|
|
2127
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/:thing_type/:thing_id/notes> and returns the decoded/deserialized response body. |
2128
|
|
|
|
|
|
|
|
2129
|
|
|
|
|
|
|
=cut |
2130
|
|
|
|
|
|
|
|
2131
|
|
|
|
|
|
|
sub notes { |
2132
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2133
|
0
|
0
|
|
|
|
|
croak 'notes must be called with 3 arguments' if @_ != 3; |
2134
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to notes must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2135
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($thing_type) to notes must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2136
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($thing_id) to notes must be a scalar' if ref($_[2]) or (!defined $_[2]); |
2137
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/%s/%s/notes', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2138
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2139
|
|
|
|
|
|
|
} |
2140
|
|
|
|
|
|
|
|
2141
|
|
|
|
|
|
|
=head2 note |
2142
|
|
|
|
|
|
|
|
2143
|
|
|
|
|
|
|
my $note = $api->note( |
2144
|
|
|
|
|
|
|
$project_id, |
2145
|
|
|
|
|
|
|
$thing_type, |
2146
|
|
|
|
|
|
|
$thing_id, |
2147
|
|
|
|
|
|
|
$note_id, |
2148
|
|
|
|
|
|
|
); |
2149
|
|
|
|
|
|
|
|
2150
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/:thing_type/:thing_id/notes/:note_id> and returns the decoded/deserialized response body. |
2151
|
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
|
=cut |
2153
|
|
|
|
|
|
|
|
2154
|
|
|
|
|
|
|
sub note { |
2155
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2156
|
0
|
0
|
|
|
|
|
croak 'note must be called with 4 arguments' if @_ != 4; |
2157
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to note must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2158
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($thing_type) to note must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2159
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($thing_id) to note must be a scalar' if ref($_[2]) or (!defined $_[2]); |
2160
|
0
|
0
|
0
|
|
|
|
croak 'The #4 argument ($note_id) to note must be a scalar' if ref($_[3]) or (!defined $_[3]); |
2161
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/%s/%s/notes/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2162
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2163
|
|
|
|
|
|
|
} |
2164
|
|
|
|
|
|
|
|
2165
|
|
|
|
|
|
|
=head2 create_note |
2166
|
|
|
|
|
|
|
|
2167
|
|
|
|
|
|
|
$api->create_note( |
2168
|
|
|
|
|
|
|
$project_id, |
2169
|
|
|
|
|
|
|
$thing_type, |
2170
|
|
|
|
|
|
|
$thing_id, |
2171
|
|
|
|
|
|
|
\%params, |
2172
|
|
|
|
|
|
|
); |
2173
|
|
|
|
|
|
|
|
2174
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/:thing_type/:thing_id/notes>. |
2175
|
|
|
|
|
|
|
|
2176
|
|
|
|
|
|
|
=cut |
2177
|
|
|
|
|
|
|
|
2178
|
|
|
|
|
|
|
sub create_note { |
2179
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2180
|
0
|
0
|
0
|
|
|
|
croak 'create_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; |
2181
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_note must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2182
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($thing_type) to create_note must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2183
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($thing_id) to create_note must be a scalar' if ref($_[2]) or (!defined $_[2]); |
2184
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; |
2185
|
0
|
0
|
|
|
|
|
my $params = (@_ == 4) ? pop() : undef; |
2186
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/%s/%s/notes', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2187
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
2188
|
0
|
|
|
|
|
|
return; |
2189
|
|
|
|
|
|
|
} |
2190
|
|
|
|
|
|
|
|
2191
|
|
|
|
|
|
|
=head2 edit_note |
2192
|
|
|
|
|
|
|
|
2193
|
|
|
|
|
|
|
$api->edit_note( |
2194
|
|
|
|
|
|
|
$project_id, |
2195
|
|
|
|
|
|
|
$thing_type, |
2196
|
|
|
|
|
|
|
$thing_id, |
2197
|
|
|
|
|
|
|
$note_id, |
2198
|
|
|
|
|
|
|
\%params, |
2199
|
|
|
|
|
|
|
); |
2200
|
|
|
|
|
|
|
|
2201
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/:thing_type/:thing_id/notes/:note_id>. |
2202
|
|
|
|
|
|
|
|
2203
|
|
|
|
|
|
|
=cut |
2204
|
|
|
|
|
|
|
|
2205
|
|
|
|
|
|
|
sub edit_note { |
2206
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2207
|
0
|
0
|
0
|
|
|
|
croak 'edit_note must be called with 4 to 5 arguments' if @_ < 4 or @_ > 5; |
2208
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_note must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2209
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($thing_type) to edit_note must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2210
|
0
|
0
|
0
|
|
|
|
croak 'The #3 argument ($thing_id) to edit_note must be a scalar' if ref($_[2]) or (!defined $_[2]); |
2211
|
0
|
0
|
0
|
|
|
|
croak 'The #4 argument ($note_id) to edit_note must be a scalar' if ref($_[3]) or (!defined $_[3]); |
2212
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_note must be a hash ref' if defined($_[4]) and ref($_[4]) ne 'HASH'; |
2213
|
0
|
0
|
|
|
|
|
my $params = (@_ == 5) ? pop() : undef; |
2214
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/%s/%s/notes/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2215
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
2216
|
0
|
|
|
|
|
|
return; |
2217
|
|
|
|
|
|
|
} |
2218
|
|
|
|
|
|
|
|
2219
|
|
|
|
|
|
|
=head1 PROJECT METHODS |
2220
|
|
|
|
|
|
|
|
2221
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/projects.html>. |
2222
|
|
|
|
|
|
|
|
2223
|
|
|
|
|
|
|
=head2 projects |
2224
|
|
|
|
|
|
|
|
2225
|
|
|
|
|
|
|
my $projects = $api->projects( |
2226
|
|
|
|
|
|
|
\%params, |
2227
|
|
|
|
|
|
|
); |
2228
|
|
|
|
|
|
|
|
2229
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects> and returns the decoded/deserialized response body. |
2230
|
|
|
|
|
|
|
|
2231
|
|
|
|
|
|
|
=cut |
2232
|
|
|
|
|
|
|
|
2233
|
|
|
|
|
|
|
sub projects { |
2234
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2235
|
0
|
0
|
0
|
|
|
|
croak 'projects must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
2236
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to projects must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
2237
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
2238
|
0
|
|
|
|
|
|
my $path = sprintf('/projects', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2239
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2240
|
|
|
|
|
|
|
} |
2241
|
|
|
|
|
|
|
|
2242
|
|
|
|
|
|
|
=head2 owned_projects |
2243
|
|
|
|
|
|
|
|
2244
|
|
|
|
|
|
|
my $projects = $api->owned_projects( |
2245
|
|
|
|
|
|
|
\%params, |
2246
|
|
|
|
|
|
|
); |
2247
|
|
|
|
|
|
|
|
2248
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/owned> and returns the decoded/deserialized response body. |
2249
|
|
|
|
|
|
|
|
2250
|
|
|
|
|
|
|
=cut |
2251
|
|
|
|
|
|
|
|
2252
|
|
|
|
|
|
|
sub owned_projects { |
2253
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2254
|
0
|
0
|
0
|
|
|
|
croak 'owned_projects must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
2255
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to owned_projects must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
2256
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
2257
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/owned', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2258
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2259
|
|
|
|
|
|
|
} |
2260
|
|
|
|
|
|
|
|
2261
|
|
|
|
|
|
|
=head2 all_projects |
2262
|
|
|
|
|
|
|
|
2263
|
|
|
|
|
|
|
my $projects = $api->all_projects( |
2264
|
|
|
|
|
|
|
\%params, |
2265
|
|
|
|
|
|
|
); |
2266
|
|
|
|
|
|
|
|
2267
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/all> and returns the decoded/deserialized response body. |
2268
|
|
|
|
|
|
|
|
2269
|
|
|
|
|
|
|
=cut |
2270
|
|
|
|
|
|
|
|
2271
|
|
|
|
|
|
|
sub all_projects { |
2272
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2273
|
0
|
0
|
0
|
|
|
|
croak 'all_projects must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
2274
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to all_projects must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
2275
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
2276
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/all', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2277
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2278
|
|
|
|
|
|
|
} |
2279
|
|
|
|
|
|
|
|
2280
|
|
|
|
|
|
|
=head2 project |
2281
|
|
|
|
|
|
|
|
2282
|
|
|
|
|
|
|
my $project = $api->project( |
2283
|
|
|
|
|
|
|
$project_id, |
2284
|
|
|
|
|
|
|
); |
2285
|
|
|
|
|
|
|
|
2286
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id> and returns the decoded/deserialized response body. |
2287
|
|
|
|
|
|
|
|
2288
|
|
|
|
|
|
|
=cut |
2289
|
|
|
|
|
|
|
|
2290
|
|
|
|
|
|
|
sub project { |
2291
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2292
|
0
|
0
|
|
|
|
|
croak 'project must be called with 1 arguments' if @_ != 1; |
2293
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to project must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2294
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2295
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2296
|
|
|
|
|
|
|
} |
2297
|
|
|
|
|
|
|
|
2298
|
|
|
|
|
|
|
=head2 project_events |
2299
|
|
|
|
|
|
|
|
2300
|
|
|
|
|
|
|
my $events = $api->project_events( |
2301
|
|
|
|
|
|
|
$project_id, |
2302
|
|
|
|
|
|
|
); |
2303
|
|
|
|
|
|
|
|
2304
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/events> and returns the decoded/deserialized response body. |
2305
|
|
|
|
|
|
|
|
2306
|
|
|
|
|
|
|
=cut |
2307
|
|
|
|
|
|
|
|
2308
|
|
|
|
|
|
|
sub project_events { |
2309
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2310
|
0
|
0
|
|
|
|
|
croak 'project_events must be called with 1 arguments' if @_ != 1; |
2311
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to project_events must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2312
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/events', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2313
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2314
|
|
|
|
|
|
|
} |
2315
|
|
|
|
|
|
|
|
2316
|
|
|
|
|
|
|
=head2 create_project |
2317
|
|
|
|
|
|
|
|
2318
|
|
|
|
|
|
|
my $project = $api->create_project( |
2319
|
|
|
|
|
|
|
\%params, |
2320
|
|
|
|
|
|
|
); |
2321
|
|
|
|
|
|
|
|
2322
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects> and returns the decoded/deserialized response body. |
2323
|
|
|
|
|
|
|
|
2324
|
|
|
|
|
|
|
=cut |
2325
|
|
|
|
|
|
|
|
2326
|
|
|
|
|
|
|
sub create_project { |
2327
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2328
|
0
|
0
|
0
|
|
|
|
croak 'create_project must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
2329
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_project must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
2330
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
2331
|
0
|
|
|
|
|
|
my $path = sprintf('/projects', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2332
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
2333
|
|
|
|
|
|
|
} |
2334
|
|
|
|
|
|
|
|
2335
|
|
|
|
|
|
|
=head2 create_project_for_user |
2336
|
|
|
|
|
|
|
|
2337
|
|
|
|
|
|
|
$api->create_project_for_user( |
2338
|
|
|
|
|
|
|
$user_id, |
2339
|
|
|
|
|
|
|
\%params, |
2340
|
|
|
|
|
|
|
); |
2341
|
|
|
|
|
|
|
|
2342
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/user/:user_id>. |
2343
|
|
|
|
|
|
|
|
2344
|
|
|
|
|
|
|
=cut |
2345
|
|
|
|
|
|
|
|
2346
|
|
|
|
|
|
|
sub create_project_for_user { |
2347
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2348
|
0
|
0
|
0
|
|
|
|
croak 'create_project_for_user must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2349
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($user_id) to create_project_for_user must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2350
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_project_for_user must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2351
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2352
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/user/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2353
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
2354
|
0
|
|
|
|
|
|
return; |
2355
|
|
|
|
|
|
|
} |
2356
|
|
|
|
|
|
|
|
2357
|
|
|
|
|
|
|
=head2 edit_project |
2358
|
|
|
|
|
|
|
|
2359
|
|
|
|
|
|
|
my $project = $api->edit_project( |
2360
|
|
|
|
|
|
|
$project_id, |
2361
|
|
|
|
|
|
|
\%params, |
2362
|
|
|
|
|
|
|
); |
2363
|
|
|
|
|
|
|
|
2364
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id> and returns the decoded/deserialized response body. |
2365
|
|
|
|
|
|
|
|
2366
|
|
|
|
|
|
|
=cut |
2367
|
|
|
|
|
|
|
|
2368
|
|
|
|
|
|
|
sub edit_project { |
2369
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2370
|
0
|
0
|
0
|
|
|
|
croak 'edit_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2371
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_project must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2372
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2373
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2374
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2375
|
0
|
0
|
|
|
|
|
return $self->put( $path, ( defined($params) ? $params : () ) ); |
2376
|
|
|
|
|
|
|
} |
2377
|
|
|
|
|
|
|
|
2378
|
|
|
|
|
|
|
=head2 fork_project |
2379
|
|
|
|
|
|
|
|
2380
|
|
|
|
|
|
|
$api->fork_project( |
2381
|
|
|
|
|
|
|
$project_id, |
2382
|
|
|
|
|
|
|
); |
2383
|
|
|
|
|
|
|
|
2384
|
|
|
|
|
|
|
Sends a C<POST> request to C</pojects/fork/:project_id>. |
2385
|
|
|
|
|
|
|
|
2386
|
|
|
|
|
|
|
=cut |
2387
|
|
|
|
|
|
|
|
2388
|
|
|
|
|
|
|
sub fork_project { |
2389
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2390
|
0
|
0
|
|
|
|
|
croak 'fork_project must be called with 1 arguments' if @_ != 1; |
2391
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to fork_project must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2392
|
0
|
|
|
|
|
|
my $path = sprintf('/pojects/fork/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2393
|
0
|
|
|
|
|
|
$self->post( $path ); |
2394
|
0
|
|
|
|
|
|
return; |
2395
|
|
|
|
|
|
|
} |
2396
|
|
|
|
|
|
|
|
2397
|
|
|
|
|
|
|
=head2 delete_project |
2398
|
|
|
|
|
|
|
|
2399
|
|
|
|
|
|
|
$api->delete_project( |
2400
|
|
|
|
|
|
|
$project_id, |
2401
|
|
|
|
|
|
|
); |
2402
|
|
|
|
|
|
|
|
2403
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id>. |
2404
|
|
|
|
|
|
|
|
2405
|
|
|
|
|
|
|
=cut |
2406
|
|
|
|
|
|
|
|
2407
|
|
|
|
|
|
|
sub delete_project { |
2408
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2409
|
0
|
0
|
|
|
|
|
croak 'delete_project must be called with 1 arguments' if @_ != 1; |
2410
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_project must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2411
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2412
|
0
|
|
|
|
|
|
$self->delete( $path ); |
2413
|
0
|
|
|
|
|
|
return; |
2414
|
|
|
|
|
|
|
} |
2415
|
|
|
|
|
|
|
|
2416
|
|
|
|
|
|
|
=head2 project_members |
2417
|
|
|
|
|
|
|
|
2418
|
|
|
|
|
|
|
my $members = $api->project_members( |
2419
|
|
|
|
|
|
|
$project_id, |
2420
|
|
|
|
|
|
|
\%params, |
2421
|
|
|
|
|
|
|
); |
2422
|
|
|
|
|
|
|
|
2423
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/members> and returns the decoded/deserialized response body. |
2424
|
|
|
|
|
|
|
|
2425
|
|
|
|
|
|
|
=cut |
2426
|
|
|
|
|
|
|
|
2427
|
|
|
|
|
|
|
sub project_members { |
2428
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2429
|
0
|
0
|
0
|
|
|
|
croak 'project_members must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2430
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to project_members must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2431
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to project_members must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2432
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2433
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/members', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2434
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2435
|
|
|
|
|
|
|
} |
2436
|
|
|
|
|
|
|
|
2437
|
|
|
|
|
|
|
=head2 project_member |
2438
|
|
|
|
|
|
|
|
2439
|
|
|
|
|
|
|
my $member = $api->project_member( |
2440
|
|
|
|
|
|
|
$project_id, |
2441
|
|
|
|
|
|
|
$user_id, |
2442
|
|
|
|
|
|
|
); |
2443
|
|
|
|
|
|
|
|
2444
|
|
|
|
|
|
|
Sends a C<GET> request to C</project/:project_id/members/:user_id> and returns the decoded/deserialized response body. |
2445
|
|
|
|
|
|
|
|
2446
|
|
|
|
|
|
|
=cut |
2447
|
|
|
|
|
|
|
|
2448
|
|
|
|
|
|
|
sub project_member { |
2449
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2450
|
0
|
0
|
|
|
|
|
croak 'project_member must be called with 2 arguments' if @_ != 2; |
2451
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2452
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($user_id) to project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2453
|
0
|
|
|
|
|
|
my $path = sprintf('/project/%s/members/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2454
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2455
|
|
|
|
|
|
|
} |
2456
|
|
|
|
|
|
|
|
2457
|
|
|
|
|
|
|
=head2 add_project_member |
2458
|
|
|
|
|
|
|
|
2459
|
|
|
|
|
|
|
$api->add_project_member( |
2460
|
|
|
|
|
|
|
$project_id, |
2461
|
|
|
|
|
|
|
\%params, |
2462
|
|
|
|
|
|
|
); |
2463
|
|
|
|
|
|
|
|
2464
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/members>. |
2465
|
|
|
|
|
|
|
|
2466
|
|
|
|
|
|
|
=cut |
2467
|
|
|
|
|
|
|
|
2468
|
|
|
|
|
|
|
sub add_project_member { |
2469
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2470
|
0
|
0
|
0
|
|
|
|
croak 'add_project_member must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2471
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to add_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2472
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to add_project_member must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2473
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2474
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/members', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2475
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
2476
|
0
|
|
|
|
|
|
return; |
2477
|
|
|
|
|
|
|
} |
2478
|
|
|
|
|
|
|
|
2479
|
|
|
|
|
|
|
=head2 edit_project_member |
2480
|
|
|
|
|
|
|
|
2481
|
|
|
|
|
|
|
$api->edit_project_member( |
2482
|
|
|
|
|
|
|
$project_id, |
2483
|
|
|
|
|
|
|
$user_id, |
2484
|
|
|
|
|
|
|
\%params, |
2485
|
|
|
|
|
|
|
); |
2486
|
|
|
|
|
|
|
|
2487
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/members/:user_id>. |
2488
|
|
|
|
|
|
|
|
2489
|
|
|
|
|
|
|
=cut |
2490
|
|
|
|
|
|
|
|
2491
|
|
|
|
|
|
|
sub edit_project_member { |
2492
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2493
|
0
|
0
|
0
|
|
|
|
croak 'edit_project_member must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
2494
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2495
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($user_id) to edit_project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2496
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_project_member must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
2497
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
2498
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/members/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2499
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
2500
|
0
|
|
|
|
|
|
return; |
2501
|
|
|
|
|
|
|
} |
2502
|
|
|
|
|
|
|
|
2503
|
|
|
|
|
|
|
=head2 remove_project_member |
2504
|
|
|
|
|
|
|
|
2505
|
|
|
|
|
|
|
$api->remove_project_member( |
2506
|
|
|
|
|
|
|
$project_id, |
2507
|
|
|
|
|
|
|
$user_id, |
2508
|
|
|
|
|
|
|
); |
2509
|
|
|
|
|
|
|
|
2510
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/members/:user_id>. |
2511
|
|
|
|
|
|
|
|
2512
|
|
|
|
|
|
|
=cut |
2513
|
|
|
|
|
|
|
|
2514
|
|
|
|
|
|
|
sub remove_project_member { |
2515
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2516
|
0
|
0
|
|
|
|
|
croak 'remove_project_member must be called with 2 arguments' if @_ != 2; |
2517
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to remove_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2518
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($user_id) to remove_project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2519
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/members/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2520
|
0
|
|
|
|
|
|
$self->delete( $path ); |
2521
|
0
|
|
|
|
|
|
return; |
2522
|
|
|
|
|
|
|
} |
2523
|
|
|
|
|
|
|
|
2524
|
|
|
|
|
|
|
=head2 share_project_with_group |
2525
|
|
|
|
|
|
|
|
2526
|
|
|
|
|
|
|
$api->share_project_with_group( |
2527
|
|
|
|
|
|
|
$id, |
2528
|
|
|
|
|
|
|
\%params, |
2529
|
|
|
|
|
|
|
); |
2530
|
|
|
|
|
|
|
|
2531
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/share>. |
2532
|
|
|
|
|
|
|
|
2533
|
|
|
|
|
|
|
=cut |
2534
|
|
|
|
|
|
|
|
2535
|
|
|
|
|
|
|
sub share_project_with_group { |
2536
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2537
|
0
|
0
|
0
|
|
|
|
croak 'share_project_with_group must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2538
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to share_project_with_group must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2539
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to share_project_with_group must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2540
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2541
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/share', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2542
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
2543
|
0
|
|
|
|
|
|
return; |
2544
|
|
|
|
|
|
|
} |
2545
|
|
|
|
|
|
|
|
2546
|
|
|
|
|
|
|
=head2 delete_shared_project_link_within_group |
2547
|
|
|
|
|
|
|
|
2548
|
|
|
|
|
|
|
$api->delete_shared_project_link_within_group( |
2549
|
|
|
|
|
|
|
$id, |
2550
|
|
|
|
|
|
|
$group_id, |
2551
|
|
|
|
|
|
|
); |
2552
|
|
|
|
|
|
|
|
2553
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:id/share/:group_id>. |
2554
|
|
|
|
|
|
|
|
2555
|
|
|
|
|
|
|
=cut |
2556
|
|
|
|
|
|
|
|
2557
|
|
|
|
|
|
|
sub delete_shared_project_link_within_group { |
2558
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2559
|
0
|
0
|
|
|
|
|
croak 'delete_shared_project_link_within_group must be called with 2 arguments' if @_ != 2; |
2560
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to delete_shared_project_link_within_group must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2561
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($group_id) to delete_shared_project_link_within_group must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2562
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/share/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2563
|
0
|
|
|
|
|
|
$self->delete( $path ); |
2564
|
0
|
|
|
|
|
|
return; |
2565
|
|
|
|
|
|
|
} |
2566
|
|
|
|
|
|
|
|
2567
|
|
|
|
|
|
|
=head2 project_hooks |
2568
|
|
|
|
|
|
|
|
2569
|
|
|
|
|
|
|
my $hooks = $api->project_hooks( |
2570
|
|
|
|
|
|
|
$project_id, |
2571
|
|
|
|
|
|
|
); |
2572
|
|
|
|
|
|
|
|
2573
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/hooks> and returns the decoded/deserialized response body. |
2574
|
|
|
|
|
|
|
|
2575
|
|
|
|
|
|
|
=cut |
2576
|
|
|
|
|
|
|
|
2577
|
|
|
|
|
|
|
sub project_hooks { |
2578
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2579
|
0
|
0
|
|
|
|
|
croak 'project_hooks must be called with 1 arguments' if @_ != 1; |
2580
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to project_hooks must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2581
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/hooks', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2582
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2583
|
|
|
|
|
|
|
} |
2584
|
|
|
|
|
|
|
|
2585
|
|
|
|
|
|
|
=head2 project_hook |
2586
|
|
|
|
|
|
|
|
2587
|
|
|
|
|
|
|
my $hook = $api->project_hook( |
2588
|
|
|
|
|
|
|
$project_id, |
2589
|
|
|
|
|
|
|
$hook_id, |
2590
|
|
|
|
|
|
|
); |
2591
|
|
|
|
|
|
|
|
2592
|
|
|
|
|
|
|
Sends a C<GET> request to C</project/:project_id/hooks/:hook_id> and returns the decoded/deserialized response body. |
2593
|
|
|
|
|
|
|
|
2594
|
|
|
|
|
|
|
=cut |
2595
|
|
|
|
|
|
|
|
2596
|
|
|
|
|
|
|
sub project_hook { |
2597
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2598
|
0
|
0
|
|
|
|
|
croak 'project_hook must be called with 2 arguments' if @_ != 2; |
2599
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2600
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($hook_id) to project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2601
|
0
|
|
|
|
|
|
my $path = sprintf('/project/%s/hooks/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2602
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2603
|
|
|
|
|
|
|
} |
2604
|
|
|
|
|
|
|
|
2605
|
|
|
|
|
|
|
=head2 create_project_hook |
2606
|
|
|
|
|
|
|
|
2607
|
|
|
|
|
|
|
$api->create_project_hook( |
2608
|
|
|
|
|
|
|
$project_id, |
2609
|
|
|
|
|
|
|
\%params, |
2610
|
|
|
|
|
|
|
); |
2611
|
|
|
|
|
|
|
|
2612
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/hooks>. |
2613
|
|
|
|
|
|
|
|
2614
|
|
|
|
|
|
|
=cut |
2615
|
|
|
|
|
|
|
|
2616
|
|
|
|
|
|
|
sub create_project_hook { |
2617
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2618
|
0
|
0
|
0
|
|
|
|
croak 'create_project_hook must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2619
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2620
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_project_hook must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2621
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2622
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/hooks', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2623
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
2624
|
0
|
|
|
|
|
|
return; |
2625
|
|
|
|
|
|
|
} |
2626
|
|
|
|
|
|
|
|
2627
|
|
|
|
|
|
|
=head2 edit_project_hook |
2628
|
|
|
|
|
|
|
|
2629
|
|
|
|
|
|
|
$api->edit_project_hook( |
2630
|
|
|
|
|
|
|
$project_id, |
2631
|
|
|
|
|
|
|
$hook_id, |
2632
|
|
|
|
|
|
|
\%params, |
2633
|
|
|
|
|
|
|
); |
2634
|
|
|
|
|
|
|
|
2635
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/hooks/:hook_id>. |
2636
|
|
|
|
|
|
|
|
2637
|
|
|
|
|
|
|
=cut |
2638
|
|
|
|
|
|
|
|
2639
|
|
|
|
|
|
|
sub edit_project_hook { |
2640
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2641
|
0
|
0
|
0
|
|
|
|
croak 'edit_project_hook must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
2642
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2643
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($hook_id) to edit_project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2644
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_project_hook must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
2645
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
2646
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/hooks/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2647
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
2648
|
0
|
|
|
|
|
|
return; |
2649
|
|
|
|
|
|
|
} |
2650
|
|
|
|
|
|
|
|
2651
|
|
|
|
|
|
|
=head2 delete_project_hook |
2652
|
|
|
|
|
|
|
|
2653
|
|
|
|
|
|
|
my $hook = $api->delete_project_hook( |
2654
|
|
|
|
|
|
|
$project_id, |
2655
|
|
|
|
|
|
|
$hook_id, |
2656
|
|
|
|
|
|
|
); |
2657
|
|
|
|
|
|
|
|
2658
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/hooks/:hook_id> and returns the decoded/deserialized response body. |
2659
|
|
|
|
|
|
|
|
2660
|
|
|
|
|
|
|
=cut |
2661
|
|
|
|
|
|
|
|
2662
|
|
|
|
|
|
|
sub delete_project_hook { |
2663
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2664
|
0
|
0
|
|
|
|
|
croak 'delete_project_hook must be called with 2 arguments' if @_ != 2; |
2665
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2666
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($hook_id) to delete_project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2667
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/hooks/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2668
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
2669
|
|
|
|
|
|
|
} |
2670
|
|
|
|
|
|
|
|
2671
|
|
|
|
|
|
|
=head2 set_project_fork |
2672
|
|
|
|
|
|
|
|
2673
|
|
|
|
|
|
|
$api->set_project_fork( |
2674
|
|
|
|
|
|
|
$project_id, |
2675
|
|
|
|
|
|
|
$forked_from_id, |
2676
|
|
|
|
|
|
|
); |
2677
|
|
|
|
|
|
|
|
2678
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/fork/:forked_from_id>. |
2679
|
|
|
|
|
|
|
|
2680
|
|
|
|
|
|
|
=cut |
2681
|
|
|
|
|
|
|
|
2682
|
|
|
|
|
|
|
sub set_project_fork { |
2683
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2684
|
0
|
0
|
|
|
|
|
croak 'set_project_fork must be called with 2 arguments' if @_ != 2; |
2685
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to set_project_fork must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2686
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($forked_from_id) to set_project_fork must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2687
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/fork/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2688
|
0
|
|
|
|
|
|
$self->post( $path ); |
2689
|
0
|
|
|
|
|
|
return; |
2690
|
|
|
|
|
|
|
} |
2691
|
|
|
|
|
|
|
|
2692
|
|
|
|
|
|
|
=head2 clear_project_fork |
2693
|
|
|
|
|
|
|
|
2694
|
|
|
|
|
|
|
$api->clear_project_fork( |
2695
|
|
|
|
|
|
|
$project_id, |
2696
|
|
|
|
|
|
|
); |
2697
|
|
|
|
|
|
|
|
2698
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/fork>. |
2699
|
|
|
|
|
|
|
|
2700
|
|
|
|
|
|
|
=cut |
2701
|
|
|
|
|
|
|
|
2702
|
|
|
|
|
|
|
sub clear_project_fork { |
2703
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2704
|
0
|
0
|
|
|
|
|
croak 'clear_project_fork must be called with 1 arguments' if @_ != 1; |
2705
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to clear_project_fork must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2706
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/fork', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2707
|
0
|
|
|
|
|
|
$self->delete( $path ); |
2708
|
0
|
|
|
|
|
|
return; |
2709
|
|
|
|
|
|
|
} |
2710
|
|
|
|
|
|
|
|
2711
|
|
|
|
|
|
|
=head2 search_projects_by_name |
2712
|
|
|
|
|
|
|
|
2713
|
|
|
|
|
|
|
my $projects = $api->search_projects_by_name( |
2714
|
|
|
|
|
|
|
$query, |
2715
|
|
|
|
|
|
|
\%params, |
2716
|
|
|
|
|
|
|
); |
2717
|
|
|
|
|
|
|
|
2718
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/search/:query> and returns the decoded/deserialized response body. |
2719
|
|
|
|
|
|
|
|
2720
|
|
|
|
|
|
|
=cut |
2721
|
|
|
|
|
|
|
|
2722
|
|
|
|
|
|
|
sub search_projects_by_name { |
2723
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2724
|
0
|
0
|
0
|
|
|
|
croak 'search_projects_by_name must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2725
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($query) to search_projects_by_name must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2726
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to search_projects_by_name must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2727
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2728
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/search/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2729
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2730
|
|
|
|
|
|
|
} |
2731
|
|
|
|
|
|
|
|
2732
|
|
|
|
|
|
|
=head1 PROJECT SNIPPET METHODS |
2733
|
|
|
|
|
|
|
|
2734
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/project_snippets.html>. |
2735
|
|
|
|
|
|
|
|
2736
|
|
|
|
|
|
|
=head2 snippets |
2737
|
|
|
|
|
|
|
|
2738
|
|
|
|
|
|
|
my $snippets = $api->snippets( |
2739
|
|
|
|
|
|
|
$project_id, |
2740
|
|
|
|
|
|
|
); |
2741
|
|
|
|
|
|
|
|
2742
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/snippets> and returns the decoded/deserialized response body. |
2743
|
|
|
|
|
|
|
|
2744
|
|
|
|
|
|
|
=cut |
2745
|
|
|
|
|
|
|
|
2746
|
|
|
|
|
|
|
sub snippets { |
2747
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2748
|
0
|
0
|
|
|
|
|
croak 'snippets must be called with 1 arguments' if @_ != 1; |
2749
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to snippets must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2750
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/snippets', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2751
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2752
|
|
|
|
|
|
|
} |
2753
|
|
|
|
|
|
|
|
2754
|
|
|
|
|
|
|
=head2 snippet |
2755
|
|
|
|
|
|
|
|
2756
|
|
|
|
|
|
|
my $snippet = $api->snippet( |
2757
|
|
|
|
|
|
|
$project_id, |
2758
|
|
|
|
|
|
|
$snippet_id, |
2759
|
|
|
|
|
|
|
); |
2760
|
|
|
|
|
|
|
|
2761
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/snippets/:snippet_id> and returns the decoded/deserialized response body. |
2762
|
|
|
|
|
|
|
|
2763
|
|
|
|
|
|
|
=cut |
2764
|
|
|
|
|
|
|
|
2765
|
|
|
|
|
|
|
sub snippet { |
2766
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2767
|
0
|
0
|
|
|
|
|
croak 'snippet must be called with 2 arguments' if @_ != 2; |
2768
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2769
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($snippet_id) to snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2770
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/snippets/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2771
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2772
|
|
|
|
|
|
|
} |
2773
|
|
|
|
|
|
|
|
2774
|
|
|
|
|
|
|
=head2 create_snippet |
2775
|
|
|
|
|
|
|
|
2776
|
|
|
|
|
|
|
$api->create_snippet( |
2777
|
|
|
|
|
|
|
$project_id, |
2778
|
|
|
|
|
|
|
\%params, |
2779
|
|
|
|
|
|
|
); |
2780
|
|
|
|
|
|
|
|
2781
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/snippets>. |
2782
|
|
|
|
|
|
|
|
2783
|
|
|
|
|
|
|
=cut |
2784
|
|
|
|
|
|
|
|
2785
|
|
|
|
|
|
|
sub create_snippet { |
2786
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2787
|
0
|
0
|
0
|
|
|
|
croak 'create_snippet must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2788
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2789
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_snippet must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2790
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2791
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/snippets', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2792
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
2793
|
0
|
|
|
|
|
|
return; |
2794
|
|
|
|
|
|
|
} |
2795
|
|
|
|
|
|
|
|
2796
|
|
|
|
|
|
|
=head2 edit_snippet |
2797
|
|
|
|
|
|
|
|
2798
|
|
|
|
|
|
|
$api->edit_snippet( |
2799
|
|
|
|
|
|
|
$project_id, |
2800
|
|
|
|
|
|
|
$snippet_id, |
2801
|
|
|
|
|
|
|
\%params, |
2802
|
|
|
|
|
|
|
); |
2803
|
|
|
|
|
|
|
|
2804
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/snippets/:snippet_id>. |
2805
|
|
|
|
|
|
|
|
2806
|
|
|
|
|
|
|
=cut |
2807
|
|
|
|
|
|
|
|
2808
|
|
|
|
|
|
|
sub edit_snippet { |
2809
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2810
|
0
|
0
|
0
|
|
|
|
croak 'edit_snippet must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
2811
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2812
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($snippet_id) to edit_snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2813
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_snippet must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
2814
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
2815
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/snippets/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2816
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
2817
|
0
|
|
|
|
|
|
return; |
2818
|
|
|
|
|
|
|
} |
2819
|
|
|
|
|
|
|
|
2820
|
|
|
|
|
|
|
=head2 delete_snippet |
2821
|
|
|
|
|
|
|
|
2822
|
|
|
|
|
|
|
$api->delete_snippet( |
2823
|
|
|
|
|
|
|
$project_id, |
2824
|
|
|
|
|
|
|
$snippet_id, |
2825
|
|
|
|
|
|
|
); |
2826
|
|
|
|
|
|
|
|
2827
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/snippets/:snippet_id>. |
2828
|
|
|
|
|
|
|
|
2829
|
|
|
|
|
|
|
=cut |
2830
|
|
|
|
|
|
|
|
2831
|
|
|
|
|
|
|
sub delete_snippet { |
2832
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2833
|
0
|
0
|
|
|
|
|
croak 'delete_snippet must be called with 2 arguments' if @_ != 2; |
2834
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2835
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($snippet_id) to delete_snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2836
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/snippets/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2837
|
0
|
|
|
|
|
|
$self->delete( $path ); |
2838
|
0
|
|
|
|
|
|
return; |
2839
|
|
|
|
|
|
|
} |
2840
|
|
|
|
|
|
|
|
2841
|
|
|
|
|
|
|
=head2 snippet_content |
2842
|
|
|
|
|
|
|
|
2843
|
|
|
|
|
|
|
my $content = $api->snippet_content( |
2844
|
|
|
|
|
|
|
$project_id, |
2845
|
|
|
|
|
|
|
$snippet_id, |
2846
|
|
|
|
|
|
|
); |
2847
|
|
|
|
|
|
|
|
2848
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/snippets/:snippet_id/raw> and returns the decoded/deserialized response body. |
2849
|
|
|
|
|
|
|
|
2850
|
|
|
|
|
|
|
=cut |
2851
|
|
|
|
|
|
|
|
2852
|
|
|
|
|
|
|
sub snippet_content { |
2853
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2854
|
0
|
0
|
|
|
|
|
croak 'snippet_content must be called with 2 arguments' if @_ != 2; |
2855
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to snippet_content must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2856
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($snippet_id) to snippet_content must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2857
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/snippets/%s/raw', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2858
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2859
|
|
|
|
|
|
|
} |
2860
|
|
|
|
|
|
|
|
2861
|
|
|
|
|
|
|
=head1 REPOSITORY METHODS |
2862
|
|
|
|
|
|
|
|
2863
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/repositories.html>. |
2864
|
|
|
|
|
|
|
|
2865
|
|
|
|
|
|
|
=head2 tree |
2866
|
|
|
|
|
|
|
|
2867
|
|
|
|
|
|
|
my $tree = $api->tree( |
2868
|
|
|
|
|
|
|
$project_id, |
2869
|
|
|
|
|
|
|
\%params, |
2870
|
|
|
|
|
|
|
); |
2871
|
|
|
|
|
|
|
|
2872
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/tree> and returns the decoded/deserialized response body. |
2873
|
|
|
|
|
|
|
|
2874
|
|
|
|
|
|
|
=cut |
2875
|
|
|
|
|
|
|
|
2876
|
|
|
|
|
|
|
sub tree { |
2877
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2878
|
0
|
0
|
0
|
|
|
|
croak 'tree must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2879
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to tree must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2880
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to tree must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2881
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2882
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/tree', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2883
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2884
|
|
|
|
|
|
|
} |
2885
|
|
|
|
|
|
|
|
2886
|
|
|
|
|
|
|
=head2 blob |
2887
|
|
|
|
|
|
|
|
2888
|
|
|
|
|
|
|
my $blob = $api->blob( |
2889
|
|
|
|
|
|
|
$project_id, |
2890
|
|
|
|
|
|
|
$ref, |
2891
|
|
|
|
|
|
|
\%params, |
2892
|
|
|
|
|
|
|
); |
2893
|
|
|
|
|
|
|
|
2894
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/blobs/:ref> and returns the decoded/deserialized response body. |
2895
|
|
|
|
|
|
|
|
2896
|
|
|
|
|
|
|
=cut |
2897
|
|
|
|
|
|
|
|
2898
|
|
|
|
|
|
|
sub blob { |
2899
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2900
|
0
|
0
|
0
|
|
|
|
croak 'blob must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
2901
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to blob must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2902
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($ref) to blob must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2903
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to blob must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
2904
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
2905
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/blobs/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2906
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2907
|
|
|
|
|
|
|
} |
2908
|
|
|
|
|
|
|
|
2909
|
|
|
|
|
|
|
=head2 raw_blob |
2910
|
|
|
|
|
|
|
|
2911
|
|
|
|
|
|
|
my $raw_blob = $api->raw_blob( |
2912
|
|
|
|
|
|
|
$project_id, |
2913
|
|
|
|
|
|
|
$blob_sha, |
2914
|
|
|
|
|
|
|
); |
2915
|
|
|
|
|
|
|
|
2916
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/raw_blobs/:blob_sha> and returns the decoded/deserialized response body. |
2917
|
|
|
|
|
|
|
|
2918
|
|
|
|
|
|
|
=cut |
2919
|
|
|
|
|
|
|
|
2920
|
|
|
|
|
|
|
sub raw_blob { |
2921
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2922
|
0
|
0
|
|
|
|
|
croak 'raw_blob must be called with 2 arguments' if @_ != 2; |
2923
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to raw_blob must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2924
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($blob_sha) to raw_blob must be a scalar' if ref($_[1]) or (!defined $_[1]); |
2925
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/raw_blobs/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2926
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2927
|
|
|
|
|
|
|
} |
2928
|
|
|
|
|
|
|
|
2929
|
|
|
|
|
|
|
=head2 archive |
2930
|
|
|
|
|
|
|
|
2931
|
|
|
|
|
|
|
my $archive = $api->archive( |
2932
|
|
|
|
|
|
|
$project_id, |
2933
|
|
|
|
|
|
|
\%params, |
2934
|
|
|
|
|
|
|
); |
2935
|
|
|
|
|
|
|
|
2936
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/archive> and returns the decoded/deserialized response body. |
2937
|
|
|
|
|
|
|
|
2938
|
|
|
|
|
|
|
=cut |
2939
|
|
|
|
|
|
|
|
2940
|
|
|
|
|
|
|
sub archive { |
2941
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2942
|
0
|
0
|
0
|
|
|
|
croak 'archive must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2943
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to archive must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2944
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to archive must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2945
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2946
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/archive', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2947
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2948
|
|
|
|
|
|
|
} |
2949
|
|
|
|
|
|
|
|
2950
|
|
|
|
|
|
|
=head2 compare |
2951
|
|
|
|
|
|
|
|
2952
|
|
|
|
|
|
|
my $comparison = $api->compare( |
2953
|
|
|
|
|
|
|
$project_id, |
2954
|
|
|
|
|
|
|
\%params, |
2955
|
|
|
|
|
|
|
); |
2956
|
|
|
|
|
|
|
|
2957
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/compare> and returns the decoded/deserialized response body. |
2958
|
|
|
|
|
|
|
|
2959
|
|
|
|
|
|
|
=cut |
2960
|
|
|
|
|
|
|
|
2961
|
|
|
|
|
|
|
sub compare { |
2962
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2963
|
0
|
0
|
0
|
|
|
|
croak 'compare must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
2964
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to compare must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2965
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to compare must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
2966
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
2967
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/compare', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2968
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
2969
|
|
|
|
|
|
|
} |
2970
|
|
|
|
|
|
|
|
2971
|
|
|
|
|
|
|
=head2 contributors |
2972
|
|
|
|
|
|
|
|
2973
|
|
|
|
|
|
|
my $contributors = $api->contributors( |
2974
|
|
|
|
|
|
|
$project_id, |
2975
|
|
|
|
|
|
|
); |
2976
|
|
|
|
|
|
|
|
2977
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/contributors> and returns the decoded/deserialized response body. |
2978
|
|
|
|
|
|
|
|
2979
|
|
|
|
|
|
|
=cut |
2980
|
|
|
|
|
|
|
|
2981
|
|
|
|
|
|
|
sub contributors { |
2982
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
2983
|
0
|
0
|
|
|
|
|
croak 'contributors must be called with 1 arguments' if @_ != 1; |
2984
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to contributors must be a scalar' if ref($_[0]) or (!defined $_[0]); |
2985
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/contributors', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
2986
|
0
|
|
|
|
|
|
return $self->get( $path ); |
2987
|
|
|
|
|
|
|
} |
2988
|
|
|
|
|
|
|
|
2989
|
|
|
|
|
|
|
=head1 FILE METHODS |
2990
|
|
|
|
|
|
|
|
2991
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/repository_files.html>. |
2992
|
|
|
|
|
|
|
|
2993
|
|
|
|
|
|
|
=head2 file |
2994
|
|
|
|
|
|
|
|
2995
|
|
|
|
|
|
|
my $file = $api->file( |
2996
|
|
|
|
|
|
|
$project_id, |
2997
|
|
|
|
|
|
|
\%params, |
2998
|
|
|
|
|
|
|
); |
2999
|
|
|
|
|
|
|
|
3000
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/files> and returns the decoded/deserialized response body. |
3001
|
|
|
|
|
|
|
|
3002
|
|
|
|
|
|
|
=cut |
3003
|
|
|
|
|
|
|
|
3004
|
|
|
|
|
|
|
sub file { |
3005
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3006
|
0
|
0
|
0
|
|
|
|
croak 'file must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3007
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to file must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3008
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to file must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3009
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3010
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/files', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3011
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
3012
|
|
|
|
|
|
|
} |
3013
|
|
|
|
|
|
|
|
3014
|
|
|
|
|
|
|
=head2 create_file |
3015
|
|
|
|
|
|
|
|
3016
|
|
|
|
|
|
|
$api->create_file( |
3017
|
|
|
|
|
|
|
$project_id, |
3018
|
|
|
|
|
|
|
\%params, |
3019
|
|
|
|
|
|
|
); |
3020
|
|
|
|
|
|
|
|
3021
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/repository/files>. |
3022
|
|
|
|
|
|
|
|
3023
|
|
|
|
|
|
|
=cut |
3024
|
|
|
|
|
|
|
|
3025
|
|
|
|
|
|
|
sub create_file { |
3026
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3027
|
0
|
0
|
0
|
|
|
|
croak 'create_file must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3028
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_file must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3029
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_file must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3030
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3031
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/files', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3032
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
3033
|
0
|
|
|
|
|
|
return; |
3034
|
|
|
|
|
|
|
} |
3035
|
|
|
|
|
|
|
|
3036
|
|
|
|
|
|
|
=head2 edit_file |
3037
|
|
|
|
|
|
|
|
3038
|
|
|
|
|
|
|
$api->edit_file( |
3039
|
|
|
|
|
|
|
$project_id, |
3040
|
|
|
|
|
|
|
\%params, |
3041
|
|
|
|
|
|
|
); |
3042
|
|
|
|
|
|
|
|
3043
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/repository/files>. |
3044
|
|
|
|
|
|
|
|
3045
|
|
|
|
|
|
|
=cut |
3046
|
|
|
|
|
|
|
|
3047
|
|
|
|
|
|
|
sub edit_file { |
3048
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3049
|
0
|
0
|
0
|
|
|
|
croak 'edit_file must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3050
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_file must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3051
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_file must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3052
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3053
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/files', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3054
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
3055
|
0
|
|
|
|
|
|
return; |
3056
|
|
|
|
|
|
|
} |
3057
|
|
|
|
|
|
|
|
3058
|
|
|
|
|
|
|
=head2 delete_file |
3059
|
|
|
|
|
|
|
|
3060
|
|
|
|
|
|
|
$api->delete_file( |
3061
|
|
|
|
|
|
|
$project_id, |
3062
|
|
|
|
|
|
|
\%params, |
3063
|
|
|
|
|
|
|
); |
3064
|
|
|
|
|
|
|
|
3065
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/repository/files>. |
3066
|
|
|
|
|
|
|
|
3067
|
|
|
|
|
|
|
=cut |
3068
|
|
|
|
|
|
|
|
3069
|
|
|
|
|
|
|
sub delete_file { |
3070
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3071
|
0
|
0
|
0
|
|
|
|
croak 'delete_file must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3072
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_file must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3073
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to delete_file must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3074
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3075
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/files', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3076
|
0
|
0
|
|
|
|
|
$self->delete( $path, ( defined($params) ? $params : () ) ); |
3077
|
0
|
|
|
|
|
|
return; |
3078
|
|
|
|
|
|
|
} |
3079
|
|
|
|
|
|
|
|
3080
|
|
|
|
|
|
|
=head1 RUNNER METHODS |
3081
|
|
|
|
|
|
|
|
3082
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/runners.html>. |
3083
|
|
|
|
|
|
|
|
3084
|
|
|
|
|
|
|
=head2 runners |
3085
|
|
|
|
|
|
|
|
3086
|
|
|
|
|
|
|
my $runners = $api->runners( |
3087
|
|
|
|
|
|
|
\%params, |
3088
|
|
|
|
|
|
|
); |
3089
|
|
|
|
|
|
|
|
3090
|
|
|
|
|
|
|
Sends a C<GET> request to C</runners> and returns the decoded/deserialized response body. |
3091
|
|
|
|
|
|
|
|
3092
|
|
|
|
|
|
|
=cut |
3093
|
|
|
|
|
|
|
|
3094
|
|
|
|
|
|
|
sub runners { |
3095
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3096
|
0
|
0
|
0
|
|
|
|
croak 'runners must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3097
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to runners must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3098
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3099
|
0
|
|
|
|
|
|
my $path = sprintf('/runners', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3100
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
3101
|
|
|
|
|
|
|
} |
3102
|
|
|
|
|
|
|
|
3103
|
|
|
|
|
|
|
=head2 all_runners |
3104
|
|
|
|
|
|
|
|
3105
|
|
|
|
|
|
|
my $runners = $api->all_runners( |
3106
|
|
|
|
|
|
|
\%params, |
3107
|
|
|
|
|
|
|
); |
3108
|
|
|
|
|
|
|
|
3109
|
|
|
|
|
|
|
Sends a C<GET> request to C</runners/all> and returns the decoded/deserialized response body. |
3110
|
|
|
|
|
|
|
|
3111
|
|
|
|
|
|
|
=cut |
3112
|
|
|
|
|
|
|
|
3113
|
|
|
|
|
|
|
sub all_runners { |
3114
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3115
|
0
|
0
|
0
|
|
|
|
croak 'all_runners must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3116
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to all_runners must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3117
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3118
|
0
|
|
|
|
|
|
my $path = sprintf('/runners/all', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3119
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
3120
|
|
|
|
|
|
|
} |
3121
|
|
|
|
|
|
|
|
3122
|
|
|
|
|
|
|
=head2 runner |
3123
|
|
|
|
|
|
|
|
3124
|
|
|
|
|
|
|
my $runner = $api->runner( |
3125
|
|
|
|
|
|
|
$id, |
3126
|
|
|
|
|
|
|
); |
3127
|
|
|
|
|
|
|
|
3128
|
|
|
|
|
|
|
Sends a C<GET> request to C</runners/:id> and returns the decoded/deserialized response body. |
3129
|
|
|
|
|
|
|
|
3130
|
|
|
|
|
|
|
=cut |
3131
|
|
|
|
|
|
|
|
3132
|
|
|
|
|
|
|
sub runner { |
3133
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3134
|
0
|
0
|
|
|
|
|
croak 'runner must be called with 1 arguments' if @_ != 1; |
3135
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to runner must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3136
|
0
|
|
|
|
|
|
my $path = sprintf('/runners/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3137
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3138
|
|
|
|
|
|
|
} |
3139
|
|
|
|
|
|
|
|
3140
|
|
|
|
|
|
|
=head2 update_runner |
3141
|
|
|
|
|
|
|
|
3142
|
|
|
|
|
|
|
my $runner = $api->update_runner( |
3143
|
|
|
|
|
|
|
$id, |
3144
|
|
|
|
|
|
|
\%params, |
3145
|
|
|
|
|
|
|
); |
3146
|
|
|
|
|
|
|
|
3147
|
|
|
|
|
|
|
Sends a C<PUT> request to C</runners/:id> and returns the decoded/deserialized response body. |
3148
|
|
|
|
|
|
|
|
3149
|
|
|
|
|
|
|
=cut |
3150
|
|
|
|
|
|
|
|
3151
|
|
|
|
|
|
|
sub update_runner { |
3152
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3153
|
0
|
0
|
0
|
|
|
|
croak 'update_runner must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3154
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to update_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3155
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to update_runner must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3156
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3157
|
0
|
|
|
|
|
|
my $path = sprintf('/runners/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3158
|
0
|
0
|
|
|
|
|
return $self->put( $path, ( defined($params) ? $params : () ) ); |
3159
|
|
|
|
|
|
|
} |
3160
|
|
|
|
|
|
|
|
3161
|
|
|
|
|
|
|
=head2 delete_runner |
3162
|
|
|
|
|
|
|
|
3163
|
|
|
|
|
|
|
my $runner = $api->delete_runner( |
3164
|
|
|
|
|
|
|
$id, |
3165
|
|
|
|
|
|
|
); |
3166
|
|
|
|
|
|
|
|
3167
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</runners/:id> and returns the decoded/deserialized response body. |
3168
|
|
|
|
|
|
|
|
3169
|
|
|
|
|
|
|
=cut |
3170
|
|
|
|
|
|
|
|
3171
|
|
|
|
|
|
|
sub delete_runner { |
3172
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3173
|
0
|
0
|
|
|
|
|
croak 'delete_runner must be called with 1 arguments' if @_ != 1; |
3174
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to delete_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3175
|
0
|
|
|
|
|
|
my $path = sprintf('/runners/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3176
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
3177
|
|
|
|
|
|
|
} |
3178
|
|
|
|
|
|
|
|
3179
|
|
|
|
|
|
|
=head2 project_runners |
3180
|
|
|
|
|
|
|
|
3181
|
|
|
|
|
|
|
my $runners = $api->project_runners( |
3182
|
|
|
|
|
|
|
$id, |
3183
|
|
|
|
|
|
|
); |
3184
|
|
|
|
|
|
|
|
3185
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:id/runners> and returns the decoded/deserialized response body. |
3186
|
|
|
|
|
|
|
|
3187
|
|
|
|
|
|
|
=cut |
3188
|
|
|
|
|
|
|
|
3189
|
|
|
|
|
|
|
sub project_runners { |
3190
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3191
|
0
|
0
|
|
|
|
|
croak 'project_runners must be called with 1 arguments' if @_ != 1; |
3192
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to project_runners must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3193
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/runners', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3194
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3195
|
|
|
|
|
|
|
} |
3196
|
|
|
|
|
|
|
|
3197
|
|
|
|
|
|
|
=head2 enable_project_runner |
3198
|
|
|
|
|
|
|
|
3199
|
|
|
|
|
|
|
my $runner = $api->enable_project_runner( |
3200
|
|
|
|
|
|
|
$id, |
3201
|
|
|
|
|
|
|
\%params, |
3202
|
|
|
|
|
|
|
); |
3203
|
|
|
|
|
|
|
|
3204
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:id/runners> and returns the decoded/deserialized response body. |
3205
|
|
|
|
|
|
|
|
3206
|
|
|
|
|
|
|
=cut |
3207
|
|
|
|
|
|
|
|
3208
|
|
|
|
|
|
|
sub enable_project_runner { |
3209
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3210
|
0
|
0
|
0
|
|
|
|
croak 'enable_project_runner must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3211
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to enable_project_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3212
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to enable_project_runner must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3213
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3214
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/runners', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3215
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
3216
|
|
|
|
|
|
|
} |
3217
|
|
|
|
|
|
|
|
3218
|
|
|
|
|
|
|
=head2 disable_project_runner |
3219
|
|
|
|
|
|
|
|
3220
|
|
|
|
|
|
|
my $runner = $api->disable_project_runner( |
3221
|
|
|
|
|
|
|
$id, |
3222
|
|
|
|
|
|
|
$runner_id, |
3223
|
|
|
|
|
|
|
); |
3224
|
|
|
|
|
|
|
|
3225
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:id/runners/:runner_id> and returns the decoded/deserialized response body. |
3226
|
|
|
|
|
|
|
|
3227
|
|
|
|
|
|
|
=cut |
3228
|
|
|
|
|
|
|
|
3229
|
|
|
|
|
|
|
sub disable_project_runner { |
3230
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3231
|
0
|
0
|
|
|
|
|
croak 'disable_project_runner must be called with 2 arguments' if @_ != 2; |
3232
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($id) to disable_project_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3233
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($runner_id) to disable_project_runner must be a scalar' if ref($_[1]) or (!defined $_[1]); |
3234
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/runners/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3235
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
3236
|
|
|
|
|
|
|
} |
3237
|
|
|
|
|
|
|
|
3238
|
|
|
|
|
|
|
=head1 SERVICE METHODS |
3239
|
|
|
|
|
|
|
|
3240
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/services.html>. |
3241
|
|
|
|
|
|
|
|
3242
|
|
|
|
|
|
|
=head2 edit_project_service |
3243
|
|
|
|
|
|
|
|
3244
|
|
|
|
|
|
|
$api->edit_project_service( |
3245
|
|
|
|
|
|
|
$project_id, |
3246
|
|
|
|
|
|
|
$service_name, |
3247
|
|
|
|
|
|
|
\%params, |
3248
|
|
|
|
|
|
|
); |
3249
|
|
|
|
|
|
|
|
3250
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/services/:service_name>. |
3251
|
|
|
|
|
|
|
|
3252
|
|
|
|
|
|
|
=cut |
3253
|
|
|
|
|
|
|
|
3254
|
|
|
|
|
|
|
sub edit_project_service { |
3255
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3256
|
0
|
0
|
0
|
|
|
|
croak 'edit_project_service must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
3257
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to edit_project_service must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3258
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($service_name) to edit_project_service must be a scalar' if ref($_[1]) or (!defined $_[1]); |
3259
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_project_service must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
3260
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
3261
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/services/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3262
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
3263
|
0
|
|
|
|
|
|
return; |
3264
|
|
|
|
|
|
|
} |
3265
|
|
|
|
|
|
|
|
3266
|
|
|
|
|
|
|
=head2 delete_project_service |
3267
|
|
|
|
|
|
|
|
3268
|
|
|
|
|
|
|
$api->delete_project_service( |
3269
|
|
|
|
|
|
|
$project_id, |
3270
|
|
|
|
|
|
|
$service_name, |
3271
|
|
|
|
|
|
|
); |
3272
|
|
|
|
|
|
|
|
3273
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/services/:service_name>. |
3274
|
|
|
|
|
|
|
|
3275
|
|
|
|
|
|
|
=cut |
3276
|
|
|
|
|
|
|
|
3277
|
|
|
|
|
|
|
sub delete_project_service { |
3278
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3279
|
0
|
0
|
|
|
|
|
croak 'delete_project_service must be called with 2 arguments' if @_ != 2; |
3280
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_project_service must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3281
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($service_name) to delete_project_service must be a scalar' if ref($_[1]) or (!defined $_[1]); |
3282
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/services/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3283
|
0
|
|
|
|
|
|
$self->delete( $path ); |
3284
|
0
|
|
|
|
|
|
return; |
3285
|
|
|
|
|
|
|
} |
3286
|
|
|
|
|
|
|
|
3287
|
|
|
|
|
|
|
=head1 SESSION METHODS |
3288
|
|
|
|
|
|
|
|
3289
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/session.html>. |
3290
|
|
|
|
|
|
|
|
3291
|
|
|
|
|
|
|
=head2 session |
3292
|
|
|
|
|
|
|
|
3293
|
|
|
|
|
|
|
my $session = $api->session( |
3294
|
|
|
|
|
|
|
\%params, |
3295
|
|
|
|
|
|
|
); |
3296
|
|
|
|
|
|
|
|
3297
|
|
|
|
|
|
|
Sends a C<POST> request to C</session> and returns the decoded/deserialized response body. |
3298
|
|
|
|
|
|
|
|
3299
|
|
|
|
|
|
|
=cut |
3300
|
|
|
|
|
|
|
|
3301
|
|
|
|
|
|
|
sub session { |
3302
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3303
|
0
|
0
|
0
|
|
|
|
croak 'session must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3304
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to session must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3305
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3306
|
0
|
|
|
|
|
|
my $path = sprintf('/session', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3307
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
3308
|
|
|
|
|
|
|
} |
3309
|
|
|
|
|
|
|
|
3310
|
|
|
|
|
|
|
=head1 SETTINGS METHODS |
3311
|
|
|
|
|
|
|
|
3312
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/settings.html>. |
3313
|
|
|
|
|
|
|
|
3314
|
|
|
|
|
|
|
=head2 settings |
3315
|
|
|
|
|
|
|
|
3316
|
|
|
|
|
|
|
my $settings = $api->settings(); |
3317
|
|
|
|
|
|
|
|
3318
|
|
|
|
|
|
|
Sends a C<GET> request to C</application/settings> and returns the decoded/deserialized response body. |
3319
|
|
|
|
|
|
|
|
3320
|
|
|
|
|
|
|
=cut |
3321
|
|
|
|
|
|
|
|
3322
|
|
|
|
|
|
|
sub settings { |
3323
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3324
|
0
|
0
|
|
|
|
|
croak "The settings method does not take any arguments" if @_; |
3325
|
0
|
|
|
|
|
|
my $path = sprintf('/application/settings', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3326
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3327
|
|
|
|
|
|
|
} |
3328
|
|
|
|
|
|
|
|
3329
|
|
|
|
|
|
|
=head2 update_settings |
3330
|
|
|
|
|
|
|
|
3331
|
|
|
|
|
|
|
my $settings = $api->update_settings( |
3332
|
|
|
|
|
|
|
\%params, |
3333
|
|
|
|
|
|
|
); |
3334
|
|
|
|
|
|
|
|
3335
|
|
|
|
|
|
|
Sends a C<PUT> request to C</application/settings> and returns the decoded/deserialized response body. |
3336
|
|
|
|
|
|
|
|
3337
|
|
|
|
|
|
|
=cut |
3338
|
|
|
|
|
|
|
|
3339
|
|
|
|
|
|
|
sub update_settings { |
3340
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3341
|
0
|
0
|
0
|
|
|
|
croak 'update_settings must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3342
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to update_settings must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3343
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3344
|
0
|
|
|
|
|
|
my $path = sprintf('/application/settings', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3345
|
0
|
0
|
|
|
|
|
return $self->put( $path, ( defined($params) ? $params : () ) ); |
3346
|
|
|
|
|
|
|
} |
3347
|
|
|
|
|
|
|
|
3348
|
|
|
|
|
|
|
=head1 SIDEKIQ METHODS |
3349
|
|
|
|
|
|
|
|
3350
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/sidekiq_metrics.html>. |
3351
|
|
|
|
|
|
|
|
3352
|
|
|
|
|
|
|
=head2 queue_metrics |
3353
|
|
|
|
|
|
|
|
3354
|
|
|
|
|
|
|
my $metrics = $api->queue_metrics(); |
3355
|
|
|
|
|
|
|
|
3356
|
|
|
|
|
|
|
Sends a C<GET> request to C</sidekiq/queue_metrics> and returns the decoded/deserialized response body. |
3357
|
|
|
|
|
|
|
|
3358
|
|
|
|
|
|
|
=cut |
3359
|
|
|
|
|
|
|
|
3360
|
|
|
|
|
|
|
sub queue_metrics { |
3361
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3362
|
0
|
0
|
|
|
|
|
croak "The queue_metrics method does not take any arguments" if @_; |
3363
|
0
|
|
|
|
|
|
my $path = sprintf('/sidekiq/queue_metrics', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3364
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3365
|
|
|
|
|
|
|
} |
3366
|
|
|
|
|
|
|
|
3367
|
|
|
|
|
|
|
=head2 process_metrics |
3368
|
|
|
|
|
|
|
|
3369
|
|
|
|
|
|
|
my $metrics = $api->process_metrics(); |
3370
|
|
|
|
|
|
|
|
3371
|
|
|
|
|
|
|
Sends a C<GET> request to C</sidekiq/process_metrics> and returns the decoded/deserialized response body. |
3372
|
|
|
|
|
|
|
|
3373
|
|
|
|
|
|
|
=cut |
3374
|
|
|
|
|
|
|
|
3375
|
|
|
|
|
|
|
sub process_metrics { |
3376
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3377
|
0
|
0
|
|
|
|
|
croak "The process_metrics method does not take any arguments" if @_; |
3378
|
0
|
|
|
|
|
|
my $path = sprintf('/sidekiq/process_metrics', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3379
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3380
|
|
|
|
|
|
|
} |
3381
|
|
|
|
|
|
|
|
3382
|
|
|
|
|
|
|
=head2 job_stats |
3383
|
|
|
|
|
|
|
|
3384
|
|
|
|
|
|
|
my $stats = $api->job_stats(); |
3385
|
|
|
|
|
|
|
|
3386
|
|
|
|
|
|
|
Sends a C<GET> request to C</sidekiq/job_stats> and returns the decoded/deserialized response body. |
3387
|
|
|
|
|
|
|
|
3388
|
|
|
|
|
|
|
=cut |
3389
|
|
|
|
|
|
|
|
3390
|
|
|
|
|
|
|
sub job_stats { |
3391
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3392
|
0
|
0
|
|
|
|
|
croak "The job_stats method does not take any arguments" if @_; |
3393
|
0
|
|
|
|
|
|
my $path = sprintf('/sidekiq/job_stats', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3394
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3395
|
|
|
|
|
|
|
} |
3396
|
|
|
|
|
|
|
|
3397
|
|
|
|
|
|
|
=head2 compound_metrics |
3398
|
|
|
|
|
|
|
|
3399
|
|
|
|
|
|
|
my $metrics = $api->compound_metrics(); |
3400
|
|
|
|
|
|
|
|
3401
|
|
|
|
|
|
|
Sends a C<GET> request to C</sidekiq/compound_metrics> and returns the decoded/deserialized response body. |
3402
|
|
|
|
|
|
|
|
3403
|
|
|
|
|
|
|
=cut |
3404
|
|
|
|
|
|
|
|
3405
|
|
|
|
|
|
|
sub compound_metrics { |
3406
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3407
|
0
|
0
|
|
|
|
|
croak "The compound_metrics method does not take any arguments" if @_; |
3408
|
0
|
|
|
|
|
|
my $path = sprintf('/sidekiq/compound_metrics', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3409
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3410
|
|
|
|
|
|
|
} |
3411
|
|
|
|
|
|
|
|
3412
|
|
|
|
|
|
|
=head1 USER SNIPPET METHODS |
3413
|
|
|
|
|
|
|
|
3414
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/snippets.html>. |
3415
|
|
|
|
|
|
|
|
3416
|
|
|
|
|
|
|
=head2 user_snippets |
3417
|
|
|
|
|
|
|
|
3418
|
|
|
|
|
|
|
my $snippets = $api->user_snippets(); |
3419
|
|
|
|
|
|
|
|
3420
|
|
|
|
|
|
|
Sends a C<GET> request to C</snippets> and returns the decoded/deserialized response body. |
3421
|
|
|
|
|
|
|
|
3422
|
|
|
|
|
|
|
=cut |
3423
|
|
|
|
|
|
|
|
3424
|
|
|
|
|
|
|
sub user_snippets { |
3425
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3426
|
0
|
0
|
|
|
|
|
croak "The user_snippets method does not take any arguments" if @_; |
3427
|
0
|
|
|
|
|
|
my $path = sprintf('/snippets', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3428
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3429
|
|
|
|
|
|
|
} |
3430
|
|
|
|
|
|
|
|
3431
|
|
|
|
|
|
|
=head2 user_snippet |
3432
|
|
|
|
|
|
|
|
3433
|
|
|
|
|
|
|
my $snippet = $api->user_snippet( |
3434
|
|
|
|
|
|
|
$snippet_id, |
3435
|
|
|
|
|
|
|
); |
3436
|
|
|
|
|
|
|
|
3437
|
|
|
|
|
|
|
Sends a C<GET> request to C</snippets/:snippet_id> and returns the decoded/deserialized response body. |
3438
|
|
|
|
|
|
|
|
3439
|
|
|
|
|
|
|
=cut |
3440
|
|
|
|
|
|
|
|
3441
|
|
|
|
|
|
|
sub user_snippet { |
3442
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3443
|
0
|
0
|
|
|
|
|
croak 'user_snippet must be called with 1 arguments' if @_ != 1; |
3444
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($snippet_id) to user_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3445
|
0
|
|
|
|
|
|
my $path = sprintf('/snippets/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3446
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3447
|
|
|
|
|
|
|
} |
3448
|
|
|
|
|
|
|
|
3449
|
|
|
|
|
|
|
=head2 create_user_snippet |
3450
|
|
|
|
|
|
|
|
3451
|
|
|
|
|
|
|
$api->create_user_snippet( |
3452
|
|
|
|
|
|
|
\%params, |
3453
|
|
|
|
|
|
|
); |
3454
|
|
|
|
|
|
|
|
3455
|
|
|
|
|
|
|
Sends a C<POST> request to C</snippets>. |
3456
|
|
|
|
|
|
|
|
3457
|
|
|
|
|
|
|
=cut |
3458
|
|
|
|
|
|
|
|
3459
|
|
|
|
|
|
|
sub create_user_snippet { |
3460
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3461
|
0
|
0
|
0
|
|
|
|
croak 'create_user_snippet must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3462
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_user_snippet must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3463
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3464
|
0
|
|
|
|
|
|
my $path = sprintf('/snippets', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3465
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
3466
|
0
|
|
|
|
|
|
return; |
3467
|
|
|
|
|
|
|
} |
3468
|
|
|
|
|
|
|
|
3469
|
|
|
|
|
|
|
=head2 edit_user_snippet |
3470
|
|
|
|
|
|
|
|
3471
|
|
|
|
|
|
|
$api->edit_user_snippet( |
3472
|
|
|
|
|
|
|
$snippet_id, |
3473
|
|
|
|
|
|
|
\%params, |
3474
|
|
|
|
|
|
|
); |
3475
|
|
|
|
|
|
|
|
3476
|
|
|
|
|
|
|
Sends a C<PUT> request to C</snippets/:snippet_id>. |
3477
|
|
|
|
|
|
|
|
3478
|
|
|
|
|
|
|
=cut |
3479
|
|
|
|
|
|
|
|
3480
|
|
|
|
|
|
|
sub edit_user_snippet { |
3481
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3482
|
0
|
0
|
0
|
|
|
|
croak 'edit_user_snippet must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3483
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($snippet_id) to edit_user_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3484
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_user_snippet must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3485
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3486
|
0
|
|
|
|
|
|
my $path = sprintf('/snippets/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3487
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
3488
|
0
|
|
|
|
|
|
return; |
3489
|
|
|
|
|
|
|
} |
3490
|
|
|
|
|
|
|
|
3491
|
|
|
|
|
|
|
=head2 delete_user_snippet |
3492
|
|
|
|
|
|
|
|
3493
|
|
|
|
|
|
|
$api->delete_user_snippet( |
3494
|
|
|
|
|
|
|
$snippet_id, |
3495
|
|
|
|
|
|
|
); |
3496
|
|
|
|
|
|
|
|
3497
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</snippets/:snippet_id>. |
3498
|
|
|
|
|
|
|
|
3499
|
|
|
|
|
|
|
=cut |
3500
|
|
|
|
|
|
|
|
3501
|
|
|
|
|
|
|
sub delete_user_snippet { |
3502
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3503
|
0
|
0
|
|
|
|
|
croak 'delete_user_snippet must be called with 1 arguments' if @_ != 1; |
3504
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($snippet_id) to delete_user_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3505
|
0
|
|
|
|
|
|
my $path = sprintf('/snippets/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3506
|
0
|
|
|
|
|
|
$self->delete( $path ); |
3507
|
0
|
|
|
|
|
|
return; |
3508
|
|
|
|
|
|
|
} |
3509
|
|
|
|
|
|
|
|
3510
|
|
|
|
|
|
|
=head2 public_snippets |
3511
|
|
|
|
|
|
|
|
3512
|
|
|
|
|
|
|
my $snippets = $api->public_snippets(); |
3513
|
|
|
|
|
|
|
|
3514
|
|
|
|
|
|
|
Sends a C<GET> request to C</snippets/public> and returns the decoded/deserialized response body. |
3515
|
|
|
|
|
|
|
|
3516
|
|
|
|
|
|
|
=cut |
3517
|
|
|
|
|
|
|
|
3518
|
|
|
|
|
|
|
sub public_snippets { |
3519
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3520
|
0
|
0
|
|
|
|
|
croak "The public_snippets method does not take any arguments" if @_; |
3521
|
0
|
|
|
|
|
|
my $path = sprintf('/snippets/public', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3522
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3523
|
|
|
|
|
|
|
} |
3524
|
|
|
|
|
|
|
|
3525
|
|
|
|
|
|
|
=head1 SYSTEM HOOK METHODS |
3526
|
|
|
|
|
|
|
|
3527
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/system_hooks.html>. |
3528
|
|
|
|
|
|
|
|
3529
|
|
|
|
|
|
|
=head2 hooks |
3530
|
|
|
|
|
|
|
|
3531
|
|
|
|
|
|
|
my $hooks = $api->hooks(); |
3532
|
|
|
|
|
|
|
|
3533
|
|
|
|
|
|
|
Sends a C<GET> request to C</hooks> and returns the decoded/deserialized response body. |
3534
|
|
|
|
|
|
|
|
3535
|
|
|
|
|
|
|
=cut |
3536
|
|
|
|
|
|
|
|
3537
|
|
|
|
|
|
|
sub hooks { |
3538
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3539
|
0
|
0
|
|
|
|
|
croak "The hooks method does not take any arguments" if @_; |
3540
|
0
|
|
|
|
|
|
my $path = sprintf('/hooks', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3541
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3542
|
|
|
|
|
|
|
} |
3543
|
|
|
|
|
|
|
|
3544
|
|
|
|
|
|
|
=head2 create_hook |
3545
|
|
|
|
|
|
|
|
3546
|
|
|
|
|
|
|
$api->create_hook( |
3547
|
|
|
|
|
|
|
\%params, |
3548
|
|
|
|
|
|
|
); |
3549
|
|
|
|
|
|
|
|
3550
|
|
|
|
|
|
|
Sends a C<POST> request to C</hooks>. |
3551
|
|
|
|
|
|
|
|
3552
|
|
|
|
|
|
|
=cut |
3553
|
|
|
|
|
|
|
|
3554
|
|
|
|
|
|
|
sub create_hook { |
3555
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3556
|
0
|
0
|
0
|
|
|
|
croak 'create_hook must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3557
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_hook must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3558
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3559
|
0
|
|
|
|
|
|
my $path = sprintf('/hooks', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3560
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
3561
|
0
|
|
|
|
|
|
return; |
3562
|
|
|
|
|
|
|
} |
3563
|
|
|
|
|
|
|
|
3564
|
|
|
|
|
|
|
=head2 test_hook |
3565
|
|
|
|
|
|
|
|
3566
|
|
|
|
|
|
|
my $hook = $api->test_hook( |
3567
|
|
|
|
|
|
|
$hook_id, |
3568
|
|
|
|
|
|
|
); |
3569
|
|
|
|
|
|
|
|
3570
|
|
|
|
|
|
|
Sends a C<GET> request to C</hooks/:hook_id> and returns the decoded/deserialized response body. |
3571
|
|
|
|
|
|
|
|
3572
|
|
|
|
|
|
|
=cut |
3573
|
|
|
|
|
|
|
|
3574
|
|
|
|
|
|
|
sub test_hook { |
3575
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3576
|
0
|
0
|
|
|
|
|
croak 'test_hook must be called with 1 arguments' if @_ != 1; |
3577
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($hook_id) to test_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3578
|
0
|
|
|
|
|
|
my $path = sprintf('/hooks/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3579
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3580
|
|
|
|
|
|
|
} |
3581
|
|
|
|
|
|
|
|
3582
|
|
|
|
|
|
|
=head2 delete_hook |
3583
|
|
|
|
|
|
|
|
3584
|
|
|
|
|
|
|
$api->delete_hook( |
3585
|
|
|
|
|
|
|
$hook_id, |
3586
|
|
|
|
|
|
|
); |
3587
|
|
|
|
|
|
|
|
3588
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</hooks/:hook_id>. |
3589
|
|
|
|
|
|
|
|
3590
|
|
|
|
|
|
|
=cut |
3591
|
|
|
|
|
|
|
|
3592
|
|
|
|
|
|
|
sub delete_hook { |
3593
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3594
|
0
|
0
|
|
|
|
|
croak 'delete_hook must be called with 1 arguments' if @_ != 1; |
3595
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($hook_id) to delete_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3596
|
0
|
|
|
|
|
|
my $path = sprintf('/hooks/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3597
|
0
|
|
|
|
|
|
$self->delete( $path ); |
3598
|
0
|
|
|
|
|
|
return; |
3599
|
|
|
|
|
|
|
} |
3600
|
|
|
|
|
|
|
|
3601
|
|
|
|
|
|
|
=head1 TAG METHODS |
3602
|
|
|
|
|
|
|
|
3603
|
|
|
|
|
|
|
See L<http://docs.gitlab.com/ce/api/tags.html>. |
3604
|
|
|
|
|
|
|
|
3605
|
|
|
|
|
|
|
=head2 tags |
3606
|
|
|
|
|
|
|
|
3607
|
|
|
|
|
|
|
my $tags = $api->tags( |
3608
|
|
|
|
|
|
|
$project_id, |
3609
|
|
|
|
|
|
|
); |
3610
|
|
|
|
|
|
|
|
3611
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/tags> and returns the decoded/deserialized response body. |
3612
|
|
|
|
|
|
|
|
3613
|
|
|
|
|
|
|
=cut |
3614
|
|
|
|
|
|
|
|
3615
|
|
|
|
|
|
|
sub tags { |
3616
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3617
|
0
|
0
|
|
|
|
|
croak 'tags must be called with 1 arguments' if @_ != 1; |
3618
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to tags must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3619
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/tags', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3620
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3621
|
|
|
|
|
|
|
} |
3622
|
|
|
|
|
|
|
|
3623
|
|
|
|
|
|
|
=head2 tag |
3624
|
|
|
|
|
|
|
|
3625
|
|
|
|
|
|
|
my $tag = $api->tag( |
3626
|
|
|
|
|
|
|
$project_id, |
3627
|
|
|
|
|
|
|
$tag_name, |
3628
|
|
|
|
|
|
|
); |
3629
|
|
|
|
|
|
|
|
3630
|
|
|
|
|
|
|
Sends a C<GET> request to C</projects/:project_id/repository/tags/:tag_name> and returns the decoded/deserialized response body. |
3631
|
|
|
|
|
|
|
|
3632
|
|
|
|
|
|
|
=cut |
3633
|
|
|
|
|
|
|
|
3634
|
|
|
|
|
|
|
sub tag { |
3635
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3636
|
0
|
0
|
|
|
|
|
croak 'tag must be called with 2 arguments' if @_ != 2; |
3637
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to tag must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3638
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($tag_name) to tag must be a scalar' if ref($_[1]) or (!defined $_[1]); |
3639
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/tags/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3640
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3641
|
|
|
|
|
|
|
} |
3642
|
|
|
|
|
|
|
|
3643
|
|
|
|
|
|
|
=head2 create_tag |
3644
|
|
|
|
|
|
|
|
3645
|
|
|
|
|
|
|
my $tag = $api->create_tag( |
3646
|
|
|
|
|
|
|
$project_id, |
3647
|
|
|
|
|
|
|
\%params, |
3648
|
|
|
|
|
|
|
); |
3649
|
|
|
|
|
|
|
|
3650
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/repository/tags> and returns the decoded/deserialized response body. |
3651
|
|
|
|
|
|
|
|
3652
|
|
|
|
|
|
|
=cut |
3653
|
|
|
|
|
|
|
|
3654
|
|
|
|
|
|
|
sub create_tag { |
3655
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3656
|
0
|
0
|
0
|
|
|
|
croak 'create_tag must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3657
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3658
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_tag must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3659
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3660
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/tags', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3661
|
0
|
0
|
|
|
|
|
return $self->post( $path, ( defined($params) ? $params : () ) ); |
3662
|
|
|
|
|
|
|
} |
3663
|
|
|
|
|
|
|
|
3664
|
|
|
|
|
|
|
=head2 delete_tag |
3665
|
|
|
|
|
|
|
|
3666
|
|
|
|
|
|
|
$api->delete_tag( |
3667
|
|
|
|
|
|
|
$project_id, |
3668
|
|
|
|
|
|
|
$tag_name, |
3669
|
|
|
|
|
|
|
); |
3670
|
|
|
|
|
|
|
|
3671
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</projects/:project_id/repository/tags/:tag_name>. |
3672
|
|
|
|
|
|
|
|
3673
|
|
|
|
|
|
|
=cut |
3674
|
|
|
|
|
|
|
|
3675
|
|
|
|
|
|
|
sub delete_tag { |
3676
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3677
|
0
|
0
|
|
|
|
|
croak 'delete_tag must be called with 2 arguments' if @_ != 2; |
3678
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to delete_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3679
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($tag_name) to delete_tag must be a scalar' if ref($_[1]) or (!defined $_[1]); |
3680
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/tags/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3681
|
0
|
|
|
|
|
|
$self->delete( $path ); |
3682
|
0
|
|
|
|
|
|
return; |
3683
|
|
|
|
|
|
|
} |
3684
|
|
|
|
|
|
|
|
3685
|
|
|
|
|
|
|
=head2 create_release |
3686
|
|
|
|
|
|
|
|
3687
|
|
|
|
|
|
|
$api->create_release( |
3688
|
|
|
|
|
|
|
$project_id, |
3689
|
|
|
|
|
|
|
$tag_name, |
3690
|
|
|
|
|
|
|
\%params, |
3691
|
|
|
|
|
|
|
); |
3692
|
|
|
|
|
|
|
|
3693
|
|
|
|
|
|
|
Sends a C<POST> request to C</projects/:project_id/repository/tags/:tag_name/release>. |
3694
|
|
|
|
|
|
|
|
3695
|
|
|
|
|
|
|
=cut |
3696
|
|
|
|
|
|
|
|
3697
|
|
|
|
|
|
|
sub create_release { |
3698
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3699
|
0
|
0
|
0
|
|
|
|
croak 'create_release must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
3700
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to create_release must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3701
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($tag_name) to create_release must be a scalar' if ref($_[1]) or (!defined $_[1]); |
3702
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_release must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
3703
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
3704
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/tags/%s/release', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3705
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
3706
|
0
|
|
|
|
|
|
return; |
3707
|
|
|
|
|
|
|
} |
3708
|
|
|
|
|
|
|
|
3709
|
|
|
|
|
|
|
=head2 update_release |
3710
|
|
|
|
|
|
|
|
3711
|
|
|
|
|
|
|
$api->update_release( |
3712
|
|
|
|
|
|
|
$project_id, |
3713
|
|
|
|
|
|
|
$tag_name, |
3714
|
|
|
|
|
|
|
\%params, |
3715
|
|
|
|
|
|
|
); |
3716
|
|
|
|
|
|
|
|
3717
|
|
|
|
|
|
|
Sends a C<PUT> request to C</projects/:project_id/repository/tags/:tag_name/release>. |
3718
|
|
|
|
|
|
|
|
3719
|
|
|
|
|
|
|
=cut |
3720
|
|
|
|
|
|
|
|
3721
|
|
|
|
|
|
|
sub update_release { |
3722
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3723
|
0
|
0
|
0
|
|
|
|
croak 'update_release must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; |
3724
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($project_id) to update_release must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3725
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($tag_name) to update_release must be a scalar' if ref($_[1]) or (!defined $_[1]); |
3726
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to update_release must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; |
3727
|
0
|
0
|
|
|
|
|
my $params = (@_ == 3) ? pop() : undef; |
3728
|
0
|
|
|
|
|
|
my $path = sprintf('/projects/%s/repository/tags/%s/release', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3729
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
3730
|
0
|
|
|
|
|
|
return; |
3731
|
|
|
|
|
|
|
} |
3732
|
|
|
|
|
|
|
|
3733
|
|
|
|
|
|
|
=head1 USER METHODS |
3734
|
|
|
|
|
|
|
|
3735
|
|
|
|
|
|
|
See L<http://doc.gitlab.com/ce/api/users.html>. |
3736
|
|
|
|
|
|
|
|
3737
|
|
|
|
|
|
|
=head2 users |
3738
|
|
|
|
|
|
|
|
3739
|
|
|
|
|
|
|
my $users = $api->users( |
3740
|
|
|
|
|
|
|
\%params, |
3741
|
|
|
|
|
|
|
); |
3742
|
|
|
|
|
|
|
|
3743
|
|
|
|
|
|
|
Sends a C<GET> request to C</users> and returns the decoded/deserialized response body. |
3744
|
|
|
|
|
|
|
|
3745
|
|
|
|
|
|
|
=cut |
3746
|
|
|
|
|
|
|
|
3747
|
|
|
|
|
|
|
sub users { |
3748
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3749
|
0
|
0
|
0
|
|
|
|
croak 'users must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3750
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to users must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3751
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3752
|
0
|
|
|
|
|
|
my $path = sprintf('/users', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3753
|
0
|
0
|
|
|
|
|
return $self->get( $path, ( defined($params) ? $params : () ) ); |
3754
|
|
|
|
|
|
|
} |
3755
|
|
|
|
|
|
|
|
3756
|
|
|
|
|
|
|
=head2 user |
3757
|
|
|
|
|
|
|
|
3758
|
|
|
|
|
|
|
my $user = $api->user( |
3759
|
|
|
|
|
|
|
$user_id, |
3760
|
|
|
|
|
|
|
); |
3761
|
|
|
|
|
|
|
|
3762
|
|
|
|
|
|
|
Sends a C<GET> request to C</users/:user_id> and returns the decoded/deserialized response body. |
3763
|
|
|
|
|
|
|
|
3764
|
|
|
|
|
|
|
=cut |
3765
|
|
|
|
|
|
|
|
3766
|
|
|
|
|
|
|
sub user { |
3767
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3768
|
0
|
0
|
|
|
|
|
croak 'user must be called with 1 arguments' if @_ != 1; |
3769
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($user_id) to user must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3770
|
0
|
|
|
|
|
|
my $path = sprintf('/users/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3771
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3772
|
|
|
|
|
|
|
} |
3773
|
|
|
|
|
|
|
|
3774
|
|
|
|
|
|
|
=head2 create_user |
3775
|
|
|
|
|
|
|
|
3776
|
|
|
|
|
|
|
$api->create_user( |
3777
|
|
|
|
|
|
|
\%params, |
3778
|
|
|
|
|
|
|
); |
3779
|
|
|
|
|
|
|
|
3780
|
|
|
|
|
|
|
Sends a C<POST> request to C</users>. |
3781
|
|
|
|
|
|
|
|
3782
|
|
|
|
|
|
|
=cut |
3783
|
|
|
|
|
|
|
|
3784
|
|
|
|
|
|
|
sub create_user { |
3785
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3786
|
0
|
0
|
0
|
|
|
|
croak 'create_user must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3787
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_user must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3788
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3789
|
0
|
|
|
|
|
|
my $path = sprintf('/users', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3790
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
3791
|
0
|
|
|
|
|
|
return; |
3792
|
|
|
|
|
|
|
} |
3793
|
|
|
|
|
|
|
|
3794
|
|
|
|
|
|
|
=head2 edit_user |
3795
|
|
|
|
|
|
|
|
3796
|
|
|
|
|
|
|
$api->edit_user( |
3797
|
|
|
|
|
|
|
$user_id, |
3798
|
|
|
|
|
|
|
\%params, |
3799
|
|
|
|
|
|
|
); |
3800
|
|
|
|
|
|
|
|
3801
|
|
|
|
|
|
|
Sends a C<PUT> request to C</users/:user_id>. |
3802
|
|
|
|
|
|
|
|
3803
|
|
|
|
|
|
|
=cut |
3804
|
|
|
|
|
|
|
|
3805
|
|
|
|
|
|
|
sub edit_user { |
3806
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3807
|
0
|
0
|
0
|
|
|
|
croak 'edit_user must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3808
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($user_id) to edit_user must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3809
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to edit_user must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3810
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3811
|
0
|
|
|
|
|
|
my $path = sprintf('/users/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3812
|
0
|
0
|
|
|
|
|
$self->put( $path, ( defined($params) ? $params : () ) ); |
3813
|
0
|
|
|
|
|
|
return; |
3814
|
|
|
|
|
|
|
} |
3815
|
|
|
|
|
|
|
|
3816
|
|
|
|
|
|
|
=head2 delete_user |
3817
|
|
|
|
|
|
|
|
3818
|
|
|
|
|
|
|
my $user = $api->delete_user( |
3819
|
|
|
|
|
|
|
$user_id, |
3820
|
|
|
|
|
|
|
); |
3821
|
|
|
|
|
|
|
|
3822
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</users/:user_id> and returns the decoded/deserialized response body. |
3823
|
|
|
|
|
|
|
|
3824
|
|
|
|
|
|
|
=cut |
3825
|
|
|
|
|
|
|
|
3826
|
|
|
|
|
|
|
sub delete_user { |
3827
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3828
|
0
|
0
|
|
|
|
|
croak 'delete_user must be called with 1 arguments' if @_ != 1; |
3829
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($user_id) to delete_user must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3830
|
0
|
|
|
|
|
|
my $path = sprintf('/users/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3831
|
0
|
|
|
|
|
|
return $self->delete( $path ); |
3832
|
|
|
|
|
|
|
} |
3833
|
|
|
|
|
|
|
|
3834
|
|
|
|
|
|
|
=head2 current_user |
3835
|
|
|
|
|
|
|
|
3836
|
|
|
|
|
|
|
my $user = $api->current_user(); |
3837
|
|
|
|
|
|
|
|
3838
|
|
|
|
|
|
|
Sends a C<GET> request to C</user> and returns the decoded/deserialized response body. |
3839
|
|
|
|
|
|
|
|
3840
|
|
|
|
|
|
|
=cut |
3841
|
|
|
|
|
|
|
|
3842
|
|
|
|
|
|
|
sub current_user { |
3843
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3844
|
0
|
0
|
|
|
|
|
croak "The current_user method does not take any arguments" if @_; |
3845
|
0
|
|
|
|
|
|
my $path = sprintf('/user', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3846
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3847
|
|
|
|
|
|
|
} |
3848
|
|
|
|
|
|
|
|
3849
|
|
|
|
|
|
|
=head2 current_user_ssh_keys |
3850
|
|
|
|
|
|
|
|
3851
|
|
|
|
|
|
|
my $keys = $api->current_user_ssh_keys(); |
3852
|
|
|
|
|
|
|
|
3853
|
|
|
|
|
|
|
Sends a C<GET> request to C</user/keys> and returns the decoded/deserialized response body. |
3854
|
|
|
|
|
|
|
|
3855
|
|
|
|
|
|
|
=cut |
3856
|
|
|
|
|
|
|
|
3857
|
|
|
|
|
|
|
sub current_user_ssh_keys { |
3858
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3859
|
0
|
0
|
|
|
|
|
croak "The current_user_ssh_keys method does not take any arguments" if @_; |
3860
|
0
|
|
|
|
|
|
my $path = sprintf('/user/keys', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3861
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3862
|
|
|
|
|
|
|
} |
3863
|
|
|
|
|
|
|
|
3864
|
|
|
|
|
|
|
=head2 user_ssh_keys |
3865
|
|
|
|
|
|
|
|
3866
|
|
|
|
|
|
|
my $keys = $api->user_ssh_keys( |
3867
|
|
|
|
|
|
|
$user_id, |
3868
|
|
|
|
|
|
|
); |
3869
|
|
|
|
|
|
|
|
3870
|
|
|
|
|
|
|
Sends a C<GET> request to C</users/:user_id/keys> and returns the decoded/deserialized response body. |
3871
|
|
|
|
|
|
|
|
3872
|
|
|
|
|
|
|
=cut |
3873
|
|
|
|
|
|
|
|
3874
|
|
|
|
|
|
|
sub user_ssh_keys { |
3875
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3876
|
0
|
0
|
|
|
|
|
croak 'user_ssh_keys must be called with 1 arguments' if @_ != 1; |
3877
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($user_id) to user_ssh_keys must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3878
|
0
|
|
|
|
|
|
my $path = sprintf('/users/%s/keys', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3879
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3880
|
|
|
|
|
|
|
} |
3881
|
|
|
|
|
|
|
|
3882
|
|
|
|
|
|
|
=head2 user_ssh_key |
3883
|
|
|
|
|
|
|
|
3884
|
|
|
|
|
|
|
my $key = $api->user_ssh_key( |
3885
|
|
|
|
|
|
|
$key_id, |
3886
|
|
|
|
|
|
|
); |
3887
|
|
|
|
|
|
|
|
3888
|
|
|
|
|
|
|
Sends a C<GET> request to C</user/keys/:key_id> and returns the decoded/deserialized response body. |
3889
|
|
|
|
|
|
|
|
3890
|
|
|
|
|
|
|
=cut |
3891
|
|
|
|
|
|
|
|
3892
|
|
|
|
|
|
|
sub user_ssh_key { |
3893
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3894
|
0
|
0
|
|
|
|
|
croak 'user_ssh_key must be called with 1 arguments' if @_ != 1; |
3895
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($key_id) to user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3896
|
0
|
|
|
|
|
|
my $path = sprintf('/user/keys/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3897
|
0
|
|
|
|
|
|
return $self->get( $path ); |
3898
|
|
|
|
|
|
|
} |
3899
|
|
|
|
|
|
|
|
3900
|
|
|
|
|
|
|
=head2 create_current_user_ssh_key |
3901
|
|
|
|
|
|
|
|
3902
|
|
|
|
|
|
|
$api->create_current_user_ssh_key( |
3903
|
|
|
|
|
|
|
\%params, |
3904
|
|
|
|
|
|
|
); |
3905
|
|
|
|
|
|
|
|
3906
|
|
|
|
|
|
|
Sends a C<POST> request to C</user/keys>. |
3907
|
|
|
|
|
|
|
|
3908
|
|
|
|
|
|
|
=cut |
3909
|
|
|
|
|
|
|
|
3910
|
|
|
|
|
|
|
sub create_current_user_ssh_key { |
3911
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3912
|
0
|
0
|
0
|
|
|
|
croak 'create_current_user_ssh_key must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; |
3913
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_current_user_ssh_key must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; |
3914
|
0
|
0
|
|
|
|
|
my $params = (@_ == 1) ? pop() : undef; |
3915
|
0
|
|
|
|
|
|
my $path = sprintf('/user/keys', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3916
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
3917
|
0
|
|
|
|
|
|
return; |
3918
|
|
|
|
|
|
|
} |
3919
|
|
|
|
|
|
|
|
3920
|
|
|
|
|
|
|
=head2 create_user_ssh_key |
3921
|
|
|
|
|
|
|
|
3922
|
|
|
|
|
|
|
$api->create_user_ssh_key( |
3923
|
|
|
|
|
|
|
$user_id, |
3924
|
|
|
|
|
|
|
\%params, |
3925
|
|
|
|
|
|
|
); |
3926
|
|
|
|
|
|
|
|
3927
|
|
|
|
|
|
|
Sends a C<POST> request to C</users/:user_id/keys>. |
3928
|
|
|
|
|
|
|
|
3929
|
|
|
|
|
|
|
=cut |
3930
|
|
|
|
|
|
|
|
3931
|
|
|
|
|
|
|
sub create_user_ssh_key { |
3932
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3933
|
0
|
0
|
0
|
|
|
|
croak 'create_user_ssh_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; |
3934
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($user_id) to create_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3935
|
0
|
0
|
0
|
|
|
|
croak 'The last argument (\%params) to create_user_ssh_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; |
3936
|
0
|
0
|
|
|
|
|
my $params = (@_ == 2) ? pop() : undef; |
3937
|
0
|
|
|
|
|
|
my $path = sprintf('/users/%s/keys', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3938
|
0
|
0
|
|
|
|
|
$self->post( $path, ( defined($params) ? $params : () ) ); |
3939
|
0
|
|
|
|
|
|
return; |
3940
|
|
|
|
|
|
|
} |
3941
|
|
|
|
|
|
|
|
3942
|
|
|
|
|
|
|
=head2 delete_current_user_ssh_key |
3943
|
|
|
|
|
|
|
|
3944
|
|
|
|
|
|
|
$api->delete_current_user_ssh_key( |
3945
|
|
|
|
|
|
|
$key_id, |
3946
|
|
|
|
|
|
|
); |
3947
|
|
|
|
|
|
|
|
3948
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</user/keys/:key_id>. |
3949
|
|
|
|
|
|
|
|
3950
|
|
|
|
|
|
|
=cut |
3951
|
|
|
|
|
|
|
|
3952
|
|
|
|
|
|
|
sub delete_current_user_ssh_key { |
3953
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3954
|
0
|
0
|
|
|
|
|
croak 'delete_current_user_ssh_key must be called with 1 arguments' if @_ != 1; |
3955
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($key_id) to delete_current_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3956
|
0
|
|
|
|
|
|
my $path = sprintf('/user/keys/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3957
|
0
|
|
|
|
|
|
$self->delete( $path ); |
3958
|
0
|
|
|
|
|
|
return; |
3959
|
|
|
|
|
|
|
} |
3960
|
|
|
|
|
|
|
|
3961
|
|
|
|
|
|
|
=head2 delete_user_ssh_key |
3962
|
|
|
|
|
|
|
|
3963
|
|
|
|
|
|
|
$api->delete_user_ssh_key( |
3964
|
|
|
|
|
|
|
$user_id, |
3965
|
|
|
|
|
|
|
$key_id, |
3966
|
|
|
|
|
|
|
); |
3967
|
|
|
|
|
|
|
|
3968
|
|
|
|
|
|
|
Sends a C<DELETE> request to C</users/:user_id/keys/:key_id>. |
3969
|
|
|
|
|
|
|
|
3970
|
|
|
|
|
|
|
=cut |
3971
|
|
|
|
|
|
|
|
3972
|
|
|
|
|
|
|
sub delete_user_ssh_key { |
3973
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3974
|
0
|
0
|
|
|
|
|
croak 'delete_user_ssh_key must be called with 2 arguments' if @_ != 2; |
3975
|
0
|
0
|
0
|
|
|
|
croak 'The #1 argument ($user_id) to delete_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); |
3976
|
0
|
0
|
0
|
|
|
|
croak 'The #2 argument ($key_id) to delete_user_ssh_key must be a scalar' if ref($_[1]) or (!defined $_[1]); |
3977
|
0
|
|
|
|
|
|
my $path = sprintf('/users/%s/keys/%s', (map { uri_escape($_) } @_)); |
|
0
|
|
|
|
|
|
|
3978
|
0
|
|
|
|
|
|
$self->delete( $path ); |
3979
|
0
|
|
|
|
|
|
return; |
3980
|
|
|
|
|
|
|
} |
3981
|
|
|
|
|
|
|
|
3982
|
|
|
|
|
|
|
|
3983
|
|
|
|
|
|
|
sub raw_snippet { |
3984
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
3985
|
0
|
|
|
|
|
|
warn "The raw_snippet method is deprecated, please use the snippet_content method instead"; |
3986
|
0
|
|
|
|
|
|
return $self->snippet_content( @_ ); |
3987
|
|
|
|
|
|
|
} |
3988
|
|
|
|
|
|
|
|
3989
|
|
|
|
|
|
|
1; |
3990
|
|
|
|
|
|
|
__END__ |
3991
|
|
|
|
|
|
|
|
3992
|
|
|
|
|
|
|
=head1 SEE ALSO |
3993
|
|
|
|
|
|
|
|
3994
|
|
|
|
|
|
|
L<Net::Gitlab> purports to provide an interface to the GitLab API, but |
3995
|
|
|
|
|
|
|
it is hard to tell due to a complete lack of documentation via either |
3996
|
|
|
|
|
|
|
POD or unit tests. |
3997
|
|
|
|
|
|
|
|
3998
|
|
|
|
|
|
|
=head1 CONTRIBUTING |
3999
|
|
|
|
|
|
|
|
4000
|
|
|
|
|
|
|
This module is auto-generated from a set of YAML files defining the |
4001
|
|
|
|
|
|
|
interface of GitLab's API. If you'd like to contribute to this module |
4002
|
|
|
|
|
|
|
then please feel free to make a |
4003
|
|
|
|
|
|
|
L<fork on GitHub|https://github.com/bluefeet/GitLab-API-v3> |
4004
|
|
|
|
|
|
|
and submit a pull request, just make sure you edit the files in the |
4005
|
|
|
|
|
|
|
C<authors/> directory instead of C<lib/GitLab/API/v3.pm> directly. |
4006
|
|
|
|
|
|
|
|
4007
|
|
|
|
|
|
|
Please see |
4008
|
|
|
|
|
|
|
L<https://github.com/bluefeet/GitLab-API-v3/blob/master/author/README.pod> |
4009
|
|
|
|
|
|
|
for more information. |
4010
|
|
|
|
|
|
|
|
4011
|
|
|
|
|
|
|
Alternatively, you can |
4012
|
|
|
|
|
|
|
L<open a ticket|https://github.com/bluefeet/GitLab-API-v3/issues>. |
4013
|
|
|
|
|
|
|
|
4014
|
|
|
|
|
|
|
=head1 AUTHORS |
4015
|
|
|
|
|
|
|
|
4016
|
|
|
|
|
|
|
Aran Clary Deltac <bluefeet@gmail.com> |
4017
|
|
|
|
|
|
|
Dotan Dimet <dotan@corky.net> |
4018
|
|
|
|
|
|
|
Nigel Gregoire <nigelgregoire@gmail.com> |
4019
|
|
|
|
|
|
|
trunov-ms <trunov.ms@gmail.com> |
4020
|
|
|
|
|
|
|
Marek R. Sotola <Marek.R.Sotola@nasa.gov> |
4021
|
|
|
|
|
|
|
José JoaquÃn Atria <jjatria@gmail.com> |
4022
|
|
|
|
|
|
|
Dave Webb <github@d5ve.com> |
4023
|
|
|
|
|
|
|
|
4024
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
4025
|
|
|
|
|
|
|
|
4026
|
|
|
|
|
|
|
Thanks to L<ZipRecruiter|https://www.ziprecruiter.com/> |
4027
|
|
|
|
|
|
|
for encouraging their employees to contribute back to the open |
4028
|
|
|
|
|
|
|
source ecosystem. Without their dedication to quality software |
4029
|
|
|
|
|
|
|
development this distribution would not exist. |
4030
|
|
|
|
|
|
|
|
4031
|
|
|
|
|
|
|
=head1 LICENSE |
4032
|
|
|
|
|
|
|
|
4033
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
4034
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
4035
|
|
|
|
|
|
|
|