| @@ 21-73 (lines=53) @@ | ||
| 18 | * |
|
| 19 | * @package Gnello\MattermostRestApi\Models |
|
| 20 | */ |
|
| 21 | class EmojiModel extends AbstractModel |
|
| 22 | { |
|
| 23 | /** |
|
| 24 | * @var string |
|
| 25 | */ |
|
| 26 | private static $endpoint = '/emoji'; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @param array $requestOptions |
|
| 30 | * @return \Psr\Http\Message\ResponseInterface |
|
| 31 | */ |
|
| 32 | public function createCustomEmoji(array $requestOptions) |
|
| 33 | { |
|
| 34 | return $this->client->post(self::$endpoint, $requestOptions, Client::TYPE_MULTIPART); |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * @param array $requestOptions |
|
| 39 | * @return \Psr\Http\Message\ResponseInterface |
|
| 40 | */ |
|
| 41 | public function getListOfCustomEmoji(array $requestOptions) |
|
| 42 | { |
|
| 43 | return $this->client->get(self::$endpoint, $requestOptions); |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * @param $emojiId |
|
| 48 | * @return \Psr\Http\Message\ResponseInterface |
|
| 49 | */ |
|
| 50 | public function getCustomEmoji($emojiId) |
|
| 51 | { |
|
| 52 | return $this->client->get(self::$endpoint . '/' . $emojiId); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @param $emojiId |
|
| 57 | * @return \Psr\Http\Message\ResponseInterface |
|
| 58 | */ |
|
| 59 | public function deleteCustomEmoji($emojiId) |
|
| 60 | { |
|
| 61 | return $this->client->delete(self::$endpoint . '/' . $emojiId); |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * @param $emojiId |
|
| 66 | * @return \Psr\Http\Message\ResponseInterface |
|
| 67 | */ |
|
| 68 | public function getCustomEmojiImage($emojiId) |
|
| 69 | { |
|
| 70 | return $this->client->get(self::$endpoint . '/' . $emojiId . '/image'); |
|
| 71 | } |
|
| 72 | ||
| 73 | } |
|
| 74 | ||
| @@ 21-73 (lines=53) @@ | ||
| 18 | * |
|
| 19 | * @package Gnello\Mattermost\Models |
|
| 20 | */ |
|
| 21 | class JobModel extends AbstractModel |
|
| 22 | { |
|
| 23 | /** |
|
| 24 | * @var string |
|
| 25 | */ |
|
| 26 | private static $endpoint = '/jobs'; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @param array $requestOptions |
|
| 30 | * @return \Psr\Http\Message\ResponseInterface |
|
| 31 | */ |
|
| 32 | public function getJobs(array $requestOptions = []) |
|
| 33 | { |
|
| 34 | return $this->client->get(self::$endpoint, $requestOptions, Client::TYPE_QUERY); |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * @param array $requestOptions |
|
| 39 | * @return \Psr\Http\Message\ResponseInterface |
|
| 40 | */ |
|
| 41 | public function createJob(array $requestOptions) |
|
| 42 | { |
|
| 43 | return $this->client->post(self::$endpoint, $requestOptions); |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * @param $jobId |
|
| 48 | * @return \Psr\Http\Message\ResponseInterface |
|
| 49 | */ |
|
| 50 | public function getJob($jobId) |
|
| 51 | { |
|
| 52 | return $this->client->get(self::$endpoint . '/' . $jobId); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @param $jobId |
|
| 57 | * @return \Psr\Http\Message\ResponseInterface |
|
| 58 | */ |
|
| 59 | public function deleteJob($jobId) |
|
| 60 | { |
|
| 61 | return $this->client->post(self::$endpoint . '/' . $jobId . '/cancel'); |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * @param $type |
|
| 66 | * @param array $requestOptions |
|
| 67 | * @return \Psr\Http\Message\ResponseInterface |
|
| 68 | */ |
|
| 69 | public function getJobsOfType($type, array $requestOptions = []) |
|
| 70 | { |
|
| 71 | return $this->client->get(self::$endpoint . '/type/' . $type, $requestOptions); |
|
| 72 | } |
|
| 73 | } |
|
| 74 | ||