1 | <?php declare(strict_types=1); |
||
17 | final class ApiSettings |
||
18 | { |
||
19 | const NAMESPACE = 'ApiClients\\Client\\Github\\Resource'; |
||
20 | |||
21 | const ACCEPT_HEADER = [ |
||
22 | // License on repository object: https://developer.github.com/v3/licenses/#licenses |
||
23 | 'application/vnd.github.drax-preview+json', |
||
24 | |||
25 | // Topics on repository object: https://developer.github.com/v3/repos/#repositories |
||
26 | 'application/vnd.github.mercy-preview+json', |
||
27 | |||
28 | // Community Health: https://developer.github.com/v3/repos/community/#community-health |
||
29 | 'application/vnd.github.black-panther-preview+json', |
||
30 | |||
31 | // Default header: https://developer.github.com/v3/#current-version |
||
32 | 'application/vnd.github.v3+json', |
||
33 | ]; |
||
34 | |||
35 | const TRANSPORT_OPTIONS = [ |
||
36 | FoundationOptions::HYDRATOR_OPTIONS => [ |
||
37 | HydratorOptions::NAMESPACE => self::NAMESPACE, |
||
38 | HydratorOptions::NAMESPACE_DIR => __DIR__ . DIRECTORY_SEPARATOR . 'Resource' . DIRECTORY_SEPARATOR, |
||
39 | ], |
||
40 | FoundationOptions::TRANSPORT_OPTIONS => [ |
||
41 | TransportOptions::HOST => 'api.github.com', |
||
42 | TransportOptions::MIDDLEWARE => [ |
||
43 | JsonDecodeMiddleware::class, |
||
44 | JsonEncodeMiddleware::class, |
||
45 | HttpExceptionsMiddleware::class, |
||
46 | UserAgentMiddleware::class, |
||
47 | RateLimitStateMiddleware::class, |
||
48 | ], |
||
49 | TransportOptions::DEFAULT_REQUEST_OPTIONS => [ |
||
50 | UserAgentMiddleware::class => [ |
||
51 | UserAgentMiddlewareOptions::STRATEGY => UserAgentStrategies::PACKAGE_VERSION, |
||
52 | UserAgentMiddlewareOptions::PACKAGE => 'api-clients/github', |
||
53 | ], |
||
54 | ], |
||
55 | ], |
||
56 | ]; |
||
57 | |||
58 | public static function getOptions( |
||
72 | } |
||
73 |