-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #541 from ans-group/feat/38273/38683
[AB#38683] added instance software to public sdk.
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace UKFast\SDK\eCloud\Entities; | ||
|
||
use UKFast\SDK\Entity; | ||
|
||
/** | ||
* @property string $id | ||
* @property string $name | ||
* @property string $instanceId | ||
* @property string $softwareId | ||
* @property string $sync | ||
* @property string $task | ||
* @property \DateTime $createdAt | ||
* @property \DateTime $updatedAt | ||
*/ | ||
class InstanceSoftware extends Entity | ||
{ | ||
protected $dates = ['createdAt', 'updatedAt']; | ||
|
||
public static $entityMap = [ | ||
'id' => 'id', | ||
'name' => 'name', | ||
'instance_id' => 'instanceId', | ||
'software_id' => 'softwareId', | ||
'sync' => 'sync', | ||
'task' => 'task', | ||
'created_at' => 'createdAt', | ||
'updated_at' => 'updatedAt', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace UKFast\SDK\eCloud; | ||
|
||
use UKFast\SDK\Entities\ClientEntityInterface; | ||
use UKFast\SDK\Traits\PageItems; | ||
use UKFast\SDK\eCloud\Entities\InstanceSoftware; | ||
|
||
class InstanceSoftwareClient extends Client implements ClientEntityInterface | ||
{ | ||
use PageItems; | ||
|
||
protected $collectionPath = 'v2/instance-software'; | ||
|
||
public function getEntityMap() | ||
{ | ||
return InstanceSoftware::$entityMap; | ||
} | ||
|
||
public function loadEntity($data) | ||
{ | ||
return new InstanceSoftware( | ||
$this->apiToFriendly($data, $this->getEntityMap()) | ||
); | ||
} | ||
} |