Authorizations: step 2

This commit is contained in:
Vincent Jacques
2012-03-01 17:53:53 +00:00
parent 2ea7ce7723
commit 3bf073954c
2 changed files with 16 additions and 6 deletions
+11 -2
View File
@@ -62,7 +62,7 @@ Authorizations
--------------
* `get_authorizations()`: list of `Authorization`
* `get_authorization( id )`: `Authorization`
* `create_authorization()`: `Authorization`
* `create_authorization( [scopes, note, note_url] )`: `Authorization`
Keys
----
@@ -119,10 +119,19 @@ Class `Authorization`
Attributes
----------
* `id`
* `url`
* `scopes`
* `token`
* `app`
* `note`
* `note_url`
* `updated_at`
* `created_at`
Modification
------------
* `edit()`
* `edit( [scopes, add_scopes, remove_scopes, note, note_url] )`
Deletion
--------
+5 -4
View File
@@ -7,9 +7,10 @@ Authorization = GithubObject(
"Authorization",
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
"id", "url", "scopes", "token", "app", "note", "note_url", "updated_at",
"created_at",
),
Editable( [], [] ), ### @todo
Editable( [], [ "scopes", "add_scopes", "remove_scopes", "note", "note_url" ] ),
Deletable(),
)
@@ -43,8 +44,8 @@ AuthenticatedUser = GithubObject(
ExternalListOfObjects( "authorizations", "authorization", Authorization,
ListGetable( [], [] ),
ElementGetable( [ "id" ], [] ),
ElementCreatable( [], [] ), ### @todo
### url = "/authorizations", ### @todo
ElementCreatable( [], [ "scopes", "note", "note_url" ] ),
url = "/authorizations",
),
ExternalListOfObjects( "keys", "key", UserKey,
ListGetable( [], [] ),