Repository navigation
Expand file tree
/
Copy pathHook.php
More file actions
76 lines (68 loc) · 1.7 KB
/
Copy pathHook.php
File metadata and controls
76 lines (68 loc) · 1.7 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
65
66
67
68
69
70
71
72
73
74
75
76
<?php
declare(strict_types=1);
namespace Github\Api\App;
use Github\Api\AbstractApi;
class Hook extends AbstractApi
{
/**
* Show the app hook configuration.
*
* @link https://docs.github.com/en/rest/apps/webhooks#get-a-webhook-configuration-for-an-app
*
* @return array
*/
public function showConfig()
{
return $this->get('/app/hook/config');
}
/**
* Update the hook configuration of an app.
*
* @link https://docs.github.com/en/rest/apps/webhooks#update-a-webhook-configuration-for-an-app
*
* @param array $params
*
* @return array
*/
public function updateConfig(array $params)
{
return $this->patch('/app/hook/config', $params);
}
/**
* List deliveries for an app webhook.
*
* @link https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook
*
* @return array
*/
public function deliveries()
{
return $this->get('/app/hook/deliveries');
}
/**
* Get a delivery for an app webhook.
*
* @link https://docs.github.com/en/rest/apps/webhooks#get-a-delivery-for-an-app-webhook
*
* @param int $delivery
*
* @return array
*/
public function delivery($delivery)
{
return $this->get('/app/hook/deliveries/'.$delivery);
}
/**
* Redeliver a delivery for an app webhook.
*
* @link https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook
*
* @param int $delivery
*
* @return array
*/
public function redeliver($delivery)
{
return $this->post('/app/hook/deliveries/'.$delivery.'/attempts');
}
}