Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Core\Instance\Infrastructure\Client; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use App\Core\Instance\Domain\Model\ClientInstance; |
| 12 | |
| 13 | /** |
| 14 | * Remote Instance API Client Interface. |
| 15 | * |
| 16 | * Defines HTTP communication contract with remote SaaS application instances. |
| 17 | * |
| 18 | * @package App\Core\Instance\Infrastructure\Client |
| 19 | */ |
| 20 | interface RemoteInstanceApiClientInterface |
| 21 | { |
| 22 | /** |
| 23 | * Executes GET request to remote instance API endpoint. |
| 24 | * |
| 25 | * @param ClientInstance $instance Target client instance. |
| 26 | * @param string $endpoint Relative API endpoint (e.g. '/engine/system_users/list'). |
| 27 | * @param array<string, mixed> $queryParams Optional URL query parameters. |
| 28 | * @return array<string, mixed> Decoded JSON response. |
| 29 | */ |
| 30 | public function get(ClientInstance $instance, string $endpoint, array $queryParams = []): array; |
| 31 | |
| 32 | /** |
| 33 | * Executes POST request to remote instance API endpoint. |
| 34 | * |
| 35 | * @param ClientInstance $instance Target client instance. |
| 36 | * @param string $endpoint Relative API endpoint. |
| 37 | * @param array<string, mixed> $payload Request body data. |
| 38 | * @return array<string, mixed> Decoded JSON response. |
| 39 | */ |
| 40 | public function post(ClientInstance $instance, string $endpoint, array $payload = []): array; |
| 41 | |
| 42 | /** |
| 43 | * Executes PUT request to remote instance API endpoint. |
| 44 | * |
| 45 | * @param ClientInstance $instance Target client instance. |
| 46 | * @param string $endpoint Relative API endpoint. |
| 47 | * @param array<string, mixed> $payload Request body data. |
| 48 | * @return array<string, mixed> Decoded JSON response. |
| 49 | */ |
| 50 | public function put(ClientInstance $instance, string $endpoint, array $payload = []): array; |
| 51 | |
| 52 | /** |
| 53 | * Executes DELETE request to remote instance API endpoint. |
| 54 | * |
| 55 | * @param ClientInstance $instance Target client instance. |
| 56 | * @param string $endpoint Relative API endpoint. |
| 57 | * @return array<string, mixed> Decoded JSON response. |
| 58 | */ |
| 59 | public function delete(ClientInstance $instance, string $endpoint): array; |
| 60 | } |