|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Github\Api\Repository; |
| 4 | + |
| 5 | +class SecretScanning extends \Github\Api\AbstractApi |
| 6 | +{ |
| 7 | + /** |
| 8 | + * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository |
| 9 | + * |
| 10 | + * @param string $username |
| 11 | + * @param string $repository |
| 12 | + * @param array $params |
| 13 | + * |
| 14 | + * @return array|string |
| 15 | + */ |
| 16 | + public function alerts(string $username, string $repository, array $params = []) |
| 17 | + { |
| 18 | + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/secret-scanning/alerts', $params); |
| 19 | + } |
| 20 | + |
| 21 | + /** |
| 22 | + * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert |
| 23 | + * |
| 24 | + * @param string $username |
| 25 | + * @param string $repository |
| 26 | + * @param int $alertNumber |
| 27 | + * |
| 28 | + * @return array|string |
| 29 | + */ |
| 30 | + public function getAlert(string $username, string $repository, int $alertNumber) |
| 31 | + { |
| 32 | + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/secret-scanning/alerts/'.$alertNumber); |
| 33 | + } |
| 34 | + |
| 35 | + /** |
| 36 | + * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert |
| 37 | + * |
| 38 | + * @param string $username |
| 39 | + * @param string $repository |
| 40 | + * @param int $alertNumber |
| 41 | + * @param array $params |
| 42 | + * |
| 43 | + * @return array|string |
| 44 | + */ |
| 45 | + public function updateAlert(string $username, string $repository, int $alertNumber, array $params = []) |
| 46 | + { |
| 47 | + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/secret-scanning/alerts/'.$alertNumber, $params); |
| 48 | + } |
| 49 | + |
| 50 | + /** |
| 51 | + * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert |
| 52 | + * |
| 53 | + * @param string $username |
| 54 | + * @param string $repository |
| 55 | + * @param int $alertNumber |
| 56 | + * @param array $params |
| 57 | + * |
| 58 | + * @return array|string |
| 59 | + */ |
| 60 | + public function locations(string $username, string $repository, int $alertNumber, array $params = []) |
| 61 | + { |
| 62 | + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/secret-scanning/alerts/'.$alertNumber.'/locations', $params); |
| 63 | + } |
| 64 | +} |
0 commit comments