From edc5b59eea3d1cbb76eaab85479fc74ce7620306 Mon Sep 17 00:00:00 2001 From: Jan-Phillip Oesterling Date: Sun, 10 Sep 2023 23:21:58 +0200 Subject: [PATCH] Add architecture to models --- src/Models/Images/Image.php | 10 +++++++++- src/Models/Servers/Types/ServerType.php | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Models/Images/Image.php b/src/Models/Images/Image.php index a18a9ad..1119883 100644 --- a/src/Models/Images/Image.php +++ b/src/Models/Images/Image.php @@ -138,6 +138,11 @@ class Image extends Model implements Resource */ public $labels; + /** + * @var string + */ + public $architecture; + /** * Image constructor. * @@ -155,6 +160,7 @@ class Image extends Model implements Resource * @param string $osVersion * @param bool $rapidDeploy * @param Protection $protection + * @param string $architecture * @param array $labels */ public function __construct( @@ -172,6 +178,7 @@ public function __construct( string $osVersion = null, bool $rapidDeploy = null, Protection $protection = null, + string $architecture = null, array $labels = [] ) { $this->id = $id; @@ -195,6 +202,7 @@ public function __construct( $this->rapid_deploy = $rapidDeploy; $this->rapidDeploy = $rapidDeploy; $this->protection = $protection; + $this->architecture = $architecture; $this->labels = $labels; parent::__construct(); } @@ -276,7 +284,7 @@ public static function parse($input): ?Image return null; } - return new self($input->id, $input->type, property_exists($input, 'status') ? $input->status : null, $input->name, $input->description, $input->image_size, $input->disk_size, $input->created, $input->created_from, $input->bound_to, $input->os_flavor, $input->os_version, $input->rapid_deploy, Protection::parse($input->protection), get_object_vars($input->labels)); + return new self($input->id, $input->type, property_exists($input, 'status') ? $input->status : null, $input->name, $input->description, $input->image_size, $input->disk_size, $input->created, $input->created_from, $input->bound_to, $input->os_flavor, $input->os_version, $input->rapid_deploy, Protection::parse($input->protection), $input->architecture, get_object_vars($input->labels)); } public function reload() diff --git a/src/Models/Servers/Types/ServerType.php b/src/Models/Servers/Types/ServerType.php index 3afbfb0..17d5c6d 100644 --- a/src/Models/Servers/Types/ServerType.php +++ b/src/Models/Servers/Types/ServerType.php @@ -51,6 +51,11 @@ class ServerType extends Model */ public $cpuType; + /** + * @var string + */ + public $architecture; + /** * ServerType constructor. * @@ -77,6 +82,7 @@ public function setAdditionalData($input) $this->prices = $input->prices; $this->storageType = $input->storage_type; $this->cpuType = $input->cpu_type; + $this->architecture = $input->architecture; return $this; }