-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #530 from DawidVH/33865-ecloud-vpn-gateway-specifi…
…cations VPN Gateway Specifications
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace UKFast\SDK\eCloud\Entities; | ||
|
||
use DateTime; | ||
use UKFast\SDK\Entity; | ||
|
||
/** | ||
* @property string $id | ||
* @property string $name | ||
* @property string $description | ||
* @property integer $maxUsers | ||
* @property DateTime $createdAt | ||
* @property DateTime $updatedAt | ||
*/ | ||
class VpnGatewaySpecification extends Entity | ||
{ | ||
protected $dates = ['createdAt', 'updatedAt']; | ||
|
||
public static $entityMap = [ | ||
'id' => 'id', | ||
'name' => 'name', | ||
'description' => 'description', | ||
'max_users' => 'maxUsers', | ||
'created_at' => 'createdAt', | ||
'updated_at' => 'updatedAt', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace UKFast\SDK\eCloud; | ||
|
||
use UKFast\SDK\eCloud\Entities\AvailabilityZone; | ||
use UKFast\SDK\eCloud\Entities\VpnGatewaySpecification; | ||
use UKFast\SDK\Entities\ClientEntityInterface; | ||
use UKFast\SDK\Traits\PageItems; | ||
|
||
class VpnGatewaySpecificationClient extends Client implements ClientEntityInterface | ||
{ | ||
use PageItems; | ||
|
||
protected $collectionPath = 'v2/vpn-gateway-specifications'; | ||
|
||
public function getEntityMap() | ||
{ | ||
return VpnGatewaySpecification::$entityMap; | ||
} | ||
|
||
public function loadEntity($data) | ||
{ | ||
return new VpnGatewaySpecification( | ||
$this->apiToFriendly($data, VpnGatewaySpecification::$entityMap) | ||
); | ||
} | ||
|
||
public function getAvailabilityZones($id, $filters = []) | ||
{ | ||
return $this->getChildResources($id, 'availability-zones', function ($data) { | ||
return new AvailabilityZone($this->apiToFriendly($data, AvailabilityZone::$entityMap)); | ||
}, $filters); | ||
} | ||
} |