File tree Expand file tree Collapse file tree 3 files changed +63
-0
lines changed
Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -344,4 +344,12 @@ public function tasks()
344344 {
345345 return (new TaskClient ($ this ->httpClient ))->auth ($ this ->token );
346346 }
347+
348+ /**
349+ * @return BaseClient
350+ */
351+ public function vips ()
352+ {
353+ return (new VipClient ($ this ->httpClient ))->auth ($ this ->token );
354+ }
347355}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace UKFast \SDK \eCloud \Entities ;
4+
5+ use UKFast \SDK \Entity ;
6+
7+ /**
8+ * @property string $id
9+ * @property string $name
10+ * @property string $loadBalancerNetworkId
11+ * @property string $ipAddressId
12+ * @property integer $configId
13+ * @property string $sync
14+ * @property string $createdAt
15+ * @property string $updatedAt
16+ */
17+ class Vip extends Entity
18+ {
19+ protected $ dates = ['createdAt ' , 'updatedAt ' ];
20+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace UKFast \SDK \eCloud ;
4+
5+ use UKFast \SDK \eCloud \Entities \Vip ;
6+ use UKFast \SDK \Entities \ClientEntityInterface ;
7+ use UKFast \SDK \Traits \PageItems ;
8+
9+ class VipClient extends Client implements ClientEntityInterface
10+ {
11+ use PageItems;
12+
13+ protected $ collectionPath = 'v2/vips ' ;
14+
15+ public function getEntityMap ()
16+ {
17+ return [
18+ 'id ' => 'id ' ,
19+ 'name ' => 'name ' ,
20+ 'load_balancer_network_id ' => 'loadBalancerNetworkId ' ,
21+ 'ip_address_id ' => 'ipAddressId ' ,
22+ 'config_id ' => 'configId ' ,
23+ 'sync ' => 'sync ' ,
24+ 'created_at ' => 'createdAt ' ,
25+ 'updated_at ' => 'updatedAt ' ,
26+ ];
27+ }
28+
29+ public function loadEntity ($ data )
30+ {
31+ return new Vip (
32+ $ this ->apiToFriendly ($ data , $ this ->getEntityMap ())
33+ );
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments