Commit 096b161f authored by Roman Lacko's avatar Roman Lacko
Browse files

Update pod-GitLab-Groups.md

parent 5090dd03
Loading
Loading
Loading
Loading
+59 −33
Original line number Diff line number Diff line
# NAME

GitLab::Groups - implements group API calls
`GitLab::Groups` - implements group API calls

See [GitLab API -- Groups](http://doc.gitlab.com/ce/api/groups.html) for details and
response formats.
@@ -14,102 +14,128 @@ Checked 2016-09-29 for GitLab CE `v8.12.1`.

## Notation

Please see the documentation for the [GitLab::Users](https://metacpan.org/pod/GitLab::Users) module.
Please see the documentation for the [`GitLab::Users`](pod-GitLab-Users.md) module.

Note that not all optional arguments are listed.
Please refer to the official documentation for the full list.

## Group CRUD operations

- groups()
- `groups()`

    ```{.pl}
    $groups = $gitlab->groups( [:search] );
    ```

    Returns a list of groups.
    An optional parameter `search` can be used to filter the list by substring match on `name`.

- group\_details()
- `group_details()`

    ```{.pl}
    $details = $gitlab->group_details( :gid );
    ```

    Returns details about a group with the given `gid`.

- group\_create()
- `group_create()`

    ```{.pl}
    $group = $gitlab->group_create( :name, :path, [:description], [:visibility_level] );
    ```

    Creates a new group. Required arguments are

        name                the name of the group,
        path                the path for the group (must be unique)
    | argument | description |
    | -------- | ----------- |
    | `name`   | the name of the group |
    | `path`   | the path for the group (must be unique) |

    In addition, the following _optional_ arguments can be specified:

        description         group's description
        visibility_level    see GitLab::API for possible values
    | argument | description |
    | -------- | ----------- |
    | `description` | group's description |
    | `visibility_level` | see [GitLab](pod-GitLab.md) module for possible values |

- group\_update()
- `group_update()`

    ```{.pl}
    $group = $gitlab->group_update( :gid );
    ```

    Updates the grup with the given `gid`.
    Takes same arguments as `group_create`, except they are all optional.

- group\_delete()
- `group_delete()`

    ```{.pl}
    $gitlab->group_delete( :gid );
    ```

    Deletes the group with the given `gid`.

## Group members

- group\_members()
- `group_members()`

    ```{.pl}
    $members = $gitlab->group_members( :gid );
    ```

    Returns a list of members in the grup with the specified `gid`.

- group\_add\_member()
- `group_add_member()`

    ```{.pl}
    $gitlab->group_add_member( :gid, :user_id, :access_level );
    ```

    Adds a user with `user_id` to the group with the given `gid` with the specified `access_level`.
    See [GitLab::API](https://metacpan.org/pod/GitLab::API) module for possible access level values.
    See [GitLab](pod-GitLab.md) module for possible access level values.

- group\_update\_member()
- `group_update_member()`

    ```{.pl}
    $gitlab->group_update_member( :gid, :user_id, :access_level );
    ```

    For user with the given `user_id` the function changes his `access_level` in the group with the specified `gid`.

- group\_delete\_member()
- `group_delete_member()`

    ```{.pl}
    $gitlab->group_delete_member( :gid, :user_id );
    ```

    Removes the user with `user_id` from the group with the specified `gid`.

## Group projects and transfer

- group\_get\_projects()
- `group_get_projects()`

    ```{.pl}
    $projects = $gitlab->group_get_projects( :gid );
    ```

    Returns a list of projects owned by the group with the given `gid`.

- transfer\_project\_to\_group()
- `transfer_project_to_group()`

    ```{.pl}
    $gitlab->transfer_project_to_group( :gid, :projid );
    ```

    Moves the project with `projid` to the namespace of the group with the given `gid`.

    _This method is available only for administrators._
    __This method is available only for administrators.__

# AUTHOR

Roman Lacko <[xlacko1@fi.muni.cz](https://metacpan.org/pod/xlacko1@fi.muni.cz)>
Roman Lacko <[`xlacko1@fi.muni.cz`](mailto:xlacko1@fi.muni.cz)>

# SEE ALSO

- [GitLab](https://metacpan.org/pod/GitLab)
- [GitLab](pod-GitLab.md)

    Wrapper around [GitLab::API](https://metacpan.org/pod/GitLab::API) and other `GitLab::*` modules.
    Wrapper around [GitLab::API](pod-GitLab-API.md) and other `GitLab::*` modules.