Commit 800f9e8c authored by Roman Lacko's avatar Roman Lacko
Browse files

Update pod-GitLab-Namespaces.md

parent 096b161f
Loading
Loading
Loading
Loading
+24 −17
Original line number Original line Diff line number Diff line
# NAME
# NAME


GitLab::Namespaces - extension for Namespaces API
`GitLab::Namespaces` - extension for Namespaces API


See [GitLab API -- Namespaces](http://doc.gitlab.com/ce/api/namespaces.html) for details and response formats.
See [GitLab API -- Namespaces](http://doc.gitlab.com/ce/api/namespaces.html) for details and response formats.


# SYNOPSIS
# SYNOPSIS


```{.pl}
use GitLab::API;
use GitLab::API;
use GitLab::Namespaces;
use GitLab::Namespaces;


    my $api = GitLab::API->new();
my $api = GitLab::API->new(...);


# get namespaces exposed to user john.doe
# get namespaces exposed to user john.doe
$api->sudo("john.doe");
$api->sudo("john.doe");


my $namespaces = $api->namespaces(search => "group1");
my $namespaces = $api->namespaces(search => "group1");
```


# VERSION
# VERSION


@@ -25,28 +27,33 @@ Checked 2016-09-29 for GitLab CE `v8.12.1`.


From GitLab API: _"Usernames and groupnames fall under a special category called namespaces."_
From GitLab API: _"Usernames and groupnames fall under a special category called namespaces."_


- namespaces()
- `namespaces()`


    ```{.pl}
    $namespaces = $gitlab->namespaces();
    $namespaces = $gitlab->namespaces();
    $namespaces = $gitlab->namespaces(search => $what);
    $namespaces = $gitlab->namespaces(search => $what);
    ```


    Returns all namespaces for currently authenticated user.
    Returns all namespaces for currently authenticated user.
    If an optional argument `search` is used, only those namespaces that contain the requested string are returned.
    If an optional argument `search` is used, only those namespaces that contain the requested string are returned.


    To get namespaces of user with login `$login`, you can do this:
    To get namespaces of user with login `$login`, you can do this:


    ```{.pl}
    $gitlab->sudo($login);
    $gitlab->sudo($login);
    $namespaces = $gitlab->namespaces();
    $namespaces = $gitlab->namespaces();
    ```


    Note that the authenticated user must be an administrator to use ["sudo" in GitLab::API](https://metacpan.org/pod/GitLab::API#sudo).
    Note that the authenticated user must be an administrator to use [`sudo` in GitLab::API](pod-GitLab-API.md#sudo).
    If the user with login `$login` is an administrator, the call will return **all** namespaces.
    
    Also, if the user is an administrator, the call returns **all** namespaces.


# AUTHOR
# 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
# 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.