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); ...@@ -8,20 +8,37 @@ use vars qw($VERSION);
use GitLab::API; use GitLab::API;
use Log::Any qw($log); use Log::Any qw($log);
our $VERSION = v8.12.1; our $VERSION = v8.17.2;
my $requests = { my $requests = {
groups => { groups => {
method => "GET", method => "GET",
path => "/groups", path => "/groups",
query => [ qw(search) ], query => [qw(
skip_groups
all_available
search
order_by
sort
statistics
owned
)],
paginated => 1, paginated => 1,
}, },
group_get_projects => { group_get_projects => {
method => "GET", method => "GET",
path => "/groups/<gid>/projects", 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, paginated => 1,
}, },
...@@ -33,8 +50,17 @@ my $requests = { ...@@ -33,8 +50,17 @@ my $requests = {
group_create => { group_create => {
method => "POST", method => "POST",
path => "/groups", path => "/groups",
required => [ qw(name path) ], required => [qw(
optional => [ qw(description visibility_level lfs_enabled request_access_enabled) ], name
path
)],
optional => [qw(
description
visibility
lfs_enabled
request_access_enabled
parent_id
)],
}, },
transfer_project_to_group => { transfer_project_to_group => {
...@@ -45,7 +71,14 @@ my $requests = { ...@@ -45,7 +71,14 @@ my $requests = {
group_update => { group_update => {
method => "PUT", method => "PUT",
path => "/groups/<gid>", 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 => { group_delete => {
...@@ -75,8 +108,7 @@ response formats. ...@@ -75,8 +108,7 @@ response formats.
=head1 VERSION =head1 VERSION
Implements API calls for GitLab CE C<v8.10.0>. Implements API calls for GitLab CE C<v8.17.2>.
Checked 2016-09-29 for GitLab CE C<v8.12.1>.
=head1 DESCRIPTION =head1 DESCRIPTION
...@@ -91,22 +123,22 @@ Please refer to the official documentation for the full list. ...@@ -91,22 +123,22 @@ Please refer to the official documentation for the full list.
=over =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. Returns a list of groups.
An optional parameter C<search> can be used to filter the list by substring match on C<name>. 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 ); $details = $gitlab->group_details( :gid );
Returns details about a group with the given C<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 Creates a new group. Required arguments are
...@@ -116,16 +148,16 @@ 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: In addition, the following I<optional> arguments can be specified:
description group's description 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 ); $group = $gitlab->group_update( :gid );
Updates the grup with the given C<gid>. Updates the grup with the given C<gid>.
Takes same arguments as C<group_create>, except they are all optional. 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 ); $gitlab->group_delete( :gid );
...@@ -141,13 +173,13 @@ This section was moved to a separate module L<GitLab::Members>. ...@@ -141,13 +173,13 @@ This section was moved to a separate module L<GitLab::Members>.
=over =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 ); $projects = $gitlab->group_get_projects( :gid );
Returns a list of projects owned by the group with the given C<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 ); $gitlab->transfer_project_to_group( :gid, :projid );
......
...@@ -8,13 +8,16 @@ use vars qw($VERSION); ...@@ -8,13 +8,16 @@ use vars qw($VERSION);
use GitLab::API; use GitLab::API;
use Log::Any qw($log); use Log::Any qw($log);
our $VERSION = v8.12.1; our $VERSION = v8.17.2;
my $requests = { my $requests = {
group_members => { group_members => {
method => "GET", method => "GET",
path => "/groups/<gid>/members", path => "/groups/<gid>/members",
paginated => 1, paginated => 1,
optional => [qw(
query
)],
}, },
group_get_member => { group_get_member => {
...@@ -25,15 +28,24 @@ my $requests = { ...@@ -25,15 +28,24 @@ my $requests = {
group_add_member => { group_add_member => {
method => "POST", method => "POST",
path => "/groups/<gid>/members", path => "/groups/<gid>/members",
required => [ qw!user_id access_level! ], required => [qw(
optional => [ qw!expires_at! ], user_id
access_level
)],
optional => [qw(
expires_at
)],
}, },
group_update_member => { group_update_member => {
method => "PUT", method => "PUT",
path => "/groups/<gid>/members/<user_id>", path => "/groups/<gid>/members/<user_id>",
required => [ qw!access_level! ], required => [qw(
optional => [ qw!expires_at! ], access_level
)],
optional => [qw(
expires_at
)],
}, },
group_delete_member => { group_delete_member => {
...@@ -45,6 +57,9 @@ my $requests = { ...@@ -45,6 +57,9 @@ my $requests = {
method => "GET", method => "GET",
path => "/projects/<id>/members", path => "/projects/<id>/members",
paginated => 1, paginated => 1,
optional => [qw(
query
)],
}, },
project_get_member => { project_get_member => {
...@@ -55,15 +70,24 @@ my $requests = { ...@@ -55,15 +70,24 @@ my $requests = {
project_add_member => { project_add_member => {
method => "POST", method => "POST",
path => "/projects/<id>/members", path => "/projects/<id>/members",
required => [ qw!user_id access_level! ], required => [qw(
optional => [ qw!expires_at! ], user_id
access_level
)],
optional => [qw(
expires_at
)],
}, },
project_update_member => { project_update_member => {
method => "PUT", method => "PUT",
path => "/projects/<id>/members/<user_id>", path => "/projects/<id>/members/<user_id>",
required => [ qw!access_level! ], required => [qw(
optional => [ qw!expires_at! ], access_level
)],
optional => [qw(
expires_at
)],
}, },
project_delete_member => { project_delete_member => {
...@@ -93,8 +117,7 @@ response formats. ...@@ -93,8 +117,7 @@ response formats.
=head1 VERSION =head1 VERSION
Implements API calls for GitLab CE C<v8.10.0>. Implements API calls for GitLab CE C<v8.17.2>.
Checked 2016-09-29 for GitLab CE C<v8.12.1>.
=head1 DESCRIPTION =head1 DESCRIPTION
...@@ -109,13 +132,13 @@ Please refer to the official documentation for the full list. ...@@ -109,13 +132,13 @@ Please refer to the official documentation for the full list.
=over =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 ); $members = $gitlab->group_members( :gid );
Returns a list of members in the group with the specified C<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 ) $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 ...@@ -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 # 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] ); $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 ...@@ -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. See L<GitLab::API> module for possible access level values.
The optional argument C<expires_at> expects format C<YYYY-MM-DD>. 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] ); $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>. 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>. 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 ); $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>. ...@@ -153,13 +176,13 @@ Removes the user with C<user_id> from the group with the specified C<gid>.
=over =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 ); $members = $gitlab->project_members( :gid );
Returns a list of members in the project with the specified C<id>. 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 ) $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 ...@@ -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 # 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] ); $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 ...@@ -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. See L<GitLab::API> module for possible access level values.
The optional argument C<expires_at> expects format C<YYYY-MM-DD>. 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] ); $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>. 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>. 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 ); $gitlab->group_delete_member( :gid, :user_id );
......
...@@ -8,13 +8,15 @@ use vars qw($VERSION); ...@@ -8,13 +8,15 @@ use vars qw($VERSION);
use GitLab::API; use GitLab::API;
use Log::Any qw($log); use Log::Any qw($log);
our $VERSION = v8.12.1; our $VERSION = v8.17.2;
my $requests = { my $requests = {
namespaces => { namespaces => {
method => "GET", method => "GET",
path => "/namespaces", path => "/namespaces",
query => [ qw(search) ], query => [qw(
search
)],
paginated => 1, paginated => 1,
} }
}; };
...@@ -51,8 +53,7 @@ See L<GitLab API -- Namespaces|http://doc.gitlab.com/ce/api/namespaces.html> for ...@@ -51,8 +53,7 @@ See L<GitLab API -- Namespaces|http://doc.gitlab.com/ce/api/namespaces.html> for
=head1 VERSION =head1 VERSION
Implements API calls for GitLab CE C<v8.10.0>. Implements API calls for GitLab CE C<v8.17.2>.
Checked 2016-09-29 for GitLab CE C<v8.12.1>.
=head1 DESCRIPTION =head1 DESCRIPTION
......
...@@ -8,128 +8,185 @@ use vars qw($VERSION); ...@@ -8,128 +8,185 @@ use vars qw($VERSION);
use GitLab::API; use GitLab::API;
use Log::Any qw($log); use Log::Any qw($log);
our $VERSION = v8.12.1; our $VERSION = v8.17.2;
my $requests = { my $requests = {
projects => { projects => {
method => "GET", method => "GET",
path => "/projects", path => "/projects",
query => [ qw(archived visibility order_by sort search) ], query => [qw(
paginated => 1, archived
}, visibility
order_by
projects_owned => { sort
method => "GET", search
path => "/projects/owned", simple
query => [ qw(archived visibility order_by sort search) ], owned
paginated => 1, starred
}, )],
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) ],
paginated => 1, paginated => 1,
}, },
project_by_id => { project_by_id => {
method => "GET", method => "GET",
path => "/projects/<id>", path => "/projects/<id>",
encode => [ qw(id) ], encode => [qw(
id
)],
}, },
project_events => { project_users => {
method => "GET", method => "GET",
path => "/projects/<id>/events", path => "/projects/<id>/users",
encode => [ qw(id) ], optional => [qw(
search
)],
encode => [qw(
id
)],
paginated => 1, paginated => 1,
}, },
projects_search => { project_events => {
method => "GET", method => "GET",
path => "/projects/search/<query>", path => "/projects/<id>/events",
encode => [ qw(query) ], encode => [qw(
optional => [ qw(order_by sort) ], id
)],
paginated => 1, paginated => 1,
}, },
project_create => { project_create => {
method => "POST", method => "POST",
path => "/projects", path => "/projects",
required => [ qw(name) ], optional => [qw(
optional => [ qw(path namespace_id description issues_enabled name
merge_requests_enabled builds_enabled wiki_enabled snippets_enabled path
container_registry_enabled shared_runners_enabled public namespace_id
visibility_level import_url public_builds description
only_allow_merge_if_build_succeeds lfs_enabled issues_enabled
request_access_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 => { project_create_for_user => {
method => "POST", method => "POST",
path => "/projects/user/<uid>", path => "/projects/user/<uid>",
required => [ qw(name) ], required => [qw(
optional => [ qw(path namespace_id description issues_enabled name
merge_requests_enabled builds_enabled wiki_enabled snippets_enabled )],
container_registry_enabled shared_runners_enabled public optional => [qw(
visibility_level import_url public_builds path
only_allow_merge_if_build_succeeds lfs_enabled