-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Ides.php
78 lines (69 loc) · 1.75 KB
/
Ides.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
namespace AcquiaCloudApi\Endpoints;
use AcquiaCloudApi\Connector\ClientInterface;
use AcquiaCloudApi\Response\IdesResponse;
use AcquiaCloudApi\Response\IdeResponse;
use AcquiaCloudApi\Response\OperationResponse;
/**
* Class Ides
* @package AcquiaCloudApi\CloudApi
*/
class Ides extends CloudApiBase implements CloudApiInterface
{
/**
* Returns a list of remote IDEs.
*
* @param string $applicationUuid The application ID
* @return IdesResponse
*/
public function getAll($applicationUuid)
{
return new IdesResponse(
$this->client->request(
'get',
"/applications/${applicationUuid}/ides"
)
);
}
/**
* Get remote IDE info.
*
* @param string $ideUuid The Remote IDE universally unique identifier.
* @return IdeResponse
*/
public function get($ideUuid)
{
return new IdeResponse(
$this->client->request(
'get',
"/ides/${ideUuid}"
)
);
}
/**
* Creates a new remote IDE.
*
* @param string $applicationUuid
* @param string $name
* @return OperationResponse
*/
public function create($applicationUuid, $name)
{
$this->client->addOption('form_params', ['name' => $name]);
return new OperationResponse(
$this->client->request('post', "/applications/${applicationUuid}/ides")
);
}
/**
* De-provisions a specific Remote IDE.
*
* @param string $ideUuid
* @return OperationResponse
*/
public function delete($ideUuid)
{
return new OperationResponse(
$this->client->request('delete', "/ides/{ideUuid}")
);
}
}