|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace AcquiaCloudApi\Endpoints; |
|
4
|
|
|
|
|
5
|
|
|
use AcquiaCloudApi\Response\IdeResponse; |
|
6
|
|
|
use AcquiaCloudApi\Response\IdesResponse; |
|
7
|
|
|
use AcquiaCloudApi\Response\OperationResponse; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Class Ides |
|
11
|
|
|
* |
|
12
|
|
|
* @package AcquiaCloudApi\CloudApi |
|
13
|
|
|
*/ |
|
14
|
|
|
class Ides extends CloudApiBase |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* Returns a list of remote IDEs. |
|
18
|
|
|
* |
|
19
|
|
|
* @param string $applicationUuid The application ID |
|
20
|
|
|
* |
|
21
|
|
|
* @return IdesResponse<IdeResponse> |
|
22
|
|
|
*/ |
|
23
|
|
|
public function getAll(string $applicationUuid): IdesResponse |
|
24
|
|
|
{ |
|
25
|
|
|
return new IdesResponse( |
|
26
|
|
|
$this->client->request( |
|
27
|
|
|
'get', |
|
28
|
|
|
"/applications/$applicationUuid/ides" |
|
29
|
|
|
) |
|
30
|
|
|
); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Returns a list of the current user's IDEs. |
|
35
|
|
|
* |
|
36
|
|
|
* @return IdesResponse<IdeResponse> |
|
37
|
|
|
*/ |
|
38
|
|
|
public function getMine(): IdesResponse |
|
39
|
|
|
{ |
|
40
|
|
|
return new IdesResponse( |
|
41
|
|
|
$this->client->request( |
|
42
|
|
|
'get', |
|
43
|
|
|
'/account/ides' |
|
44
|
|
|
) |
|
45
|
|
|
); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Get remote IDE info. |
|
50
|
|
|
* |
|
51
|
|
|
* @param string $ideUuid The Remote IDE universally unique identifier. |
|
52
|
|
|
* |
|
53
|
|
|
* @return IdeResponse |
|
54
|
|
|
*/ |
|
55
|
|
|
public function get(string $ideUuid): IdeResponse |
|
56
|
|
|
{ |
|
57
|
|
|
return new IdeResponse( |
|
58
|
|
|
$this->client->request( |
|
59
|
|
|
'get', |
|
60
|
|
|
"/ides/$ideUuid" |
|
61
|
|
|
) |
|
62
|
|
|
); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Creates a new remote IDE. |
|
67
|
|
|
* |
|
68
|
|
|
* @param string $applicationUuid |
|
69
|
|
|
* @param string $label |
|
70
|
|
|
* |
|
71
|
|
|
* @return OperationResponse |
|
72
|
|
|
*/ |
|
73
|
|
|
public function create(string $applicationUuid, string $label): OperationResponse |
|
74
|
|
|
{ |
|
75
|
|
|
|
|
76
|
|
|
$options = [ |
|
77
|
|
|
'json' => [ |
|
78
|
|
|
'label' => $label, |
|
79
|
|
|
], |
|
80
|
|
|
]; |
|
81
|
|
|
|
|
82
|
|
|
return new OperationResponse( |
|
83
|
|
|
$this->client->request('post', "/applications/$applicationUuid/ides", $options) |
|
84
|
|
|
); |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* De-provisions a specific Remote IDE. |
|
89
|
|
|
* |
|
90
|
|
|
* @param string $ideUuid |
|
91
|
|
|
* |
|
92
|
|
|
* @return OperationResponse |
|
93
|
|
|
*/ |
|
94
|
|
|
public function delete(string $ideUuid): OperationResponse |
|
95
|
|
|
{ |
|
96
|
|
|
return new OperationResponse( |
|
97
|
|
|
$this->client->request('delete', "/ides/$ideUuid") |
|
98
|
|
|
); |
|
99
|
|
|
} |
|
100
|
|
|
} |
|
101
|
|
|
|