|
| 1 | +<?php |
| 2 | +namespace Cubex\ApiTransport\Endpoints; |
| 3 | + |
| 4 | +use Cubex\ApiTransport\Permissions\ApiPermission; |
| 5 | + |
| 6 | +interface ApiEndpoint |
| 7 | +{ |
| 8 | + const VERB_HEAD = 'HEAD'; |
| 9 | + const VERB_GET = 'GET'; |
| 10 | + const VERB_POST = 'POST'; |
| 11 | + const VERB_PUT = 'PUT'; |
| 12 | + const VERB_PATCH = 'PATCH'; |
| 13 | + const VERB_DELETE = 'DELETE'; |
| 14 | + const VERB_PURGE = 'PURGE'; |
| 15 | + const VERB_OPTIONS = 'OPTIONS'; |
| 16 | + const VERB_TRACE = 'TRACE'; |
| 17 | + const VERB_CONNECT = 'CONNECT'; |
| 18 | + |
| 19 | + /** |
| 20 | + * @return string HTTP Verb e.g. GET, POST, DELETE, PATCH |
| 21 | + */ |
| 22 | + public function getVerb(): string; |
| 23 | + |
| 24 | + /** |
| 25 | + * @return string Path the endpoint can be located |
| 26 | + */ |
| 27 | + public function getPath(): string; |
| 28 | + |
| 29 | + /** |
| 30 | + * Payload Class |
| 31 | + * |
| 32 | + * @return null|string |
| 33 | + */ |
| 34 | + public function getPayloadClass(): ?string; |
| 35 | + |
| 36 | + /** |
| 37 | + * Response Class |
| 38 | + * |
| 39 | + * @return string |
| 40 | + */ |
| 41 | + public function getResponseClass(): string; |
| 42 | + |
| 43 | + /** |
| 44 | + * Permissions that are required to make a request to this endpoint |
| 45 | + * |
| 46 | + * @return ApiPermission[] |
| 47 | + */ |
| 48 | + public function getRequiredPermissions(): array; |
| 49 | + |
| 50 | + /** |
| 51 | + * Permissions that may be used within the endpoint to provide functionality |
| 52 | + * |
| 53 | + * @return ApiPermission[] |
| 54 | + */ |
| 55 | + public function getPermissions(): array; |
| 56 | + |
| 57 | + /** |
| 58 | + * @return bool |
| 59 | + */ |
| 60 | + public function requiresAuthentication(): bool; |
| 61 | +} |
0 commit comments