From 3bf073954ca1cf7cf35393fcddd8424c35d92d7c Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 1 Mar 2012 17:53:53 +0000 Subject: [PATCH] Authorizations: step 2 --- ReferenceOfClasses.md | 13 +++++++++++-- github/GithubObjects.py | 9 +++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ReferenceOfClasses.md b/ReferenceOfClasses.md index b8a059e8..687e4a28 100644 --- a/ReferenceOfClasses.md +++ b/ReferenceOfClasses.md @@ -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 -------- diff --git a/github/GithubObjects.py b/github/GithubObjects.py index 2ae7a165..051800cb 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -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( [], [] ),