diff --git a/composer.lock b/composer.lock index ff6eee9..f82dfd4 100644 --- a/composer.lock +++ b/composer.lock @@ -484,16 +484,16 @@ }, { "name": "mittwald/api-client", - "version": "v1.0.29", + "version": "v1.0.30", "source": { "type": "git", "url": "https://github.com/mittwald/api-client-php.git", - "reference": "a6b84eed034a2134ff354e99f97d1699ec32395a" + "reference": "39c535539caae2835cd46b094b57a4dd889f052c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mittwald/api-client-php/zipball/a6b84eed034a2134ff354e99f97d1699ec32395a", - "reference": "a6b84eed034a2134ff354e99f97d1699ec32395a", + "url": "https://api.github.com/repos/mittwald/api-client-php/zipball/39c535539caae2835cd46b094b57a4dd889f052c", + "reference": "39c535539caae2835cd46b094b57a4dd889f052c", "shasum": "" }, "require": { @@ -524,9 +524,9 @@ "description": "Client library for the mittwald mStudio v2 API", "support": { "issues": "https://github.com/mittwald/api-client-php/issues", - "source": "https://github.com/mittwald/api-client-php/tree/v1.0.29" + "source": "https://github.com/mittwald/api-client-php/tree/v1.0.30" }, - "time": "2023-11-10T00:14:19+00:00" + "time": "2023-11-15T14:13:26+00:00" }, { "name": "psr/http-client", @@ -734,7 +734,7 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -781,7 +781,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" }, "funding": [ { diff --git a/src/Recipes/DomainRecipe.php b/src/Recipes/DomainRecipe.php index b225bbd..9f43a77 100644 --- a/src/Recipes/DomainRecipe.php +++ b/src/Recipes/DomainRecipe.php @@ -3,15 +3,14 @@ namespace Mittwald\Deployer\Recipes; use Mittwald\ApiClient\Client\EmptyResponse; -use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressCreate\IngressCreate201Response; -use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressCreate\IngressCreateRequest; -use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressCreate\IngressCreateRequestBody; -use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressListForProject\IngressListForProject200Response; -use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressListForProject\IngressListForProjectRequest; -use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressPaths\IngressPathsRequest; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressCreateIngress\IngressCreateIngress201Response; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressCreateIngress\IngressCreateIngressRequest; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressCreateIngress\IngressCreateIngressRequestBody; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressListIngresses\IngressListIngresses200Response; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressListIngresses\IngressListIngressesRequest; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\IngressUpdateIngressPaths\IngressUpdateIngressPathsRequest; use Mittwald\ApiClient\Generated\V2\Schemas\Ingress\Path; use Mittwald\ApiClient\Generated\V2\Schemas\Ingress\TargetInstallation; -use function Deployer\get; use function Deployer\info; use function Deployer\parse; use function Deployer\set; @@ -51,8 +50,8 @@ private static function assertVirtualHost(string $domain): void $project = BaseRecipe::getProject(); $app = AppRecipe::getAppInstallation(); - $virtualHostResponse = $client->ingressListForProject(new IngressListForProjectRequest($project->getId())); - if (!$virtualHostResponse instanceof IngressListForProject200Response) { + $virtualHostResponse = $client->ingressListIngresses((new IngressListIngressesRequest())->withProjectId($project->getId())); + if (!$virtualHostResponse instanceof IngressListIngresses200Response) { throw new \Exception('could not list virtual hosts'); } @@ -68,14 +67,14 @@ private static function assertVirtualHost(string $domain): void if ($virtualHost === null) { info("virtual host {$domain} does not exist, creating it"); - $request = new IngressCreateRequest((new IngressCreateRequestBody( + $request = new IngressCreateIngressRequest((new IngressCreateIngressRequestBody( $domain, [new Path($domainPathPrefix, new TargetInstallation($app->getId()))], $project->getId(), ))); - $response = $client->ingressCreate($request); + $response = $client->ingressCreateIngress($request); - if (!$response instanceof IngressCreate201Response) { + if (!$response instanceof IngressCreateIngress201Response) { throw new \Exception('could not create virtual host'); } } else { @@ -104,8 +103,8 @@ private static function assertVirtualHost(string $domain): void if ($updateRequired) { info("virtual host {$domain} exists, updating it"); - $request = new IngressPathsRequest($virtualHost->getId(), $updatedPaths); - $response = $client->ingressPaths($request); + $request = new IngressUpdateIngressPathsRequest($virtualHost->getId(), $updatedPaths); + $response = $client->ingressUpdateIngressPaths($request); if (!$response instanceof EmptyResponse) { throw new \Exception('could not update virtual host');