Skip to content

Commit

Permalink
Add architecture to models (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
jappi00 committed Dec 13, 2023
1 parent a646838 commit 6530e47
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Models/Images/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ class Image extends Model implements Resource
*/
public $labels;

/**
* @var string
*/
public $architecture;

/**
* Image constructor.
*
Expand All @@ -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(
Expand All @@ -172,6 +178,7 @@ public function __construct(
string $osVersion = null,
bool $rapidDeploy = null,
Protection $protection = null,
string $architecture = null,
array $labels = []
) {
$this->id = $id;
Expand All @@ -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();
}
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions src/Models/Servers/Types/ServerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ class ServerType extends Model
*/
public $cpuType;

/**
* @var string
*/
public $architecture;

/**
* ServerType constructor.
*
Expand All @@ -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;
}
Expand Down

0 comments on commit 6530e47

Please sign in to comment.