Notification Setup Error

We have detected an error in your notification set-up (Event-ID dab39dc24f564ec7bd4628d1305fd03c). Currently, we cannot inform you about inspection progress. Please check that the user 557058:bca11929-8c2d-43f2-8a82-c5416880d395 still has access to your repository or update the API account.

Completed
Pull Request — develop ( #78 )
by
unknown
13:44
created

Workspaces   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 66
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 4 1
A profile() 0 6 1
A members() 0 6 1
A projects() 0 6 1
A hooks() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the bitbucket-api package.
5
 *
6
 * (c) Alexandru G. <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Bitbucket\API;
12
13
use Psr\Http\Message\ResponseInterface;
14
15
/**
16
 * @author  Matt S.    <[email protected]>
17
 */
18
class Workspaces extends Api
19
{
20
    /**
21
     * Get a list of workspaces to which the caller has access.
22
     *
23
     * @access public
24
     * @return ResponseInterface
25
     *
26
     * @throws \InvalidArgumentException
27
     */
28
    public function all()
29
    {
30
        return $this->getClient()->setApiVersion('2.0')->get('/workspaces');
31
    }
32
33
    /**
34
     * Get the public information associated with a workspace.
35
     *
36
     * @access public
37
     * @param  string           $workspace The workspace ID (slug) or workspace UUID in curly brackets.
38
     * @return ResponseInterface
39
     */
40
    public function profile($workspace)
41
    {
42
        return $this->getClient()->setApiVersion('2.0')->get(
43
            sprintf('/workspaces/%s', $workspace)
44
        );
45
    }
46
47
    /**
48
     * Get the workspace members.
49
     *
50
     * @access public
51
     * @param  string           $workspace The workspace ID (slug) or workspace UUID in curly brackets.
52
     * @return ResponseInterface
53
     */
54
    public function members($workspace)
55
    {
56
        return $this->getClient()->setApiVersion('2.0')->get(
57
            sprintf('/workspaces/%s/members', $workspace)
58
        );
59
    }
60
61
    /**
62
     * Get the list of projects in the workspace
63
     *
64
     * @access public
65
     * @param  string           $workspace The workspace ID (slug) or workspace UUID in curly brackets.
66
     * @return ResponseInterface
67
     */
68
    public function projects($workspace)
69
    {
70
        return $this->getClient()->setApiVersion('2.0')->get(
71
            sprintf('/workspaces/%s/projects', $workspace)
72
        );
73
    }
74
75
    /**
76
     * @return Workspaces\Hooks
77
     * @throws \InvalidArgumentException
78
     */
79
    public function hooks()
80
    {
81
        return $this->api(Workspaces\Hooks::class);
82
    }
83
}
84