Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
filipcieslikans committed Aug 13, 2024
1 parent 8ecced7 commit 251804a
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/eCloud/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,12 @@ public function vpnGatewaySpecifications()
{
return (new VpnGatewaySpecificationClient($this->httpClient))->auth($this->token);
}

/**
* @return BaseClient
*/
public function vpnGateways()
{
return (new VpnGatewayClient($this->httpClient))->auth($this->token);
}
}
34 changes: 34 additions & 0 deletions src/eCloud/Entities/VpnGateway.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace UKFast\SDK\eCloud\Entities;

use DateTime;
use UKFast\SDK\Entity;

/**
* @property string $id
* @property string $name
* @property string $availabilityZoneId
* @property string $routerId
* @property string $networkId
* @property string $specificationId
* @property string $instanceId
* @property DateTime $createdAt
* @property DateTime $updatedAt
*/
class VpnGateway extends Entity
{
protected $dates = ['createdAt', 'updatedAt'];

public static $entityMap = [
'id' => 'id',
'name' => 'name',
'availability_zone_id' => 'availabilityZoneId',
'router_id' => 'routerId',
'network_id' => 'networkId',
'specification_id' => 'specificationId',
'instance_id' => 'instanceId',
'created_at' => 'createdAt',
'updated_at' => 'updatedAt',
];
}
26 changes: 26 additions & 0 deletions src/eCloud/VpnGatewayClient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace UKFast\SDK\eCloud;

use UKFast\SDK\eCloud\Entities\VpnGateway;
use UKFast\SDK\Entities\ClientEntityInterface;
use UKFast\SDK\Traits\PageItems;

class VpnGatewayClient extends Client implements ClientEntityInterface
{
use PageItems;

protected $collectionPath = 'v2/vpn-gateways';

public function getEntityMap()
{
return VpnGateway::$entityMap;
}

public function loadEntity($data)
{
return new VpnGateway(
$this->apiToFriendly($data, VpnGateway::$entityMap)
);
}
}

0 comments on commit 251804a

Please sign in to comment.