9
9
*/
10
10
class Apps extends AbstractApi
11
11
{
12
+ use AcceptHeaderTrait;
13
+
14
+ private function configurePreviewHeader ()
15
+ {
16
+ $ this ->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json ' ;
17
+ }
18
+
12
19
/**
13
20
* Create an access token for an installation.
14
21
*
@@ -27,6 +34,8 @@ public function createInstallationToken($installationId, $userId = null)
27
34
$ parameters ['user_id ' ] = $ userId ;
28
35
}
29
36
37
+ $ this ->configurePreviewHeader ();
38
+
30
39
return $ this ->post ('/app/installations/ ' .rawurlencode ($ installationId ).'/access_tokens ' , $ parameters );
31
40
}
32
41
@@ -39,6 +48,8 @@ public function createInstallationToken($installationId, $userId = null)
39
48
*/
40
49
public function findInstallations ()
41
50
{
51
+ $ this ->configurePreviewHeader ();
52
+
42
53
return $ this ->get ('/app/installations ' );
43
54
}
44
55
@@ -58,6 +69,8 @@ public function listRepositories($userId = null)
58
69
$ parameters ['user_id ' ] = $ userId ;
59
70
}
60
71
72
+ $ this ->configurePreviewHeader ();
73
+
61
74
return $ this ->get ('/installation/repositories ' , $ parameters );
62
75
}
63
76
@@ -73,6 +86,8 @@ public function listRepositories($userId = null)
73
86
*/
74
87
public function addRepository ($ installationId , $ repositoryId )
75
88
{
89
+ $ this ->configurePreviewHeader ();
90
+
76
91
return $ this ->put ('/installations/ ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
77
92
}
78
93
@@ -88,6 +103,8 @@ public function addRepository($installationId, $repositoryId)
88
103
*/
89
104
public function removeRepository ($ installationId , $ repositoryId )
90
105
{
106
+ $ this ->configurePreviewHeader ();
107
+
91
108
return $ this ->delete ('/installations/ ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
92
109
}
93
110
}
0 commit comments