-
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 branch 'acronis-upgrade-downgrade' into 'master'
Add upgrade/downgrade acronis methods See merge request transip/restapi-php-library!279
- Loading branch information
Showing
6 changed files
with
96 additions
and
6 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,35 @@ | ||
<?php | ||
|
||
namespace Transip\Api\Library\Repository\Acronis\Tenant; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Transip\Api\Library\Repository\Acronis\TenantRepository; | ||
use Transip\Api\Library\Repository\ApiRepository; | ||
|
||
class AddonsRepository extends ApiRepository | ||
{ | ||
public const RESOURCE_NAME = 'addons'; | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getRepositoryResourceNames(): array | ||
{ | ||
return [TenantRepository::RESOURCE_NAME, self::RESOURCE_NAME]; | ||
} | ||
|
||
/** | ||
* @param string $tenantUuid | ||
* @param array<string> $addons | ||
* @return ResponseInterface | ||
*/ | ||
public function order(string $tenantUuid, array $addons): ResponseInterface | ||
{ | ||
return $this->httpClient->post($this->getResourceUrl($tenantUuid), ['addons' => $addons]); | ||
} | ||
|
||
public function cancel(string $tenantUuid, string $addonName): void | ||
{ | ||
$this->httpClient->delete($this->getResourceUrl($tenantUuid, $addonName), []); | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace Transip\Api\Library\Repository\Acronis\Tenant; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Transip\Api\Library\Repository\Acronis\TenantRepository; | ||
use Transip\Api\Library\Repository\ApiRepository; | ||
|
||
class DowngradesRepository extends ApiRepository | ||
{ | ||
public const RESOURCE_NAME = 'downgrades'; | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getRepositoryResourceNames(): array | ||
{ | ||
return [TenantRepository::RESOURCE_NAME, self::RESOURCE_NAME]; | ||
} | ||
|
||
public function downgrade(string $tenantUuid, string $productName): ResponseInterface | ||
{ | ||
return $this->httpClient->put($this->getResourceUrl($tenantUuid), ['productName' => $productName]); | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace Transip\Api\Library\Repository\Acronis\Tenant; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Transip\Api\Library\Repository\Acronis\TenantRepository; | ||
use Transip\Api\Library\Repository\ApiRepository; | ||
|
||
class UpgradesRepository extends ApiRepository | ||
{ | ||
public const RESOURCE_NAME = 'upgrades'; | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getRepositoryResourceNames(): array | ||
{ | ||
return [TenantRepository::RESOURCE_NAME, self::RESOURCE_NAME]; | ||
} | ||
|
||
public function upgrade(string $tenantUuid, string $productName): ResponseInterface | ||
{ | ||
return $this->httpClient->put($this->getResourceUrl($tenantUuid), ['productName' => $productName]); | ||
} | ||
} |
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