mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 03:11:09 +00:00
Hooks: step 2
This commit is contained in:
@@ -5,12 +5,13 @@ from GithubObject import *
|
||||
|
||||
Hook = GithubObject(
|
||||
"Hook",
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl + "/hooks/" + obj.id ),
|
||||
BaseUrl( lambda obj: obj._repo._baseUrl + "/hooks/" + str( obj.id ) ),
|
||||
InternalSimpleAttributes(
|
||||
### @todo
|
||||
"url", "updated_at", "created_at", "name", "events", "active", "config",
|
||||
"id", "last_response",
|
||||
"_repo", ### Ugly hack
|
||||
),
|
||||
Editable( [], [] ), #### @todo
|
||||
Editable( [ "name", "config" ], [ "events", "add_events", "remove_events", "active" ] ),
|
||||
Deletable(),
|
||||
)
|
||||
|
||||
@@ -422,7 +423,7 @@ Repository._addAttributePolicy( SeveralAttributePolicies( [
|
||||
ExternalListOfObjects( "hooks", "hook", Hook,
|
||||
ListGetable( [], [], __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementGetable( [ "id" ], [], __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( [], [], __modifyAttributesForObjectsReferingReferedRepo ), ### @todo
|
||||
ElementCreatable( [ "name", "config" ], [ "events", "active" ], __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
ExternalListOfObjects( "keys", "key", RepositoryKey,
|
||||
ListGetable( [], [], __modifyAttributesForObjectsReferingRepo ),
|
||||
|
||||
Reference in New Issue
Block a user