Commit 9aa0c68d authored by Roman Lacko's avatar Roman Lacko
Browse files

updated modules to comply with 8.17.2

parent 3434f6d4
......@@ -8,20 +8,37 @@ use vars qw($VERSION);
use GitLab::API;
use Log::Any qw($log);
our $VERSION = v8.12.1;
our $VERSION = v8.17.2;
my $requests = {
groups => {
method => "GET",
path => "/groups",
query => [ qw(search) ],
query => [qw(
skip_groups
all_available
search
order_by
sort
statistics
owned
)],
paginated => 1,
},
group_get_projects => {
method => "GET",
path => "/groups/<gid>/projects",
optional => [ qw(archived visibility order_by sort search ci_enabled_first) ],
optional => [qw(
archived
visibility
order_by
sort
search
simple
owned
starred
)],
paginated => 1,
},
......@@ -33,8 +50,17 @@ my $requests = {
group_create => {
method => "POST",
path => "/groups",
required => [ qw(name path) ],
optional => [ qw(description visibility_level lfs_enabled request_access_enabled) ],
required => [qw(
name
path
)],
optional => [qw(
description
visibility
lfs_enabled
request_access_enabled
parent_id
)],
},
transfer_project_to_group => {
......@@ -45,7 +71,14 @@ my $requests = {
group_update => {
method => "PUT",
path => "/groups/<gid>",
optional => [ qw(name path description visibility_level lfs_enabled request_access_enabled) ],
optional => [qw(
name
path
description
visibility
lfs_enabled
request_access_enabled
)],
},
group_delete => {
......@@ -75,8 +108,7 @@ response formats.
=head1 VERSION
Implements API calls for GitLab CE C<v8.10.0>.
Checked 2016-09-29 for GitLab CE C<v8.12.1>.
Implements API calls for GitLab CE C<v8.17.2>.
=head1 DESCRIPTION
......@@ -91,22 +123,22 @@ Please refer to the official documentation for the full list.
=over
=item groups()
=item L<groups()|https://docs.gitlab.com/ce/api/groups.html#list-groups>
$groups = $gitlab->groups( [:search] );
$groups = $gitlab->groups( [:search] [:all_available] [:owned] );
Returns a list of groups.
An optional parameter C<search> can be used to filter the list by substring match on C<name>.
=item group_details()
=item L<group_details()|https://docs.gitlab.com/ce/api/groups.html#details-of-a-group>
$details = $gitlab->group_details( :gid );
Returns details about a group with the given C<gid>.
=item group_create()
=item L<group_create()|https://docs.gitlab.com/ce/api/groups.html#new-group>
$group = $gitlab->group_create( :name, :path, [:description], [:visibility_level] );
$group = $gitlab->group_create( :name, :path, [:description], [:visibility] );
Creates a new group. Required arguments are
......@@ -116,16 +148,16 @@ Creates a new group. Required arguments are
In addition, the following I<optional> arguments can be specified:
description group's description
visibility_level see GitLab::API for possible values
visibility see GitLab::API for possible values
=item group_update()
=item L<group_update()|https://docs.gitlab.com/ce/api/groups.html#update-group>
$group = $gitlab->group_update( :gid );
Updates the grup with the given C<gid>.
Takes same arguments as C<group_create>, except they are all optional.
=item group_delete()
=item L<group_delete()|https://docs.gitlab.com/ce/api/groups.html#remove-group>
$gitlab->group_delete( :gid );
......@@ -141,13 +173,13 @@ This section was moved to a separate module L<GitLab::Members>.
=over
=item group_get_projects()
=item L<group_get_projects()|https://docs.gitlab.com/ce/api/groups.html#list-a-group-39-s-projects>
$projects = $gitlab->group_get_projects( :gid );
Returns a list of projects owned by the group with the given C<gid>.
=item transfer_project_to_group()
=item L<transfer_project_to_group()|https://docs.gitlab.com/ce/api/groups.html#transfer-project-to-group>
$gitlab->transfer_project_to_group( :gid, :projid );
......
......@@ -8,13 +8,16 @@ use vars qw($VERSION);
use GitLab::API;
use Log::Any qw($log);
our $VERSION = v8.12.1;
our $VERSION = v8.17.2;
my $requests = {
group_members => {
method => "GET",
path => "/groups/<gid>/members",
paginated => 1,
optional => [qw(
query
)],
},
group_get_member => {
......@@ -25,15 +28,24 @@ my $requests = {
group_add_member => {
method => "POST",
path => "/groups/<gid>/members",
required => [ qw!user_id access_level! ],
optional => [ qw!expires_at! ],
required => [qw(
user_id
access_level
)],
optional => [qw(
expires_at
)],
},
group_update_member => {
method => "PUT",
path => "/groups/<gid>/members/<user_id>",
required => [ qw!access_level! ],
optional => [ qw!expires_at! ],
required => [qw(
access_level
)],
optional => [qw(
expires_at
)],
},
group_delete_member => {
......@@ -45,6 +57,9 @@ my $requests = {
method => "GET",
path => "/projects/<id>/members",
paginated => 1,
optional => [qw(
query
)],
},
project_get_member => {
......@@ -55,15 +70,24 @@ my $requests = {
project_add_member => {
method => "POST",
path => "/projects/<id>/members",
required => [ qw!user_id access_level! ],
optional => [ qw!expires_at! ],
required => [qw(
user_id
access_level
)],
optional => [qw(
expires_at
)],
},
project_update_member => {
method => "PUT",
path => "/projects/<id>/members/<user_id>",
required => [ qw!access_level! ],
optional => [ qw!expires_at! ],
required => [qw(
access_level
)],
optional => [qw(
expires_at
)],
},
project_delete_member => {
......@@ -93,8 +117,7 @@ response formats.
=head1 VERSION
Implements API calls for GitLab CE C<v8.10.0>.
Checked 2016-09-29 for GitLab CE C<v8.12.1>.
Implements API calls for GitLab CE C<v8.17.2>.
=head1 DESCRIPTION
......@@ -109,13 +132,13 @@ Please refer to the official documentation for the full list.
=over
=item group_members()
=item L<group_members()|https://docs.gitlab.com/ce/api/members.html#list-all-members-of-a-group-or-project>
$members = $gitlab->group_members( :gid );
Returns a list of members in the group with the specified C<gid>.
=item group_get_member()
=item L<group_get_member()|https://docs.gitlab.com/ce/api/members.html#get-a-member-of-a-group-or-project>
$gitlab->group_get_member( :gid, :user_id )
......@@ -128,7 +151,7 @@ Can also be used to check whether the given user is a member of the group if use
# not a member
}
=item group_add_member()
=item L<group_add_member()|https://docs.gitlab.com/ce/api/members.html#add-a-member-to-a-group-or-project>
$gitlab->group_add_member( :gid, :user_id, :access_level, [:expires_at] );
......@@ -136,14 +159,14 @@ Adds a user with C<user_id> to the group with the given C<gid> with the specifie
See L<GitLab::API> module for possible access level values.
The optional argument C<expires_at> expects format C<YYYY-MM-DD>.
=item group_update_member()
=item L<group_update_member()|https://docs.gitlab.com/ce/api/members.html#edit-a-member-of-a-group-or-project>
$gitlab->group_update_member( :gid, :user_id, :access_level, [:expires_at] );
For user with the given C<user_id> the function changes his C<access_level> in the group with the specified C<gid>.
It can also remove the C<expires_at> property if set to C<undef>.
=item group_delete_member()
=item L<group_delete_member()|https://docs.gitlab.com/ce/api/members.html#remove-a-member-from-a-group-or-project>
$gitlab->group_delete_member( :gid, :user_id );
......@@ -153,13 +176,13 @@ Removes the user with C<user_id> from the group with the specified C<gid>.
=over
=item project_members()
=item L<project_members()|https://docs.gitlab.com/ce/api/members.html#list-all-members-of-a-group-or-project>
$members = $gitlab->project_members( :gid );
Returns a list of members in the project with the specified C<id>.
=item project_get_member()
=item L<project_get_member()|https://docs.gitlab.com/ce/api/members.html#get-a-member-of-a-group-or-project>
$gitlab->project_get_member( :gid, :user_id )
......@@ -172,7 +195,7 @@ Can also be used to check whether the given user is a member of the project if u
# not a member
}
=item project_add_member()
=item L<project_add_member()|https://docs.gitlab.com/ce/api/members.html#add-a-member-to-a-group-or-project>
$gitlab->project_add_member( :gid, :user_id, :access_level, [:expires_at] );
......@@ -180,14 +203,14 @@ Adds a user with C<user_id> to the project with the given C<id> with the specifi
See L<GitLab::API> module for possible access level values.
The optional argument C<expires_at> expects format C<YYYY-MM-DD>.
=item project_update_member()
=item L<project_update_member()|https://docs.gitlab.com/ce/api/members.html#edit-a-member-of-a-group-or-project>
$gitlab->project_update_member( :gid, :user_id, :access_level, [:expires_at] );
For user with the given C<user_id> the function changes his C<access_level> in the group with the specified C<gid>.
It can also remove the C<expires_at> property if set to C<undef>.
=item group_delete_member()
=item L<group_delete_member()|https://docs.gitlab.com/ce/api/members.html#remove-a-member-from-a-group-or-project>
$gitlab->group_delete_member( :gid, :user_id );
......
......@@ -8,13 +8,15 @@ use vars qw($VERSION);
use GitLab::API;
use Log::Any qw($log);
our $VERSION = v8.12.1;
our $VERSION = v8.17.2;
my $requests = {
namespaces => {
method => "GET",
path => "/namespaces",
query => [ qw(search) ],
query => [qw(
search
)],
paginated => 1,
}
};
......@@ -51,8 +53,7 @@ See L<GitLab API -- Namespaces|http://doc.gitlab.com/ce/api/namespaces.html> for
=head1 VERSION
Implements API calls for GitLab CE C<v8.10.0>.
Checked 2016-09-29 for GitLab CE C<v8.12.1>.
Implements API calls for GitLab CE C<v8.17.2>.
=head1 DESCRIPTION
......
......@@ -8,128 +8,185 @@ use vars qw($VERSION);
use GitLab::API;
use Log::Any qw($log);
our $VERSION = v8.12.1;
our $VERSION = v8.17.2;
my $requests = {
projects => {
method => "GET",
path => "/projects",
query => [ qw(archived visibility order_by sort search) ],
paginated => 1,
},
projects_owned => {
method => "GET",
path => "/projects/owned",
query => [ qw(archived visibility order_by sort search) ],
paginated => 1,
},
projects_starred => {
method => "GET",
path => "/projects/starred",
query => [ qw(archived visibility order_by sort search) ],
paginated => 1,
},
projects_all => {
method => "GET",
path => "/projects/all",
query => [ qw(archived visibility order_by sort search) ],
query => [qw(
archived
visibility
order_by
sort
search
simple
owned
starred
)],
paginated => 1,
},
project_by_id => {
method => "GET",
path => "/projects/<id>",
encode => [ qw(id) ],
encode => [qw(
id
)],
},
project_events => {
project_users => {
method => "GET",
path => "/projects/<id>/events",
encode => [ qw(id) ],
path => "/projects/<id>/users",
optional => [qw(
search
)],
encode => [qw(
id
)],
paginated => 1,
},
projects_search => {
project_events => {
method => "GET",
path => "/projects/search/<query>",
encode => [ qw(query) ],
optional => [ qw(order_by sort) ],
path => "/projects/<id>/events",
encode => [qw(
id
)],
paginated => 1,
},
project_create => {
method => "POST",
path => "/projects",
required => [ qw(name) ],
optional => [ qw(path namespace_id description issues_enabled
merge_requests_enabled builds_enabled wiki_enabled snippets_enabled
container_registry_enabled shared_runners_enabled public
visibility_level import_url public_builds
only_allow_merge_if_build_succeeds lfs_enabled
request_access_enabled) ],
optional => [qw(
name
path
namespace_id
description
issues_enabled
merge_requests_enabled
builds_enabled
wiki_enabled
snippets_enabled
container_registry_enabled
shared_runners_enabled
visibility
public_builds
import_url
public_builds
only_allow_merge_if_build_succeeds
only_allow_merge_if_all_discussions_are_resolved
lfs_enabled
request_access_enabled
)],
},
project_create_for_user => {
method => "POST",
path => "/projects/user/<uid>",
required => [ qw(name) ],
optional => [ qw(path namespace_id description issues_enabled
merge_requests_enabled builds_enabled wiki_enabled snippets_enabled
container_registry_enabled shared_runners_enabled public
visibility_level import_url public_builds
only_allow_merge_if_build_succeeds lfs_enabled
request_access_enabled) ],
required => [qw(
name
)],
optional => [qw(
path
default_branch
namespace_id
description
issues_enabled
merge_requests_enabled
builds_enabled
wiki_enabled
snippets_enabled
container_registry_enabled
shared_runners_enabled
visibility
import_url
public_builds
only_allow_merge_if_build_succeeds
only_allow_merge_if_all_discussions_are_resolved
lfs_enabled
request_access_enabled
)],
},
project_edit => {
method => "PUT",
path => "/projects/<id>",
optional => [ qw(name path namespace_id description issues_enabled
merge_requests_enabled builds_enabled wiki_enabled snippets_enabled
container_registry_enabled shared_runners_enabled public
visibility_level import_url public_builds
only_allow_merge_if_build_succeeds lfs_enabled
request_access_enabled) ],
required => [qw(
name
)],
optional => [qw(
path
default_branch
description
issues_enabled
merge_requests_enabled
builds_enabled
wiki_enabled
snippets_enabled
container_registry_enabled
shared_runners_enabled
visibility
import_url
public_builds
only_allow_merge_if_build_succeeds
only_allow_merge_if_all_discussions_are_resolved
lfs_enabled
request_access_enabled
)],
},
project_fork => {
method => "POST",
path => "/projects/fork/<id>",
encode => [ qw(id namespace) ],
optional => [ qw(namespace) ],
encode => [qw(
id
namespace
)],
optional => [qw(
namespace
)],
},
project_star => {
method => "POST",
path => "/projects/<id>/star",
encode => [ qw(id) ],
encode => [qw(
id
)],
},
project_unstar => {
method => "DELETE",
path => "/projects/<id>/unstar",
encode => [ qw(id) ],
encode => [qw(
id
)],
},
project_archive => {
method => "POST",
path => "/projects/<id>/archive",
encode => [ qw(id) ],
encode => [qw(
id
)],
},
project_unarchive => {
method => "DELETE",
path => "/projects/<id>/unarchive",
encode => [ qw(id) ],
encode => [qw(
id
)],
},
project_delete => {
method => "DELETE",
path => "/projects/<id>",
encode => [ qw(id) ],
encode => [qw(
id
)],
},
# DO NOT USE, not sure how this is supposed to work
......@@ -143,59 +200,115 @@ my $requests = {
project_share => {
method => "POST",
path => "/projects/<id>/share",
required => [ qw(group_id group_access) ],
optional => [ qw(expires_at) ],
encode => [ qw(id) ],
required => [qw(
group_id
group_access
)],
optional => [qw(
expires_at
)],
encode => [qw(
id
)],
},
project_unshare => {
method => "DELETE",
path => "/projects/<id>/share/<group_id>",
},
project_hooks => {
method => "GET",
path => "/projects/<id>/hooks",
encode => [ qw(id) ],
encode => [qw(
id
)],
paginated => 1,
},
project_get_hook => {
method => "GET",
path => "/projects/<id>/hooks/<hook_id>",
encode => [ qw(id) ],
encode => [qw(
id
)],
},
project_add_hook => {
method => "POST",
path => "/projects/<id>/hooks",
encode => [ qw(id) ],
required => [ qw(url) ],
optional => [ qw(push_events issues_events merge_requests_events
tag_push_events note_events build_events pipeline_events
wiki_page_events enable_ssl_verification ) ],
encode => [qw(
id
)],
required => [qw(
url
)],