1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AcquiaCloudApi\Endpoints; |
4
|
|
|
|
5
|
|
|
use AcquiaCloudApi\Connector\ClientInterface; |
6
|
|
|
use AcquiaCloudApi\Response\ApplicationResponse; |
7
|
|
|
use AcquiaCloudApi\Response\ApplicationsResponse; |
8
|
|
|
use AcquiaCloudApi\Response\TeamsResponse; |
9
|
|
|
use AcquiaCloudApi\Response\OperationResponse; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Class Client |
13
|
|
|
* @package AcquiaCloudApi\CloudApi |
14
|
|
|
*/ |
15
|
|
|
class Team implements CloudApi |
16
|
|
|
{ |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Client constructor. |
20
|
|
|
* |
21
|
|
|
* @param ConnectorInterface $connector |
|
|
|
|
22
|
|
|
*/ |
23
|
|
|
public function __construct(ClientInterface $client) |
24
|
|
|
{ |
25
|
|
|
$this->client = $client; |
|
|
|
|
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Show all teams. |
30
|
|
|
* |
31
|
|
|
* @return TeamsResponse |
32
|
|
|
*/ |
33
|
|
|
public function getTeams() |
34
|
|
|
{ |
35
|
|
|
return new TeamsResponse( |
36
|
|
|
$this->client->request('get', '/teams') |
|
|
|
|
37
|
|
|
); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Rename an existing team. |
42
|
|
|
* |
43
|
|
|
* @param string $teamUuid |
44
|
|
|
* @param string $name |
45
|
|
|
* @return OperationResponse |
46
|
|
|
*/ |
47
|
|
|
public function renameTeam($teamUuid, $name) |
48
|
|
|
{ |
49
|
|
|
$options = [ |
50
|
|
|
'form_params' => [ |
51
|
|
|
'name' => $name, |
52
|
|
|
], |
53
|
|
|
]; |
54
|
|
|
|
55
|
|
|
return new OperationResponse( |
56
|
|
|
$this->client->request('put', "/teams/${teamUuid}", $options) |
|
|
|
|
57
|
|
|
); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Delete a team. |
63
|
|
|
* |
64
|
|
|
* @param string $teamUuid |
65
|
|
|
* @return OperationResponse |
66
|
|
|
*/ |
67
|
|
|
public function deleteTeam($teamUuid) |
68
|
|
|
{ |
69
|
|
|
return new OperationResponse( |
70
|
|
|
$this->client->request('delete', "/teams/${teamUuid}") |
|
|
|
|
71
|
|
|
); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* Add an application to a team. |
76
|
|
|
* |
77
|
|
|
* @param string $teamUuid |
78
|
|
|
* @param string $applicationUuid |
79
|
|
|
* @return OperationResponse |
80
|
|
|
*/ |
81
|
|
|
public function addApplicationToTeam($teamUuid, $applicationUuid) |
82
|
|
|
{ |
83
|
|
|
$options = [ |
84
|
|
|
'form_params' => [ |
85
|
|
|
'uuid' => $applicationUuid, |
86
|
|
|
], |
87
|
|
|
]; |
88
|
|
|
|
89
|
|
|
return new OperationResponse( |
90
|
|
|
$this->client->request('post', "/teams/${teamUuid}/applications", $options) |
|
|
|
|
91
|
|
|
); |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Invites a user to join a team. |
96
|
|
|
* |
97
|
|
|
* @param string $teamUuid |
98
|
|
|
* @param string $email |
99
|
|
|
* @param array $roles |
100
|
|
|
* @return OperationResponse |
101
|
|
|
*/ |
102
|
|
|
public function createTeamInvite($teamUuid, $email, $roles) |
103
|
|
|
{ |
104
|
|
|
$options = [ |
105
|
|
|
'form_params' => [ |
106
|
|
|
'email' => $email, |
107
|
|
|
'roles' => $roles |
108
|
|
|
], |
109
|
|
|
]; |
110
|
|
|
|
111
|
|
|
return new OperationResponse( |
112
|
|
|
$this->client->request('post', "/teams/${teamUuid}/invites", $options) |
|
|
|
|
113
|
|
|
); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* Invites a user to become admin of an organization. |
118
|
|
|
* |
119
|
|
|
* @param string $organizationUuid |
120
|
|
|
* @param string $email |
121
|
|
|
* @return OperationResponse |
122
|
|
|
*/ |
123
|
|
|
public function createOrganizationAdminInvite($organizationUuid, $email) |
124
|
|
|
{ |
125
|
|
|
$options = [ |
126
|
|
|
'form_params' => [ |
127
|
|
|
'email' => $email, |
128
|
|
|
], |
129
|
|
|
]; |
130
|
|
|
|
131
|
|
|
return new OperationResponse( |
132
|
|
|
$this->client->request('post', "/teams/${organizationUuid}/invites", $options) |
|
|
|
|
133
|
|
|
); |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Show all applications associated with a team. |
138
|
|
|
* |
139
|
|
|
* @param string $teamUuid |
140
|
|
|
* @return ApplicationsResponse |
141
|
|
|
*/ |
142
|
|
|
public function getApplications($teamUuid) |
143
|
|
|
{ |
144
|
|
|
return new ApplicationsResponse( |
145
|
|
|
$this->client->request('get', "/teams/${teamUuid}/applications") |
|
|
|
|
146
|
|
|
); |
147
|
|
|
} |
148
|
|
|
} |
149
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths