5
5
use Github \Api \AcceptHeaderTrait ;
6
6
7
7
/**
8
- * @link https://developer.github.com/v3/integrations /
8
+ * @link https://developer.github.com/v3/apps /
9
9
* @author Nils Adermann <[email protected] >
10
10
*/
11
- class Integrations extends AbstractApi
11
+ class Apps extends AbstractApi
12
12
{
13
13
use AcceptHeaderTrait;
14
14
15
- /**
16
- * Configure the accept header for Early Access to the integrations api
17
- *
18
- * @see https://developer.github.com/v3/integrations/
19
- *
20
- * @return self
21
- */
22
- public function configure ()
23
- {
24
- $ this ->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json ' ;
25
-
26
- return $ this ;
27
- }
28
-
29
15
/**
30
16
* Create an access token for an installation
31
17
*
@@ -48,19 +34,19 @@ public function createInstallationToken($installationId, $userId = null)
48
34
/**
49
35
* Find all installations for the authenticated integration.
50
36
*
51
- * @link https://developer.github.com/v3/integrations /#find-installations
37
+ * @link https://developer.github.com/v3/apps /#find-installations
52
38
*
53
39
* @return array
54
40
*/
55
41
public function findInstallations ()
56
42
{
57
- return $ this ->get ('/integration /installations ' );
43
+ return $ this ->get ('/app /installations ' );
58
44
}
59
45
60
46
/**
61
47
* List repositories that are accessible to the authenticated installation.
62
48
*
63
- * @link https://developer.github.com/v3/integrations /installations/#list-repositories
49
+ * @link https://developer.github.com/v3/apps /installations/#list-repositories
64
50
*
65
51
* @param int $userId
66
52
*
@@ -73,13 +59,13 @@ public function listRepositories($userId = null)
73
59
$ parameters ['user_id ' ] = $ userId ;
74
60
}
75
61
76
- return $ this ->get ('/installation /repositories ' , $ parameters );
62
+ return $ this ->get ('/app /repositories ' , $ parameters );
77
63
}
78
64
79
65
/**
80
66
* Add a single repository to an installation.
81
67
*
82
- * @link https://developer.github.com/v3/integrations /installations/#add-repository-to-installation
68
+ * @link https://developer.github.com/v3/apps /installations/#add-repository-to-installation
83
69
*
84
70
* @param int $installationId
85
71
* @param int $repositoryId
@@ -88,13 +74,13 @@ public function listRepositories($userId = null)
88
74
*/
89
75
public function addRepository ($ installationId , $ repositoryId )
90
76
{
91
- return $ this ->put ('/installations / ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
77
+ return $ this ->put ('/app / ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
92
78
}
93
79
94
80
/**
95
81
* Remove a single repository from an installation.
96
82
*
97
- * @link https://developer.github.com/v3/integrations /installations/#remove-repository-from-installation
83
+ * @link https://developer.github.com/v3/apps /installations/#remove-repository-from-installation
98
84
*
99
85
* @param int $installationId
100
86
* @param int $repositoryId
@@ -103,6 +89,6 @@ public function addRepository($installationId, $repositoryId)
103
89
*/
104
90
public function removeRepository ($ installationId , $ repositoryId )
105
91
{
106
- return $ this ->delete ('/installations / ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
92
+ return $ this ->delete ('/app / ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
107
93
}
108
94
}
0 commit comments