diff --git a/src/HetznerAPIClient.php b/src/HetznerAPIClient.php index fe8372e..1166753 100644 --- a/src/HetznerAPIClient.php +++ b/src/HetznerAPIClient.php @@ -32,7 +32,7 @@ class HetznerAPIClient /** * Version of the API Client. */ - const VERSION = '2.9.0'; + const VERSION = '2.9.1'; const MAX_ENTITIES_PER_PAGE = 50; diff --git a/src/Models/Zones/RRSet.php b/src/Models/Zones/RRSet.php index a4ccd46..8700be8 100644 --- a/src/Models/Zones/RRSet.php +++ b/src/Models/Zones/RRSet.php @@ -14,7 +14,7 @@ class RRSet extends Model implements Resource public string $id; public string $name; public string $type; - public int $ttl; + public ?int $ttl; public array $records; public array $labels; public ?RRSetProtection $protection; @@ -64,7 +64,12 @@ public function setAdditionalData($data) $this->name = $data->name; $this->type = $data->type; $this->ttl = $data->ttl; - $this->records = $data->records; + $records = []; + foreach ($data->records as $record) { + $records[] = Record::parse($record); + } + + $this->records = $records; $this->labels = get_object_vars($data->labels); $this->protection = RRSetProtection::parse($data->protection); $this->zone = $data->zone; diff --git a/src/Models/Zones/Record.php b/src/Models/Zones/Record.php index 767a6b1..fbf07b4 100644 --- a/src/Models/Zones/Record.php +++ b/src/Models/Zones/Record.php @@ -12,4 +12,9 @@ public function __construct(string $value, string $comment) $this->value = $value; $this->comment = $comment; } + + public static function parse($input): self + { + return new Record($input->value, $input->comment); + } }