-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathServerPublicNet.php
More file actions
44 lines (40 loc) · 968 Bytes
/
ServerPublicNet.php
File metadata and controls
44 lines (40 loc) · 968 Bytes
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
<?php
namespace LKDev\HetznerCloud\Models\Servers;
/**
* Class ServerPublicNet.
*/
class ServerPublicNet
{
/**
* @var ServerPublicNetIPv4
*/
public $ipv4;
/**
* @var ServerPublicNetIPv6
*/
public $ipv6;
/**
* @var int[]
*/
public $floatingIps;
/**
* ServerPublicNet constructor.
* @param ServerPublicNetIPv4 $ipv4
* @param ServerPublicNetIPv6 $ipv6
* @param array $floatingIps
*/
public function __construct(ServerPublicNetIPv4 $ipv4, ServerPublicNetIPv6 $ipv6, array $floatingIps)
{
$this->ipv4 = $ipv4;
$this->ipv6 = $ipv6;
$this->floatingIps = $floatingIps;
}
/**
* @param \stdClass $data
* @return ServerPublicNet
*/
public static function parse(\stdClass $data)
{
return new ServerPublicNet(ServerPublicNetIPv4::parse($data->ipv4), ServerPublicNetIPv6::parse($data->ipv6), $data->floating_ips);
}
}