/
Pages.php
60 lines (47 loc) · 1.86 KB
/
Pages.php
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
<?php
namespace Github\Api\Repository;
use Github\Api\AbstractApi;
use Github\Api\AcceptHeaderTrait;
/**
* @link https://developer.github.com/v3/repos/pages/
*
* @author yunwuxin <tzzhangyajun@qq.com>
*/
class Pages extends AbstractApi
{
use AcceptHeaderTrait;
public function show($username, $repository)
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages');
}
public function enable($username, $repository, array $params = [])
{
$this->acceptHeaderValue = 'application/vnd.github.switcheroo-preview+json';
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages', $params);
}
public function disable($username, $repository)
{
$this->acceptHeaderValue = 'application/vnd.github.switcheroo-preview+json';
return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages');
}
public function update($username, $repository, array $params = [])
{
return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages', $params);
}
public function requestBuild($username, $repository)
{
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds');
}
public function builds($username, $repository)
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds');
}
public function showLatestBuild($username, $repository)
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds/latest');
}
public function showBuild($username, $repository, $id)
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds/'.rawurlencode($id));
}
}