forked from KnpLabs/php-github-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecretScanning.php
More file actions
64 lines (59 loc) · 2.19 KB
/
Copy pathSecretScanning.php
File metadata and controls
64 lines (59 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace Github\Api\Repository;
class SecretScanning extends \Github\Api\AbstractApi
{
/**
* @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository
*
* @param string $username
* @param string $repository
* @param array $params
*
* @return array|string
*/
public function alerts(string $username, string $repository, array $params = [])
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/secret-scanning/alerts', $params);
}
/**
* @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert
*
* @param string $username
* @param string $repository
* @param int $alertNumber
*
* @return array|string
*/
public function getAlert(string $username, string $repository, int $alertNumber)
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/secret-scanning/alerts/'.$alertNumber);
}
/**
* @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert
*
* @param string $username
* @param string $repository
* @param int $alertNumber
* @param array $params
*
* @return array|string
*/
public function updateAlert(string $username, string $repository, int $alertNumber, array $params = [])
{
return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/secret-scanning/alerts/'.$alertNumber, $params);
}
/**
* @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert
*
* @param string $username
* @param string $repository
* @param int $alertNumber
* @param array $params
*
* @return array|string
*/
public function locations(string $username, string $repository, int $alertNumber, array $params = [])
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/secret-scanning/alerts/'.$alertNumber.'/locations', $params);
}
}