| @@ 19-61 (lines=43) @@ | ||
| 16 | * |
|
| 17 | * @package Gnello\MattermostRestApi\Models |
|
| 18 | */ |
|
| 19 | class ComplianceModel extends AbstractModel |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @var string |
|
| 23 | */ |
|
| 24 | private static $endpoint = '/compliance'; |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @param array $requestOptions |
|
| 28 | * @return \Psr\Http\Message\ResponseInterface |
|
| 29 | */ |
|
| 30 | public function createReport(array $requestOptions) |
|
| 31 | { |
|
| 32 | return $this->client->post(self::$endpoint . '/reports', $requestOptions); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @param array $requestOptions |
|
| 37 | * @return \Psr\Http\Message\ResponseInterface |
|
| 38 | */ |
|
| 39 | public function getReports(array $requestOptions) |
|
| 40 | { |
|
| 41 | return $this->client->get(self::$endpoint . '/reports', $requestOptions); |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * @param $reportId |
|
| 46 | * @return \Psr\Http\Message\ResponseInterface |
|
| 47 | */ |
|
| 48 | public function getReport($reportId) |
|
| 49 | { |
|
| 50 | return $this->client->get(self::$endpoint . '/reports/' . $reportId); |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * @param $reportId |
|
| 55 | * @return \Psr\Http\Message\ResponseInterface |
|
| 56 | */ |
|
| 57 | public function downloadReport($reportId) |
|
| 58 | { |
|
| 59 | return $this->client->get(self::$endpoint . '/reports/' . $reportId . '/download'); |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||
| @@ 19-62 (lines=44) @@ | ||
| 16 | * |
|
| 17 | * @package Gnello\Mattermost\Models |
|
| 18 | */ |
|
| 19 | class RoleModel extends AbstractModel |
|
| 20 | {
|
|
| 21 | /** |
|
| 22 | * @var string |
|
| 23 | */ |
|
| 24 | private static $endpoint = '/roles'; |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @param $roleId |
|
| 28 | * @return \Psr\Http\Message\ResponseInterface |
|
| 29 | */ |
|
| 30 | public function getRoleByRoleId($roleId) |
|
| 31 | {
|
|
| 32 | return $this->client->get(self::$endpoint . '/' . $roleId); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @param $roleName |
|
| 37 | * @return \Psr\Http\Message\ResponseInterface |
|
| 38 | */ |
|
| 39 | public function getRoleByRoleName($roleName) |
|
| 40 | {
|
|
| 41 | return $this->client->get(self::$endpoint . '/name/' . $roleName); |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * @param $roleId |
|
| 46 | * @param array $requestOptions |
|
| 47 | * @return \Psr\Http\Message\ResponseInterface |
|
| 48 | */ |
|
| 49 | public function patchRole($roleId, array $requestOptions) |
|
| 50 | {
|
|
| 51 | return $this->client->put(self::$endpoint . '/roles/' . $roleId . '/patch', $requestOptions); |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * @param array $requestOptions |
|
| 56 | * @return \Psr\Http\Message\ResponseInterface |
|
| 57 | */ |
|
| 58 | public function getRolesListByName(array $requestOptions) |
|
| 59 | {
|
|
| 60 | return $this->client->post(self::$endpoint . '/names', $requestOptions); |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||