our
$VERSION
=
'1.05'
;
Hide Show 87 lines of Pod
around
BUILDARGS
=>
sub
{
my
$orig
=
shift
;
my
$class
=
shift
;
my
$args
=
$class
->
$orig
(
@_
);
my
$session_args
= {};
foreach
my
$key
(
qw( login email password )
) {
next
if
!
exists
$args
->{
$key
};
$session_args
->{
$key
} =
delete
$args
->{
$key
};
}
if
(
%$session_args
) {
my
$api
=
$class
->new(
$args
);
my
$session
=
$api
->session(
$session_args
);
$args
->{token} =
$session
->{private_token};
}
return
$args
;
};
sub
BUILD {
my
(
$self
) =
@_
;
$log
->debugf(
"An instance of %s has been created."
,
ref
(
$self
) );
$self
->rest_client->set_persistent_header(
'PRIVATE-TOKEN'
=>
$self
->token(),
)
if
$self
->has_token();
return
;
}
Hide Show 9 lines of Pod
has
url
=> (
is
=>
'ro'
,
isa
=> NonEmptySimpleStr,
required
=> 1,
);
Hide Show 10 lines of Pod
has
token
=> (
is
=>
'ro'
,
isa
=> NonEmptySimpleStr,
predicate
=>
'has_token'
,
);
Hide Show 20 lines of Pod
Hide Show 8 lines of Pod
has
rest_client
=> (
is
=>
'lazy'
,
isa
=> InstanceOf[
'GitLab::API::v3::RESTClient'
],
handles
=> [
qw( post get head put delete options )
],
);
sub
_build_rest_client {
my
(
$self
) =
@_
;
my
$url
=
''
.
$self
->url();
my
$class
=
'GitLab::API::v3::RESTClient'
;
$log
->debugf(
'Creating a %s instance pointed at %s.'
,
$class
,
$url
);
my
$rest
=
$class
->new(
server
=>
$url
,
type
=>
'application/json'
,
retries
=>
$self
->retries,
);
return
$rest
;
}
Hide Show 7 lines of Pod
has
retries
=> (
is
=>
'ro'
,
isa
=> Int,
lazy
=> 1,
default
=> 0,
);
Hide Show 29 lines of Pod
sub
paginator {
my
(
$self
,
$method
,
@args
) =
@_
;
my
$params
= (
ref
(
$args
[-1]) eq
'HASH'
) ?
pop
(
@args
) : {};
return
GitLab::API::v3::Paginator->new(
api
=>
$self
,
method
=>
$method
,
args
=> \
@args
,
params
=>
$params
,
);
}
Hide Show 15 lines of Pod
sub
issue_award_emojis {
my
$self
=
shift
;
croak
'issue_award_emojis must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to issue_award_emojis must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to issue_award_emojis must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/issues/%s/award_emoji'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
merge_request_award_emojis {
my
$self
=
shift
;
croak
'merge_request_award_emojis must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to merge_request_award_emojis must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to merge_request_award_emojis must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/award_emoji'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 12 lines of Pod
sub
issue_award_emoji {
my
$self
=
shift
;
croak
'issue_award_emoji must be called with 3 arguments'
if
@_
!= 3;
croak
'The #1 argument ($id) to issue_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to issue_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($award_id) to issue_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
my
$path
=
sprintf
(
'/projects/%s/issues/%s/award_emoji/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 12 lines of Pod
sub
merge_request_award_emoji {
my
$self
=
shift
;
croak
'merge_request_award_emoji must be called with 3 arguments'
if
@_
!= 3;
croak
'The #1 argument ($id) to merge_request_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to merge_request_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($award_id) to merge_request_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/award_emoji/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 12 lines of Pod
sub
create_issue_award_emoji {
my
$self
=
shift
;
croak
'create_issue_award_emoji must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($id) to create_issue_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to create_issue_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to create_issue_award_emoji must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/issues/%s/award_emoji'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
create_merge_request_award_emoji {
my
$self
=
shift
;
croak
'create_merge_request_award_emoji must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($id) to create_merge_request_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to create_merge_request_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to create_merge_request_award_emoji must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/award_emoji'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
delete_issue_award_emoji {
my
$self
=
shift
;
croak
'delete_issue_award_emoji must be called with 3 arguments'
if
@_
!= 3;
croak
'The #1 argument ($id) to delete_issue_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to delete_issue_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($award_id) to delete_issue_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
my
$path
=
sprintf
(
'/projects/%s/issues/%s/award_emoji/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 12 lines of Pod
sub
delete_merge_request_award_emoji {
my
$self
=
shift
;
croak
'delete_merge_request_award_emoji must be called with 3 arguments'
if
@_
!= 3;
croak
'The #1 argument ($id) to delete_merge_request_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to delete_merge_request_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($award_id) to delete_merge_request_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/award_emoji/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 12 lines of Pod
sub
issue_note_award_emojis {
my
$self
=
shift
;
croak
'issue_note_award_emojis must be called with 3 arguments'
if
@_
!= 3;
croak
'The #1 argument ($id) to issue_note_award_emojis must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to issue_note_award_emojis must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($note_id) to issue_note_award_emojis must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
my
$path
=
sprintf
(
'/projects/%s/issues/%s/notes/%s/award_emoji'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 13 lines of Pod
sub
issue_note_award_emoji {
my
$self
=
shift
;
croak
'issue_note_award_emoji must be called with 4 arguments'
if
@_
!= 4;
croak
'The #1 argument ($id) to issue_note_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to issue_note_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($note_id) to issue_note_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
croak
'The #4 argument ($award_id) to issue_note_award_emoji must be a scalar'
if
ref
(
$_
[3]) or (!
defined
$_
[3]);
my
$path
=
sprintf
(
'/projects/%s/issues/%s/notes/%s/award_emoji/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 13 lines of Pod
sub
create_issue_note_award_emoji {
my
$self
=
shift
;
croak
'create_issue_note_award_emoji must be called with 3 to 4 arguments'
if
@_
< 3 or
@_
> 4;
croak
'The #1 argument ($id) to create_issue_note_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to create_issue_note_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($note_id) to create_issue_note_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
croak
'The last argument (\%params) to create_issue_note_award_emoji must be a hash ref'
if
defined
(
$_
[3]) and
ref
(
$_
[3]) ne
'HASH'
;
my
$params
= (
@_
== 4) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/issues/%s/notes/%s/award_emoji'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 13 lines of Pod
sub
delete_issue_note_award_emoji {
my
$self
=
shift
;
croak
'delete_issue_note_award_emoji must be called with 4 arguments'
if
@_
!= 4;
croak
'The #1 argument ($id) to delete_issue_note_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to delete_issue_note_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($note_id) to delete_issue_note_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
croak
'The #4 argument ($award_id) to delete_issue_note_award_emoji must be a scalar'
if
ref
(
$_
[3]) or (!
defined
$_
[3]);
my
$path
=
sprintf
(
'/projects/%s/issues/%s/notes/%s/award_emoji/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 12 lines of Pod
sub
merge_request_note_award_emojis {
my
$self
=
shift
;
croak
'merge_request_note_award_emojis must be called with 3 arguments'
if
@_
!= 3;
croak
'The #1 argument ($id) to merge_request_note_award_emojis must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to merge_request_note_award_emojis must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($note_id) to merge_request_note_award_emojis must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/notes/%s/award_emoji'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 13 lines of Pod
sub
merge_request_note_award_emoji {
my
$self
=
shift
;
croak
'merge_request_note_award_emoji must be called with 4 arguments'
if
@_
!= 4;
croak
'The #1 argument ($id) to merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($note_id) to merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
croak
'The #4 argument ($award_id) to merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[3]) or (!
defined
$_
[3]);
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/notes/%s/award_emoji/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 13 lines of Pod
sub
create_merge_request_note_award_emoji {
my
$self
=
shift
;
croak
'create_merge_request_note_award_emoji must be called with 3 to 4 arguments'
if
@_
< 3 or
@_
> 4;
croak
'The #1 argument ($id) to create_merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[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]);
croak
'The #3 argument ($note_id) to create_merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
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'
;
my
$params
= (
@_
== 4) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/notes/%s/award_emoji'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 13 lines of Pod
sub
delete_merge_request_note_award_emoji {
my
$self
=
shift
;
croak
'delete_merge_request_note_award_emoji must be called with 4 arguments'
if
@_
!= 4;
croak
'The #1 argument ($id) to delete_merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[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]);
croak
'The #3 argument ($note_id) to delete_merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
croak
'The #4 argument ($award_id) to delete_merge_request_note_award_emoji must be a scalar'
if
ref
(
$_
[3]) or (!
defined
$_
[3]);
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/notes/%s/award_emoji/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 14 lines of Pod
sub
branches {
my
$self
=
shift
;
croak
'branches must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to branches must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/repository/branches'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
branch {
my
$self
=
shift
;
croak
'branch must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to branch must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($branch_name) to branch must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/branches/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 12 lines of Pod
sub
protect_branch {
my
$self
=
shift
;
croak
'protect_branch must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to protect_branch must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($branch_name) to protect_branch must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to protect_branch must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/branches/%s/protect'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
unprotect_branch {
my
$self
=
shift
;
croak
'unprotect_branch must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to unprotect_branch must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($branch_name) to unprotect_branch must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/branches/%s/unprotect'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
);
return
;
}
Hide Show 11 lines of Pod
sub
create_branch {
my
$self
=
shift
;
croak
'create_branch must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_branch must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_branch must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/branches'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
delete_branch {
my
$self
=
shift
;
croak
'delete_branch must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to delete_branch must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($branch_name) to delete_branch must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/branches/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 15 lines of Pod
sub
builds {
my
$self
=
shift
;
croak
'builds must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($id) to builds must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to builds must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/builds'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
commit_builds {
my
$self
=
shift
;
croak
'commit_builds must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($id) to commit_builds must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($sha) to commit_builds must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to commit_builds must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/commits/%s/builds'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
build {
my
$self
=
shift
;
croak
'build must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to build must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($build_id) to build must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/builds/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
build_artifacts {
my
$self
=
shift
;
croak
'build_artifacts must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to build_artifacts must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($build_id) to build_artifacts must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/builds/%s/artifacts'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
build_trace {
my
$self
=
shift
;
croak
'build_trace must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to build_trace must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($build_id) to build_trace must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/builds/%s/trace'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
cancel_build {
my
$self
=
shift
;
croak
'cancel_build must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to cancel_build must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($build_id) to cancel_build must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/builds/%s/cancel'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
);
}
Hide Show 11 lines of Pod
sub
retry_build {
my
$self
=
shift
;
croak
'retry_build must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to retry_build must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($build_id) to retry_build must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/builds/%s/retry'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
);
}
Hide Show 11 lines of Pod
sub
erase_build {
my
$self
=
shift
;
croak
'erase_build must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to erase_build must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($build_id) to erase_build must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/builds/%s/erase'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
);
}
Hide Show 11 lines of Pod
sub
keep_build_artifacts {
my
$self
=
shift
;
croak
'keep_build_artifacts must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to keep_build_artifacts must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($build_id) to keep_build_artifacts must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/builds/%s/artifacts/keep'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
);
}
Hide Show 14 lines of Pod
sub
triggers {
my
$self
=
shift
;
croak
'triggers must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($id) to triggers must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/triggers'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
trigger {
my
$self
=
shift
;
croak
'trigger must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to trigger must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($token) to trigger must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/triggers/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
create_trigger {
my
$self
=
shift
;
croak
'create_trigger must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($id) to create_trigger must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/triggers'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
);
}
Hide Show 11 lines of Pod
sub
delete_trigger {
my
$self
=
shift
;
croak
'delete_trigger must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to delete_trigger must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($token) to delete_trigger must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/triggers/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 14 lines of Pod
sub
variables {
my
$self
=
shift
;
croak
'variables must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($id) to variables must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/variables'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
variable {
my
$self
=
shift
;
croak
'variable must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to variable must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($key) to variable must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/variables/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_variable {
my
$self
=
shift
;
croak
'create_variable must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($id) to create_variable must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_variable must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/variables'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
update_variable {
my
$self
=
shift
;
croak
'update_variable must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($id) to update_variable must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($key) to update_variable must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to update_variable must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/variables/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
delete_variable {
my
$self
=
shift
;
croak
'delete_variable must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to delete_variable must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($key) to delete_variable must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/variables/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 15 lines of Pod
sub
commits {
my
$self
=
shift
;
croak
'commits must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to commits must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to commits must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/commits'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
commit {
my
$self
=
shift
;
croak
'commit must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to commit must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($commit_sha) to commit must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/commits/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
commit_diff {
my
$self
=
shift
;
croak
'commit_diff must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to commit_diff must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($commit_sha) to commit_diff must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/commits/%s/diff'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
commit_comments {
my
$self
=
shift
;
croak
'commit_comments must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to commit_comments must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($commit_sha) to commit_comments must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/commits/%s/comments'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 12 lines of Pod
sub
add_commit_comment {
my
$self
=
shift
;
croak
'add_commit_comment must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to add_commit_comment must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($commit_sha) to add_commit_comment must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to add_commit_comment must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/commits/%s/comments'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 14 lines of Pod
sub
deploy_keys {
my
$self
=
shift
;
croak
'deploy_keys must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to deploy_keys must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/keys'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
deploy_key {
my
$self
=
shift
;
croak
'deploy_key must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to deploy_key must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($key_id) to deploy_key must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/keys/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_deploy_key {
my
$self
=
shift
;
croak
'create_deploy_key must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_deploy_key must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_deploy_key must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/keys'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
delete_deploy_key {
my
$self
=
shift
;
croak
'delete_deploy_key must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to delete_deploy_key must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($key_id) to delete_deploy_key must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/keys/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 12 lines of Pod
sub
groups {
my
$self
=
shift
;
croak
"The groups method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/groups'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
group {
my
$self
=
shift
;
croak
'group must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($group_id) to group must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/groups/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
create_group {
my
$self
=
shift
;
croak
'create_group must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to create_group must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/groups'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
transfer_project {
my
$self
=
shift
;
croak
'transfer_project must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($group_id) to transfer_project must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($project_id) to transfer_project must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/groups/%s/projects/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
);
return
;
}
Hide Show 10 lines of Pod
sub
delete_group {
my
$self
=
shift
;
croak
'delete_group must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($group_id) to delete_group must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/groups/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 10 lines of Pod
sub
search_groups {
my
$self
=
shift
;
croak
'search_groups must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to search_groups must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/groups'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
group_members {
my
$self
=
shift
;
croak
'group_members must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($group_id) to group_members must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/groups/%s/members'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
group_projects {
my
$self
=
shift
;
croak
'group_projects must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($group_id) to group_projects must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to group_projects must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/groups/%s/projects'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
add_group_member {
my
$self
=
shift
;
croak
'add_group_member must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($group_id) to add_group_member must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to add_group_member must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/groups/%s/members'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 12 lines of Pod
sub
edit_group_member {
my
$self
=
shift
;
croak
'edit_group_member must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($group_id) to edit_group_member must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($user_id) to edit_group_member must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to edit_group_member must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/groups/%s/members/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
remove_group_member {
my
$self
=
shift
;
croak
'remove_group_member must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($group_id) to remove_group_member must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($user_id) to remove_group_member must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/groups/%s/members/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 14 lines of Pod
sub
all_issues {
my
$self
=
shift
;
croak
'all_issues must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to all_issues must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/issues'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
issues {
my
$self
=
shift
;
croak
'issues must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to issues must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to issues must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/issues'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
issue {
my
$self
=
shift
;
croak
'issue must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to issue must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to issue must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/issues/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_issue {
my
$self
=
shift
;
croak
'create_issue must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_issue must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_issue must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/issues'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
edit_issue {
my
$self
=
shift
;
croak
'edit_issue must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to edit_issue must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($issue_id) to edit_issue must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to edit_issue must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/issues/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 14 lines of Pod
sub
key {
my
$self
=
shift
;
croak
'key must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($key_id) to key must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/keys/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 14 lines of Pod
sub
labels {
my
$self
=
shift
;
croak
'labels must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to labels must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/labels'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_label {
my
$self
=
shift
;
croak
'create_label must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_label must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_label must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/labels'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
delete_label {
my
$self
=
shift
;
croak
'delete_label must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to delete_label must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to delete_label must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/labels'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
edit_label {
my
$self
=
shift
;
croak
'edit_label must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to edit_label must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to edit_label must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/labels'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 15 lines of Pod
sub
merge_requests {
my
$self
=
shift
;
croak
'merge_requests must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to merge_requests must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to merge_requests must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/merge_requests'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
merge_request {
my
$self
=
shift
;
croak
'merge_request must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to merge_request must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to merge_request must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/merge_request/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_merge_request {
my
$self
=
shift
;
croak
'create_merge_request must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_merge_request must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_merge_request must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/merge_requests'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
edit_merge_request {
my
$self
=
shift
;
croak
'edit_merge_request must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to edit_merge_request must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to edit_merge_request must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to edit_merge_request must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
accept_merge_request {
my
$self
=
shift
;
croak
'accept_merge_request must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to accept_merge_request must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to accept_merge_request must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to accept_merge_request must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/merge'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 12 lines of Pod
sub
add_merge_request_comment {
my
$self
=
shift
;
croak
'add_merge_request_comment must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to add_merge_request_comment must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to add_merge_request_comment must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to add_merge_request_comment must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/comments'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
merge_request_comments {
my
$self
=
shift
;
croak
'merge_request_comments must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to merge_request_comments must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($merge_request_id) to merge_request_comments must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/merge_requests/%s/comments'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 15 lines of Pod
sub
milestones {
my
$self
=
shift
;
croak
'milestones must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to milestones must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to milestones must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/milestones'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
milestone {
my
$self
=
shift
;
croak
'milestone must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to milestone must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($milestone_id) to milestone must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/milestones/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_milestone {
my
$self
=
shift
;
croak
'create_milestone must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_milestone must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_milestone must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/milestones'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 12 lines of Pod
sub
edit_milestone {
my
$self
=
shift
;
croak
'edit_milestone must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to edit_milestone must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($milestone_id) to edit_milestone must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to edit_milestone must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/milestones/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
milestone_issues {
my
$self
=
shift
;
croak
'milestone_issues must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to milestone_issues must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($milestone_id) to milestone_issues must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/milestones/%s/issues'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 14 lines of Pod
sub
licenses {
my
$self
=
shift
;
croak
'licenses must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to licenses must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/licenses'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
license {
my
$self
=
shift
;
croak
'license must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($license_key) to license must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to license must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/licenses/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 14 lines of Pod
sub
namespaces {
my
$self
=
shift
;
croak
'namespaces must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to namespaces must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/namespaces'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 16 lines of Pod
sub
notes {
my
$self
=
shift
;
croak
'notes must be called with 3 arguments'
if
@_
!= 3;
croak
'The #1 argument ($project_id) to notes must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($thing_type) to notes must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($thing_id) to notes must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
my
$path
=
sprintf
(
'/projects/%s/%s/%s/notes'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 13 lines of Pod
sub
note {
my
$self
=
shift
;
croak
'note must be called with 4 arguments'
if
@_
!= 4;
croak
'The #1 argument ($project_id) to note must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($thing_type) to note must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($thing_id) to note must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
croak
'The #4 argument ($note_id) to note must be a scalar'
if
ref
(
$_
[3]) or (!
defined
$_
[3]);
my
$path
=
sprintf
(
'/projects/%s/%s/%s/notes/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 13 lines of Pod
sub
create_note {
my
$self
=
shift
;
croak
'create_note must be called with 3 to 4 arguments'
if
@_
< 3 or
@_
> 4;
croak
'The #1 argument ($project_id) to create_note must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($thing_type) to create_note must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($thing_id) to create_note must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
croak
'The last argument (\%params) to create_note must be a hash ref'
if
defined
(
$_
[3]) and
ref
(
$_
[3]) ne
'HASH'
;
my
$params
= (
@_
== 4) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/%s/%s/notes'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 14 lines of Pod
sub
edit_note {
my
$self
=
shift
;
croak
'edit_note must be called with 4 to 5 arguments'
if
@_
< 4 or
@_
> 5;
croak
'The #1 argument ($project_id) to edit_note must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($thing_type) to edit_note must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The #3 argument ($thing_id) to edit_note must be a scalar'
if
ref
(
$_
[2]) or (!
defined
$_
[2]);
croak
'The #4 argument ($note_id) to edit_note must be a scalar'
if
ref
(
$_
[3]) or (!
defined
$_
[3]);
croak
'The last argument (\%params) to edit_note must be a hash ref'
if
defined
(
$_
[4]) and
ref
(
$_
[4]) ne
'HASH'
;
my
$params
= (
@_
== 5) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/%s/%s/notes/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 14 lines of Pod
sub
projects {
my
$self
=
shift
;
croak
'projects must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to projects must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
owned_projects {
my
$self
=
shift
;
croak
'owned_projects must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to owned_projects must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/owned'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
all_projects {
my
$self
=
shift
;
croak
'all_projects must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to all_projects must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/all'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
project {
my
$self
=
shift
;
croak
'project must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to project must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
project_events {
my
$self
=
shift
;
croak
'project_events must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to project_events must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/events'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
create_project {
my
$self
=
shift
;
croak
'create_project must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to create_project must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
create_project_for_user {
my
$self
=
shift
;
croak
'create_project_for_user must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($user_id) to create_project_for_user must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_project_for_user must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/user/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
edit_project {
my
$self
=
shift
;
croak
'edit_project must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to edit_project must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to edit_project must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
fork_project {
my
$self
=
shift
;
croak
'fork_project must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to fork_project must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/pojects/fork/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
);
return
;
}
Hide Show 10 lines of Pod
sub
delete_project {
my
$self
=
shift
;
croak
'delete_project must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to delete_project must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 11 lines of Pod
sub
project_members {
my
$self
=
shift
;
croak
'project_members must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to project_members must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to project_members must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/members'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
project_member {
my
$self
=
shift
;
croak
'project_member must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to project_member must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($user_id) to project_member must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/project/%s/members/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
add_project_member {
my
$self
=
shift
;
croak
'add_project_member must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to add_project_member must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to add_project_member must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/members'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 12 lines of Pod
sub
edit_project_member {
my
$self
=
shift
;
croak
'edit_project_member must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to edit_project_member must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($user_id) to edit_project_member must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to edit_project_member must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/members/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
remove_project_member {
my
$self
=
shift
;
croak
'remove_project_member must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to remove_project_member must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($user_id) to remove_project_member must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/members/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 11 lines of Pod
sub
share_project_with_group {
my
$self
=
shift
;
croak
'share_project_with_group must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($id) to share_project_with_group must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to share_project_with_group must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/share'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
delete_shared_project_link_within_group {
my
$self
=
shift
;
croak
'delete_shared_project_link_within_group must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to delete_shared_project_link_within_group must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($group_id) to delete_shared_project_link_within_group must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/share/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 10 lines of Pod
sub
project_hooks {
my
$self
=
shift
;
croak
'project_hooks must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to project_hooks must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/hooks'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
project_hook {
my
$self
=
shift
;
croak
'project_hook must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to project_hook must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($hook_id) to project_hook must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/project/%s/hooks/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_project_hook {
my
$self
=
shift
;
croak
'create_project_hook must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_project_hook must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_project_hook must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/hooks'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 12 lines of Pod
sub
edit_project_hook {
my
$self
=
shift
;
croak
'edit_project_hook must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to edit_project_hook must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($hook_id) to edit_project_hook must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to edit_project_hook must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/hooks/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
delete_project_hook {
my
$self
=
shift
;
croak
'delete_project_hook must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to delete_project_hook must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($hook_id) to delete_project_hook must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/hooks/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 11 lines of Pod
sub
set_project_fork {
my
$self
=
shift
;
croak
'set_project_fork must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to set_project_fork must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($forked_from_id) to set_project_fork must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/fork/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
);
return
;
}
Hide Show 10 lines of Pod
sub
clear_project_fork {
my
$self
=
shift
;
croak
'clear_project_fork must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to clear_project_fork must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/fork'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 11 lines of Pod
sub
search_projects_by_name {
my
$self
=
shift
;
croak
'search_projects_by_name must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($query) to search_projects_by_name must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to search_projects_by_name must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/search/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 14 lines of Pod
sub
snippets {
my
$self
=
shift
;
croak
'snippets must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to snippets must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/snippets'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
snippet {
my
$self
=
shift
;
croak
'snippet must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to snippet must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($snippet_id) to snippet must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/snippets/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_snippet {
my
$self
=
shift
;
croak
'create_snippet must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_snippet must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_snippet must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/snippets'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 12 lines of Pod
sub
edit_snippet {
my
$self
=
shift
;
croak
'edit_snippet must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to edit_snippet must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($snippet_id) to edit_snippet must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to edit_snippet must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/snippets/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
delete_snippet {
my
$self
=
shift
;
croak
'delete_snippet must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to delete_snippet must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($snippet_id) to delete_snippet must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/snippets/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 11 lines of Pod
sub
snippet_content {
my
$self
=
shift
;
croak
'snippet_content must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to snippet_content must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($snippet_id) to snippet_content must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/snippets/%s/raw'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 15 lines of Pod
sub
tree {
my
$self
=
shift
;
croak
'tree must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to tree must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to tree must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/tree'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
blob {
my
$self
=
shift
;
croak
'blob must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to blob must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($ref) to blob must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to blob must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/blobs/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
raw_blob {
my
$self
=
shift
;
croak
'raw_blob must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to raw_blob must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($blob_sha) to raw_blob must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/raw_blobs/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
archive {
my
$self
=
shift
;
croak
'archive must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to archive must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to archive must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/archive'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
compare {
my
$self
=
shift
;
croak
'compare must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to compare must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to compare must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/compare'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
contributors {
my
$self
=
shift
;
croak
'contributors must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to contributors must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/repository/contributors'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 15 lines of Pod
sub
file {
my
$self
=
shift
;
croak
'file must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to file must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to file must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/files'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
create_file {
my
$self
=
shift
;
croak
'create_file must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_file must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_file must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/files'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
edit_file {
my
$self
=
shift
;
croak
'edit_file must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to edit_file must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to edit_file must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/files'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
delete_file {
my
$self
=
shift
;
croak
'delete_file must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to delete_file must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to delete_file must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/files'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 14 lines of Pod
sub
runners {
my
$self
=
shift
;
croak
'runners must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to runners must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/runners'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
all_runners {
my
$self
=
shift
;
croak
'all_runners must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to all_runners must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/runners/all'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
runner {
my
$self
=
shift
;
croak
'runner must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($id) to runner must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/runners/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
update_runner {
my
$self
=
shift
;
croak
'update_runner must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($id) to update_runner must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to update_runner must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/runners/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
delete_runner {
my
$self
=
shift
;
croak
'delete_runner must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($id) to delete_runner must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/runners/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 10 lines of Pod
sub
project_runners {
my
$self
=
shift
;
croak
'project_runners must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($id) to project_runners must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/runners'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
enable_project_runner {
my
$self
=
shift
;
croak
'enable_project_runner must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($id) to enable_project_runner must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to enable_project_runner must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/runners'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
disable_project_runner {
my
$self
=
shift
;
croak
'disable_project_runner must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($id) to disable_project_runner must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($runner_id) to disable_project_runner must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/runners/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 16 lines of Pod
sub
edit_project_service {
my
$self
=
shift
;
croak
'edit_project_service must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to edit_project_service must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($service_name) to edit_project_service must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to edit_project_service must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/services/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
delete_project_service {
my
$self
=
shift
;
croak
'delete_project_service must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to delete_project_service must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($service_name) to delete_project_service must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/services/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 14 lines of Pod
sub
session {
my
$self
=
shift
;
croak
'session must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to session must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/session'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
settings {
my
$self
=
shift
;
croak
"The settings method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/application/settings'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
update_settings {
my
$self
=
shift
;
croak
'update_settings must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to update_settings must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/application/settings'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 12 lines of Pod
sub
queue_metrics {
my
$self
=
shift
;
croak
"The queue_metrics method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/sidekiq/queue_metrics'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 8 lines of Pod
sub
process_metrics {
my
$self
=
shift
;
croak
"The process_metrics method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/sidekiq/process_metrics'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 8 lines of Pod
sub
job_stats {
my
$self
=
shift
;
croak
"The job_stats method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/sidekiq/job_stats'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 8 lines of Pod
sub
compound_metrics {
my
$self
=
shift
;
croak
"The compound_metrics method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/sidekiq/compound_metrics'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 12 lines of Pod
sub
user_snippets {
my
$self
=
shift
;
croak
"The user_snippets method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/snippets'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
user_snippet {
my
$self
=
shift
;
croak
'user_snippet must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($snippet_id) to user_snippet must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/snippets/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
create_user_snippet {
my
$self
=
shift
;
croak
'create_user_snippet must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to create_user_snippet must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/snippets'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
edit_user_snippet {
my
$self
=
shift
;
croak
'edit_user_snippet must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($snippet_id) to edit_user_snippet must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to edit_user_snippet must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/snippets/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 10 lines of Pod
sub
delete_user_snippet {
my
$self
=
shift
;
croak
'delete_user_snippet must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($snippet_id) to delete_user_snippet must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/snippets/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 8 lines of Pod
sub
public_snippets {
my
$self
=
shift
;
croak
"The public_snippets method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/snippets/public'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 12 lines of Pod
sub
hooks {
my
$self
=
shift
;
croak
"The hooks method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/hooks'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
create_hook {
my
$self
=
shift
;
croak
'create_hook must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to create_hook must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/hooks'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 10 lines of Pod
sub
test_hook {
my
$self
=
shift
;
croak
'test_hook must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($hook_id) to test_hook must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/hooks/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
delete_hook {
my
$self
=
shift
;
croak
'delete_hook must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($hook_id) to delete_hook must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/hooks/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 14 lines of Pod
sub
tags {
my
$self
=
shift
;
croak
'tags must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($project_id) to tags must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/projects/%s/repository/tags'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
tag {
my
$self
=
shift
;
croak
'tag must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to tag must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($tag_name) to tag must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/tags/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 11 lines of Pod
sub
create_tag {
my
$self
=
shift
;
croak
'create_tag must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($project_id) to create_tag must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_tag must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/tags'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 11 lines of Pod
sub
delete_tag {
my
$self
=
shift
;
croak
'delete_tag must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($project_id) to delete_tag must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($tag_name) to delete_tag must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/projects/%s/repository/tags/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 12 lines of Pod
sub
create_release {
my
$self
=
shift
;
croak
'create_release must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to create_release must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($tag_name) to create_release must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to create_release must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/tags/%s/release'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 12 lines of Pod
sub
update_release {
my
$self
=
shift
;
croak
'update_release must be called with 2 to 3 arguments'
if
@_
< 2 or
@_
> 3;
croak
'The #1 argument ($project_id) to update_release must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($tag_name) to update_release must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
croak
'The last argument (\%params) to update_release must be a hash ref'
if
defined
(
$_
[2]) and
ref
(
$_
[2]) ne
'HASH'
;
my
$params
= (
@_
== 3) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/projects/%s/repository/tags/%s/release'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 14 lines of Pod
sub
users {
my
$self
=
shift
;
croak
'users must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to users must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/users'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
, (
defined
(
$params
) ?
$params
: () ) );
}
Hide Show 10 lines of Pod
sub
user {
my
$self
=
shift
;
croak
'user must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($user_id) to user must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/users/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
create_user {
my
$self
=
shift
;
croak
'create_user must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to create_user must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/users'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
edit_user {
my
$self
=
shift
;
croak
'edit_user must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($user_id) to edit_user must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to edit_user must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/users/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->put(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 10 lines of Pod
sub
delete_user {
my
$self
=
shift
;
croak
'delete_user must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($user_id) to delete_user must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/users/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->
delete
(
$path
);
}
Hide Show 8 lines of Pod
sub
current_user {
my
$self
=
shift
;
croak
"The current_user method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/user'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 8 lines of Pod
sub
current_user_ssh_keys {
my
$self
=
shift
;
croak
"The current_user_ssh_keys method does not take any arguments"
if
@_
;
my
$path
=
sprintf
(
'/user/keys'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
user_ssh_keys {
my
$self
=
shift
;
croak
'user_ssh_keys must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($user_id) to user_ssh_keys must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/users/%s/keys'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
user_ssh_key {
my
$self
=
shift
;
croak
'user_ssh_key must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($key_id) to user_ssh_key must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/user/keys/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
return
$self
->get(
$path
);
}
Hide Show 10 lines of Pod
sub
create_current_user_ssh_key {
my
$self
=
shift
;
croak
'create_current_user_ssh_key must be called with 0 to 1 arguments'
if
@_
< 0 or
@_
> 1;
croak
'The last argument (\%params) to create_current_user_ssh_key must be a hash ref'
if
defined
(
$_
[0]) and
ref
(
$_
[0]) ne
'HASH'
;
my
$params
= (
@_
== 1) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/user/keys'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 11 lines of Pod
sub
create_user_ssh_key {
my
$self
=
shift
;
croak
'create_user_ssh_key must be called with 1 to 2 arguments'
if
@_
< 1 or
@_
> 2;
croak
'The #1 argument ($user_id) to create_user_ssh_key must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The last argument (\%params) to create_user_ssh_key must be a hash ref'
if
defined
(
$_
[1]) and
ref
(
$_
[1]) ne
'HASH'
;
my
$params
= (
@_
== 2) ?
pop
() :
undef
;
my
$path
=
sprintf
(
'/users/%s/keys'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->post(
$path
, (
defined
(
$params
) ?
$params
: () ) );
return
;
}
Hide Show 10 lines of Pod
sub
delete_current_user_ssh_key {
my
$self
=
shift
;
croak
'delete_current_user_ssh_key must be called with 1 arguments'
if
@_
!= 1;
croak
'The #1 argument ($key_id) to delete_current_user_ssh_key must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
my
$path
=
sprintf
(
'/user/keys/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
Hide Show 11 lines of Pod
sub
delete_user_ssh_key {
my
$self
=
shift
;
croak
'delete_user_ssh_key must be called with 2 arguments'
if
@_
!= 2;
croak
'The #1 argument ($user_id) to delete_user_ssh_key must be a scalar'
if
ref
(
$_
[0]) or (!
defined
$_
[0]);
croak
'The #2 argument ($key_id) to delete_user_ssh_key must be a scalar'
if
ref
(
$_
[1]) or (!
defined
$_
[1]);
my
$path
=
sprintf
(
'/users/%s/keys/%s'
, (
map
{ uri_escape(
$_
) }
@_
));
$self
->
delete
(
$path
);
return
;
}
sub
raw_snippet {
my
$self
=
shift
;
warn
"The raw_snippet method is deprecated, please use the snippet_content method instead"
;
return
$self
->snippet_content(
@_
);
}
1;
Hide Show 44 lines of Pod