55use Github \Api \AcceptHeaderTrait ;
66
77/**
8- * @link https://developer.github.com/v3/integrations /
8+ * @link https://developer.github.com/v3/apps /
99 * @author Nils Adermann <naderman@naderman.de>
1010 */
11- class Integrations extends AbstractApi
11+ class Apps extends AbstractApi
1212{
1313 use AcceptHeaderTrait;
1414
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-
2915 /**
3016 * Create an access token for an installation
3117 *
@@ -48,19 +34,19 @@ public function createInstallationToken($installationId, $userId = null)
4834 /**
4935 * Find all installations for the authenticated integration.
5036 *
51- * @link https://developer.github.com/v3/integrations /#find-installations
37+ * @link https://developer.github.com/v3/apps /#find-installations
5238 *
5339 * @return array
5440 */
5541 public function findInstallations ()
5642 {
57- return $ this ->get ('/integration /installations ' );
43+ return $ this ->get ('/app /installations ' );
5844 }
5945
6046 /**
6147 * List repositories that are accessible to the authenticated installation.
6248 *
63- * @link https://developer.github.com/v3/integrations /installations/#list-repositories
49+ * @link https://developer.github.com/v3/apps /installations/#list-repositories
6450 *
6551 * @param int $userId
6652 *
@@ -73,13 +59,13 @@ public function listRepositories($userId = null)
7359 $ parameters ['user_id ' ] = $ userId ;
7460 }
7561
76- return $ this ->get ('/installation /repositories ' , $ parameters );
62+ return $ this ->get ('/app /repositories ' , $ parameters );
7763 }
7864
7965 /**
8066 * Add a single repository to an installation.
8167 *
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
8369 *
8470 * @param int $installationId
8571 * @param int $repositoryId
@@ -88,13 +74,13 @@ public function listRepositories($userId = null)
8874 */
8975 public function addRepository ($ installationId , $ repositoryId )
9076 {
91- return $ this ->put ('/installations / ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
77+ return $ this ->put ('/app / ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
9278 }
9379
9480 /**
9581 * Remove a single repository from an installation.
9682 *
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
9884 *
9985 * @param int $installationId
10086 * @param int $repositoryId
@@ -103,6 +89,6 @@ public function addRepository($installationId, $repositoryId)
10389 */
10490 public function removeRepository ($ installationId , $ repositoryId )
10591 {
106- return $ this ->delete ('/installations / ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
92+ return $ this ->delete ('/app / ' .rawurlencode ($ installationId ).'/repositories/ ' .rawurlencode ($ repositoryId ));
10793 }
10894}
0 commit comments