diff --git a/ReferenceOfApis.md b/ReferenceOfApis.md index 8454c441..8d350016 100644 --- a/ReferenceOfApis.md +++ b/ReferenceOfApis.md @@ -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` ============= diff --git a/ReferenceOfClasses.md b/ReferenceOfClasses.md index 1b9079b9..11deaffe 100644 --- a/ReferenceOfClasses.md +++ b/ReferenceOfClasses.md @@ -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` ============== diff --git a/github/GithubObjects.py b/github/GithubObjects.py index f8d1e603..5b935e06 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -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(