diff --git a/doc/README.md b/doc/README.md index 02dd0c2cb5a..93bdf307335 100644 --- a/doc/README.md +++ b/doc/README.md @@ -4,6 +4,9 @@ Navigation APIs: * [Authorizations](authorizations.md) * [Commits](commits.md) +* Current User + * [Deploy keys / Public keys](currentuser/deploykeys.md) + * [Memberships](currentuser/memberships.md) * [Enterprise](enterprise.md) * [Gists](gists.md) * [Comments](gists/comments.md) diff --git a/doc/currentuser/deploykeys.md b/doc/currentuser/deploykeys.md new file mode 100644 index 00000000000..5cfcf82b77e --- /dev/null +++ b/doc/currentuser/deploykeys.md @@ -0,0 +1,36 @@ +## Current user / Public Keys API +[Back to the navigation](../README.md) + +Wraps [GitHub User Public Keys API](https://developer.github.com/v3/users/keys/#public-keys). + +### List your public keys + +```php +$keys = $client->user()->keys()->all(); +``` + +Returns a list of public keys for the authenticated user. + +### Shows a public key for the authenticated user. + +```php +$key = $client->user()->keys()->show(1234); +``` + +### Add a public key to the authenticated user. + +> Requires [authentication](security.md). + +```php +$key = $client->user()->keys()->create(array('title' => 'key title', 'key' => 12345)); +``` + +Adds a key with title 'key title' to the authenticated user and returns a the created key for the user. + +### Remove a public key from the authenticated user. + +> Requires [authentication](security.md). + +```php +$client->user()->keys()->remove(12345); +``` diff --git a/lib/Github/Api/CurrentUser/DeployKeys.php b/lib/Github/Api/CurrentUser/DeployKeys.php index fb64ba73ff1..2d53d1a87a8 100644 --- a/lib/Github/Api/CurrentUser/DeployKeys.php +++ b/lib/Github/Api/CurrentUser/DeployKeys.php @@ -14,7 +14,7 @@ class DeployKeys extends AbstractApi /** * List deploy keys for the authenticated user. * - * @link http://developer.github.com/v3/repos/keys/ + * @link https://developer.github.com/v3/users/keys/ * * @return array */ @@ -26,7 +26,7 @@ public function all() /** * Shows deploy key for the authenticated user. * - * @link http://developer.github.com/v3/repos/keys/ + * @link https://developer.github.com/v3/users/keys/ * * @param string $id * @@ -40,7 +40,7 @@ public function show($id) /** * Adds deploy key for the authenticated user. * - * @link http://developer.github.com/v3/repos/keys/ + * @link https://developer.github.com/v3/users/keys/ * * @param array $params * @@ -60,7 +60,7 @@ public function create(array $params) /** * Removes deploy key for the authenticated user. * - * @link http://developer.github.com/v3/repos/keys/ + * @link https://developer.github.com/v3/users/keys/ * * @param string $id *