Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
90.91% |
10 / 11 |
|
90.91% |
10 / 11 |
CRAP | |
0.00% |
0 / 1 |
| NodeResource | |
90.91% |
10 / 11 |
|
90.91% |
10 / 11 |
11.09 | |
0.00% |
0 / 1 |
| getType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getLabel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLabel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getDateCreated | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setDateCreated | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getStatus | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setStatus | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getResponseName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getModelExceptionClass | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Vultr\VultrPhp\Services\Kubernetes; |
| 6 | |
| 7 | use Vultr\VultrPhp\Util\Model; |
| 8 | |
| 9 | /** |
| 10 | * Holds node resource information. |
| 11 | */ |
| 12 | class NodeResource extends Model |
| 13 | { |
| 14 | // This value is not in the response and is set based on the resource returned. |
| 15 | protected string $type = 'unknown-resource'; |
| 16 | |
| 17 | protected string $id; |
| 18 | protected string $label; |
| 19 | protected string $dateCreated; |
| 20 | protected string $status; |
| 21 | |
| 22 | // There is no setter for type as this is set by the child objects. |
| 23 | public function getType() : string |
| 24 | { |
| 25 | return $this->type; |
| 26 | } |
| 27 | |
| 28 | // Setters & Getters |
| 29 | |
| 30 | public function getId() : string |
| 31 | { |
| 32 | return $this->id; |
| 33 | } |
| 34 | |
| 35 | public function setId(string $id) : void |
| 36 | { |
| 37 | $this->id = $id; |
| 38 | } |
| 39 | |
| 40 | public function getLabel() : string |
| 41 | { |
| 42 | return $this->label; |
| 43 | } |
| 44 | |
| 45 | public function setLabel(string $label) : void |
| 46 | { |
| 47 | $this->label = $label; |
| 48 | } |
| 49 | |
| 50 | public function getDateCreated() : string |
| 51 | { |
| 52 | return $this->dateCreated; |
| 53 | } |
| 54 | |
| 55 | public function setDateCreated(string $dateCreated) : void |
| 56 | { |
| 57 | $this->dateCreated = $dateCreated; |
| 58 | } |
| 59 | |
| 60 | public function getStatus() : string |
| 61 | { |
| 62 | return $this->status; |
| 63 | } |
| 64 | |
| 65 | public function setStatus(string $status) : void |
| 66 | { |
| 67 | $this->status = $status; |
| 68 | } |
| 69 | |
| 70 | public function getResponseName() : string |
| 71 | { |
| 72 | return 'resource'; |
| 73 | } |
| 74 | |
| 75 | public function getModelExceptionClass() : string |
| 76 | { |
| 77 | return str_replace('NodeResourceException', 'KubernetesException', parent::getModelExceptionClass()); |
| 78 | } |
| 79 | } |