Authorizations: step 1

This commit is contained in:
Vincent Jacques
2012-03-01 17:45:31 +01:00
parent 3b523190a0
commit b53f96bafa
3 changed files with 41 additions and 5 deletions
+5 -5
View File
@@ -1,13 +1,13 @@
API `/authorizations`
=====================
* GET: (TODO SOON)
* POST: (TODO SOON)
* GET: `AuthenticatedUser.get_authorizations`
* POST: `AuthenticatedUser.create_authorization`
API `/authorizations/:id`
=========================
* GET: (TODO SOON)
* PATCH: (TODO SOON)
* DELETE: (TODO SOON)
* GET: `AuthenticatedUser.get_authorization`
* PATCH: `Authorization.edit`
* DELETE: `Authorization.delete`
API `/events`
=============
+20
View File
@@ -58,6 +58,12 @@ Emails
* `remove_from_emails( email, ... )`
* `email`: string
Authorizations
--------------
* `get_authorizations()`: list of `Authorization`
* `get_authorization( id )`: `Authorization`
* `create_authorization()`: `Authorization`
Followers
---------
* `get_followers()`: list of `NamedUser`
@@ -102,6 +108,20 @@ Gists
* `create_gist( public, files, [description] )`: `Gist`
* `get_starred_gists()`: list of `Gist`
Class `Authorization`
=====================
Attributes
----------
Modification
------------
* `edit()`
Deletion
--------
* `delete()`
Class `Branch`
==============
+16
View File
@@ -3,6 +3,16 @@ import urllib
from GithubObject import *
Authorization = GithubObject(
"Authorization",
BaseUrl( lambda obj: "/authorizations/" + str( obj.id ) ),
InternalSimpleAttributes(
### @todo
),
Editable( [], [] ), ### @todo
Deletable(),
)
AuthenticatedUser = GithubObject(
"AuthenticatedUser",
BaseUrl( lambda obj: "/user" ),
@@ -20,6 +30,12 @@ AuthenticatedUser = GithubObject(
SeveralElementsAddable(),
SeveralElementsRemovable()
),
ExternalListOfObjects( "authorizations", "authorization", Authorization,
ListGetable( [], [] ),
ElementGetable( [ "id" ], [] ),
ElementCreatable( [], [] ), ### @todo
### url = "/authorizations", ### @todo
),
)
NamedUser = GithubObject(