mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 03:11:09 +00:00
UserKey: step 1
This commit is contained in:
+5
-5
@@ -417,14 +417,14 @@ API `/user/following/:user`
|
||||
|
||||
API `/user/keys`
|
||||
================
|
||||
* GET: (TODO SOON)
|
||||
* POST: (TODO SOON)
|
||||
* GET: `AuthenticatedUser.get_keys`
|
||||
* POST: `AuthenticatedUser.create_key`
|
||||
|
||||
API `/user/keys/:id`
|
||||
====================
|
||||
* GET: (TODO SOON)
|
||||
* PATCH: (TODO SOON)
|
||||
* DELETE: (TODO SOON)
|
||||
* GET: `AuthenticatedUser.get_key`
|
||||
* PATCH: `UserKey.edit`
|
||||
* DELETE: `UserKey.delete`
|
||||
|
||||
API `/user/orgs`
|
||||
================
|
||||
|
||||
@@ -64,6 +64,12 @@ Authorizations
|
||||
* `get_authorization( id )`: `Authorization`
|
||||
* `create_authorization()`: `Authorization`
|
||||
|
||||
Keys
|
||||
----
|
||||
* `get_keys()`: list of `UserKey`
|
||||
* `get_key( id )`: `UserKey`
|
||||
* `create_key()`: `UserKey`
|
||||
|
||||
Followers
|
||||
---------
|
||||
* `get_followers()`: list of `NamedUser`
|
||||
@@ -841,4 +847,18 @@ Repos
|
||||
* `has_in_repos( repo )`: `bool`
|
||||
* `repo`: `Repository`
|
||||
|
||||
Class `UserKey`
|
||||
===============
|
||||
|
||||
Attributes
|
||||
----------
|
||||
|
||||
Modification
|
||||
------------
|
||||
* `edit()`
|
||||
|
||||
Deletion
|
||||
--------
|
||||
* `delete()`
|
||||
|
||||
|
||||
|
||||
+16
-1
@@ -5,7 +5,17 @@ from GithubObject import *
|
||||
|
||||
Authorization = GithubObject(
|
||||
"Authorization",
|
||||
BaseUrl( lambda obj: "/authorizations/" + str( obj.id ) ),
|
||||
BaseUrl( lambda obj: "/authorizations/" + str( obj.id ) ), ### @todo make the lambda return a tuple, and BaseUrl convert elements to strings and join them with "/"
|
||||
InternalSimpleAttributes(
|
||||
### @todo
|
||||
),
|
||||
Editable( [], [] ), ### @todo
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
UserKey = GithubObject(
|
||||
"UserKey",
|
||||
BaseUrl( lambda obj: "/user/keys/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
### @todo
|
||||
),
|
||||
@@ -36,6 +46,11 @@ AuthenticatedUser = GithubObject(
|
||||
ElementCreatable( [], [] ), ### @todo
|
||||
### url = "/authorizations", ### @todo
|
||||
),
|
||||
ExternalListOfObjects( "keys", "key", UserKey,
|
||||
ListGetable( [], [] ),
|
||||
ElementGetable( [ "id" ], [] ),
|
||||
ElementCreatable( [], [] ), ### @todo
|
||||
),
|
||||
)
|
||||
|
||||
NamedUser = GithubObject(
|
||||
|
||||
Reference in New Issue
Block a user