|
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
|
|
|
|
|
12
|
|
|
namespace Bitbucket\API\Workspaces; |
|
13
|
|
|
|
|
14
|
|
|
use Bitbucket\API; |
|
15
|
|
|
use Psr\Http\Message\ResponseInterface; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* @author Matt S. <[email protected]> |
|
19
|
|
|
*/ |
|
20
|
|
|
class Workspace extends API\Api |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* Get the public information associated with a workspace. |
|
24
|
|
|
* |
|
25
|
|
|
* @access public |
|
26
|
|
|
* @param string $workspace The workspace ID (slug) or workspace UUID in curly brackets. |
|
27
|
|
|
* @return ResponseInterface |
|
28
|
|
|
*/ |
|
29
|
|
|
public function workspace($workspace) |
|
30
|
|
|
{ |
|
31
|
|
|
return $this->getClient()->setApiVersion('2.0')->get( |
|
32
|
|
|
sprintf('/workspaces/%s', $workspace) |
|
33
|
|
|
); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Get the workspace members. |
|
38
|
|
|
* |
|
39
|
|
|
* @access public |
|
40
|
|
|
* @param string $workspace The workspace ID (slug) or workspace UUID in curly brackets. |
|
41
|
|
|
* @return ResponseInterface |
|
42
|
|
|
*/ |
|
43
|
|
|
public function members($workspace) |
|
44
|
|
|
{ |
|
45
|
|
|
return $this->getClient()->setApiVersion('2.0')->get( |
|
46
|
|
|
sprintf('/workspaces/%s/members', $workspace) |
|
47
|
|
|
); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Get the list of projects in the workspace |
|
52
|
|
|
* |
|
53
|
|
|
* @access public |
|
54
|
|
|
* @param string $workspace The workspace ID (slug) or workspace UUID in curly brackets. |
|
55
|
|
|
* @return ResponseInterface |
|
56
|
|
|
*/ |
|
57
|
|
|
public function projects($workspace) |
|
58
|
|
|
{ |
|
59
|
|
|
return $this->getClient()->setApiVersion('2.0')->get( |
|
60
|
|
|
sprintf('/workspaces/%s/projects', $workspace) |
|
61
|
|
|
); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @return Hooks |
|
66
|
|
|
* @throws \InvalidArgumentException |
|
67
|
|
|
*/ |
|
68
|
|
|
public function hooks() |
|
69
|
|
|
{ |
|
70
|
|
|
return $this->api(Hooks::class); |
|
71
|
|
|
} |
|
72
|
|
|
} |
|
73
|
|
|
|