Skip to content

Added missing docs for currentuser public keys #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
36 changes: 36 additions & 0 deletions doc/currentuser/deploykeys.md
Original file line number Diff line number Diff line change
@@ -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);
```
8 changes: 4 additions & 4 deletions lib/Github/Api/CurrentUser/DeployKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*
Expand All @@ -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
*
Expand All @@ -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
*
Expand Down