UserKey: step 1

This commit is contained in:
Vincent Jacques
2012-03-01 17:45:41 +01:00
parent b53f96bafa
commit f02c938974
3 changed files with 41 additions and 6 deletions
+5 -5
View File
@@ -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`
================
+20
View File
@@ -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
View File
@@ -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(