@@ -363,9 +363,10 @@ public function getRepoContributors($username, $repo, $includingAnonymous = fals
363
363
* Get the teams of a repository
364
364
* @link http://developer.github.com/v3/repos/
365
365
*
366
- * @param string $username the user who owns the repo
367
- * @param string $repo the name of the repo
368
- * @return array list of the languages
366
+ * @param string $username the user who owns the repo
367
+ * @param string $repo the name of the repo
368
+ *
369
+ * @return array list of the languages
369
370
*/
370
371
public function getRepoTeams ($ username , $ repo )
371
372
{
@@ -376,14 +377,43 @@ public function getRepoTeams($username, $repo)
376
377
* Get contents of any file or directory in a repository
377
378
* @link http://developer.github.com/v3/repos/contents/
378
379
*
379
- * @param string $username the user who owns the repo
380
- * @param string $repo the name of the repo
381
- * @param string $path path to file or directory
380
+ * @param string $username the user who owns the repo
381
+ * @param string $repo the name of the repo
382
+ * @param string $path path to file or directory
382
383
*
383
- * @return array information for file | information for each item in directory
384
+ * @return array information for file | information for each item in directory
384
385
*/
385
386
public function getRepoContents ($ username , $ repo , $ path )
386
387
{
387
388
return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repo ).'/contents/ ' .$ path );
388
389
}
390
+
391
+ /**
392
+ * Get the downloads for selected repository
393
+ * @link http://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository
394
+ *
395
+ * @param string $username the user who owns the repo
396
+ * @param string $repo the name of the repo
397
+ *
398
+ * @return array
399
+ */
400
+ public function getRepoDownloads ($ username , $ repo )
401
+ {
402
+ return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repo ).'/downloads ' );
403
+ }
404
+
405
+ /**
406
+ * Delete a download in selected repository
407
+ * @link http://developer.github.com/v3/repos/downloads/#delete-a-download
408
+ *
409
+ * @param string $username the user who owns the repo
410
+ * @param string $repo the name of the repo
411
+ * @param integer $id the id of the download file
412
+ *
413
+ * @return array
414
+ */
415
+ public function deleteRepoDownload ($ username , $ repo , $ id )
416
+ {
417
+ return $ this ->delete ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repo ).'/downloads/ ' .urlencode ($ id ));
418
+ }
389
419
}
0 commit comments