Skip to content

Commit f58f872

Browse files
authored
Merge pull request #532 from ans-group/34364-vpn-gateway-users
vpn gateway user added
2 parents 1da9948 + 4eae99f commit f58f872

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

src/eCloud/Client.php

+8
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,12 @@ public function vpnGateways()
399399
{
400400
return (new VpnGatewayClient($this->httpClient))->auth($this->token);
401401
}
402+
403+
/**
404+
* @return BaseClient
405+
*/
406+
public function vpnGatewayUsers()
407+
{
408+
return (new VpnGatewayUserClient($this->httpClient))->auth($this->token);
409+
}
402410
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace UKFast\SDK\eCloud\Entities;
4+
5+
use DateTime;
6+
use UKFast\SDK\Entity;
7+
8+
/**
9+
* @property string $id
10+
* @property string $name
11+
* @property string vpnGatewayId
12+
* @property DateTime $createdAt
13+
* @property DateTime $updatedAt
14+
*/
15+
class VpnGatewayUser extends Entity
16+
{
17+
protected $dates = ['createdAt', 'updatedAt'];
18+
19+
public static $entityMap = [
20+
'id' => 'id',
21+
'name' => 'name',
22+
'vpn_gateway_id' => 'vpnGatewayId',
23+
'created_at' => 'createdAt',
24+
'updated_at' => 'updatedAt',
25+
];
26+
}

src/eCloud/VpnGatewayUserClient.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace UKFast\SDK\eCloud;
4+
5+
use UKFast\SDK\eCloud\Entities\VpnGatewayUser;
6+
use UKFast\SDK\Entities\ClientEntityInterface;
7+
use UKFast\SDK\Traits\PageItems;
8+
9+
class VpnGatewayUserClient extends Client implements ClientEntityInterface
10+
{
11+
use PageItems;
12+
13+
protected $collectionPath = 'v2/vpn-gateway-users';
14+
15+
public function getEntityMap()
16+
{
17+
return VpnGatewayUser::$entityMap;
18+
}
19+
20+
public function loadEntity($data)
21+
{
22+
return new VpnGatewayUser(
23+
$this->apiToFriendly($data, VpnGatewayUser::$entityMap)
24+
);
25+
}
26+
}

0 commit comments

Comments
 (0)