| 1 | <?php | ||
| 7 | abstract class Endpoint | ||
| 8 | { | ||
| 9 | /** | ||
| 10 | * @var array | ||
| 11 | */ | ||
| 12 | protected $rateLimitInfo; | ||
| 13 | |||
| 14 | /** | ||
| 15 | * @var array | ||
| 16 | */ | ||
| 17 | protected $headers = []; | ||
| 18 | |||
| 19 | /** | ||
| 20 | * @var HttpClient | ||
| 21 | */ | ||
| 22 | protected $http; | ||
| 23 | |||
| 24 | /** | ||
| 25 | * @var string | ||
| 26 | */ | ||
| 27 | protected $organizationId; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * @param HttpClient $http | ||
| 31 | */ | ||
| 32 | public function __construct(HttpClient $http) | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @param string $verb | ||
| 39 | * @return string | ||
| 40 | */ | ||
| 41 | public function makeRequestUrl($verb = '') | ||
| 45 | |||
| 46 | /** | ||
| 47 | * @param array $params | ||
| 48 | * @return array | ||
| 49 | */ | ||
| 50 | public function getAll(array $params = []) | ||
| 60 | |||
| 61 | /** | ||
| 62 | * @param string $id | ||
| 63 | * @return array | ||
| 64 | */ | ||
| 65 | public function getById($id) | ||
| 75 | |||
| 76 | /** | ||
| 77 | * @return array | ||
| 78 | */ | ||
| 79 | protected function headers() | ||
| 86 | |||
| 87 | /** | ||
| 88 | * @param string $organizationId | ||
| 89 | * @return $this | ||
| 90 | */ | ||
| 91 | public function withOrganization($organizationId) | ||
| 97 | |||
| 98 | /** | ||
| 99 | * @return string | ||
| 100 | */ | ||
| 101 | abstract public function endpoint(); | ||
| 102 | } | ||
| 103 |