Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
11 / 11 |
|
100.00% |
11 / 11 |
CRAP | |
100.00% |
1 / 1 |
User | |
100.00% |
11 / 11 |
|
100.00% |
11 / 11 |
11 | |
100.00% |
1 / 1 |
getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getEmail | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setEmail | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getApiEnabled | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setApiEnabled | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getAcls | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setAcls | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getUpdateParams | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Vultr\VultrPhp\Services\Users; |
6 | |
7 | use Vultr\VultrPhp\Util\Model; |
8 | |
9 | /** |
10 | * Holds sub user information. |
11 | */ |
12 | class User extends Model |
13 | { |
14 | public const ACL_ABUSE = 'abuse'; |
15 | public const ACL_ALERTS = 'alerts'; |
16 | public const ACL_BILLING = 'billing'; |
17 | public const ACL_DNS = 'dns'; |
18 | public const ACL_FIREWALL = 'firewall'; |
19 | public const ACL_LOADBALANCER = 'loadbalancer'; |
20 | public const ACL_MANAGE_USERS = 'manage_users'; |
21 | public const ACL_OBJSTORE = 'objstore'; |
22 | public const ACL_PROVISIONING = 'provisioning'; |
23 | public const ACL_SUBSCRIPTIONS = 'subscriptions'; |
24 | public const ACL_SUBS_VIEW = 'subscriptions_view'; |
25 | public const ACL_SUPPORT = 'support'; |
26 | public const ACL_UPGRADE = 'upgrade'; |
27 | |
28 | public const ACLS = [ |
29 | self::ACL_ABUSE, |
30 | self::ACL_ALERTS, |
31 | self::ACL_BILLING, |
32 | self::ACL_DNS, |
33 | self::ACL_FIREWALL, |
34 | self::ACL_LOADBALANCER, |
35 | self::ACL_MANAGE_USERS, |
36 | self::ACL_OBJSTORE, |
37 | self::ACL_PROVISIONING, |
38 | self::ACL_SUBSCRIPTIONS, |
39 | self::ACL_SUBS_VIEW, |
40 | self::ACL_SUPPORT, |
41 | self::ACL_UPGRADE |
42 | ]; |
43 | |
44 | protected string $id; |
45 | protected string $name; |
46 | protected string $email; |
47 | protected bool $apiEnabled; |
48 | protected array $acls; |
49 | |
50 | public function getId() : string |
51 | { |
52 | return $this->id; |
53 | } |
54 | |
55 | public function setId(string $id) : void |
56 | { |
57 | $this->id = $id; |
58 | } |
59 | |
60 | public function getName() : string |
61 | { |
62 | return $this->name; |
63 | } |
64 | |
65 | public function setName(string $name) : void |
66 | { |
67 | $this->name = $name; |
68 | } |
69 | |
70 | public function getEmail() : string |
71 | { |
72 | return $this->email; |
73 | } |
74 | |
75 | public function setEmail(string $email) : void |
76 | { |
77 | $this->email = $email; |
78 | } |
79 | |
80 | public function getApiEnabled() : bool |
81 | { |
82 | return $this->apiEnabled; |
83 | } |
84 | |
85 | public function setApiEnabled(bool $api_enabled) : void |
86 | { |
87 | $this->apiEnabled = $api_enabled; |
88 | } |
89 | |
90 | public function getAcls() : array |
91 | { |
92 | return $this->acls; |
93 | } |
94 | |
95 | public function setAcls(array $acls) : void |
96 | { |
97 | $this->acls = $acls; |
98 | } |
99 | |
100 | public function getUpdateParams() : array |
101 | { |
102 | return ['email', 'name', 'password', 'api_enabled', 'acls']; |
103 | } |
104 | } |