PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.7
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.7
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / ai-http-request / application / request-handler-interface.php

request-handler-interface.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.7, at src/ai-http-request/application/request-handler-interface.php

38 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\AI_HTTP_Request\Application;
4
5 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Bad_Request_Exception;
6 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Forbidden_Exception;
7 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Internal_Server_Error_Exception;
8 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Not_Found_Exception;
9 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Payment_Required_Exception;
10 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Request_Timeout_Exception;
11 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Service_Unavailable_Exception;
12 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Too_Many_Requests_Exception;
13 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Exceptions\Unauthorized_Exception;
14 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Request;
15 use Yoast\WP\SEO\AI_HTTP_Request\Domain\Response;
16
17 interface Request_Handler_Interface {
18
19 /**
20 * Executes the request to the API.
21 *
22 * @param Request $request The request to execute.
23 *
24 * @return Response The response from the API.
25 *
26 * @throws Bad_Request_Exception When the request fails for any other reason.
27 * @throws Forbidden_Exception When the response code is 403.
28 * @throws Internal_Server_Error_Exception When the response code is 500.
29 * @throws Not_Found_Exception When the response code is 404.
30 * @throws Payment_Required_Exception When the response code is 402.
31 * @throws Request_Timeout_Exception When the response code is 408.
32 * @throws Service_Unavailable_Exception When the response code is 503.
33 * @throws Too_Many_Requests_Exception When the response code is 429.
34 * @throws Unauthorized_Exception When the response code is 401.
35 */
36 public function handle( Request $request ): Response;
37 }
38