Skip to content

Commit

Permalink
Merge branch 'OperatingSystemLicenses' into 'master'
Browse files Browse the repository at this point in the history
Added getByVpsName method to operatingsystem resource and added minQuantity to...

See merge request transip/restapi-php-library!138
  • Loading branch information
stefankonig committed Jun 10, 2021
2 parents b2cd27f + 3954f7d commit 495b7cb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

6.8.0
-----
* Added getByVpsName method to the OperatingSystem resource
* Added minQuantity to the LicenceProduct

6.7.2
-----
* Access token automatically renews when it is revoked
Expand Down
8 changes: 8 additions & 0 deletions src/Entity/Vps/LicenseProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class LicenseProduct extends AbstractEntity
/** @var string */
protected $type;

/** @var int */
protected $minQuantity;

/** @var int */
protected $maxQuantity;

Expand All @@ -41,6 +44,11 @@ public function getType(): string
return $this->type;
}

public function getMinQuantity(): int
{
return $this->minQuantity;
}

public function getMaxQuantity(): int
{
return $this->maxQuantity;
Expand Down
17 changes: 17 additions & 0 deletions src/Repository/Vps/OperatingSystemRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ public function getAll(): array
return $operatingSystems;
}

/**
* @param string $vpsName
* @return OperatingSystem[]
*/
public function getByVpsName(string $vpsName): array
{
$operatingSystems = [];
$response = $this->httpClient->get($this->getResourceUrl($vpsName));
$operatingSystemsArray = $this->getParameterFromResponse($response, 'operatingSystems');

foreach ($operatingSystemsArray as $operatingSystemArray) {
$operatingSystems[] = new OperatingSystem($operatingSystemArray);
}

return $operatingSystems;
}

/**
* @param string $vpsName
* @param string $operatingSystemName
Expand Down
2 changes: 1 addition & 1 deletion src/TransipAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
class TransipAPI
{
public const TRANSIP_API_ENDPOINT = "https://api.transip.nl/v6";
public const TRANSIP_API_LIBRARY_VERSION = "6.7.2";
public const TRANSIP_API_LIBRARY_VERSION = "6.8.0";
public const TRANSIP_API_DEMO_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImN3MiFSbDU2eDNoUnkjelM4YmdOIn0.eyJpc3MiOiJhcGkudHJhbnNpcC5ubCIsImF1ZCI6ImFwaS50cmFuc2lwLm5sIiwianRpIjoiY3cyIVJsNTZ4M2hSeSN6UzhiZ04iLCJpYXQiOjE1ODIyMDE1NTAsIm5iZiI6MTU4MjIwMTU1MCwiZXhwIjoyMTE4NzQ1NTUwLCJjaWQiOiI2MDQ0OSIsInJvIjpmYWxzZSwiZ2siOmZhbHNlLCJrdiI6dHJ1ZX0.fYBWV4O5WPXxGuWG-vcrFWqmRHBm9yp0PHiYh_oAWxWxCaZX2Rf6WJfc13AxEeZ67-lY0TA2kSaOCp0PggBb_MGj73t4cH8gdwDJzANVxkiPL1Saqiw2NgZ3IHASJnisUWNnZp8HnrhLLe5ficvb1D9WOUOItmFC2ZgfGObNhlL2y-AMNLT4X7oNgrNTGm-mespo0jD_qH9dK5_evSzS3K8o03gu6p19jxfsnIh8TIVRvNdluYC2wo4qDl5EW5BEZ8OSuJ121ncOT1oRpzXB0cVZ9e5_UVAEr9X3f26_Eomg52-PjrgcRJ_jPIUYbrlo06KjjX2h0fzMr21ZE023Gw";

/**
Expand Down

0 comments on commit 495b7cb

Please sign in to comment.