mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Generate some repetitive doc files
This commit is contained in:
@@ -1 +1,2 @@
|
||||
/build/
|
||||
github_objects.rst
|
||||
|
||||
@@ -1,607 +0,0 @@
|
||||
API `/authorizations`
|
||||
=====================
|
||||
* GET: `AuthenticatedUser.get_authorizations`
|
||||
* POST: `AuthenticatedUser.create_authorization`
|
||||
|
||||
API `/authorizations/:id`
|
||||
=========================
|
||||
* GET: `AuthenticatedUser.get_authorization`
|
||||
* PATCH: `Authorization.edit`
|
||||
* DELETE: `Authorization.delete`
|
||||
|
||||
API `/events`
|
||||
=============
|
||||
* GET: `AuthenticatedUser.get_events`
|
||||
|
||||
API `/gists`
|
||||
============
|
||||
* GET: `AuthenticatedUser.get_gists`
|
||||
* POST: `AuthenticatedUser.create_gist`
|
||||
|
||||
API `/gists/:id`
|
||||
================
|
||||
* GET: `Github.get_gist`
|
||||
* PATCH: `Gist.edit`
|
||||
* DELETE: `Gist.delete`
|
||||
|
||||
API `/gists/:id/comments`
|
||||
=========================
|
||||
* GET: `Gist.get_comments`
|
||||
* POST: `Gist.create_comment`
|
||||
|
||||
API `/gists/:id/fork`
|
||||
=====================
|
||||
* POST: `Gist.create_fork`
|
||||
|
||||
API `/gists/:id/star`
|
||||
=====================
|
||||
* GET: `Gist.is_starred`
|
||||
* PUT: `Gist.set_starred`
|
||||
* DELETE: `Gist.reset_starred`
|
||||
|
||||
API `/gists/comments/:id`
|
||||
=========================
|
||||
* GET: `Gist.get_comment`
|
||||
* PATCH: `GistComment.edit`
|
||||
* DELETE: `GistComment.delete`
|
||||
|
||||
API `/gists/public`
|
||||
===================
|
||||
* GET: `Github.get_gists`
|
||||
|
||||
API `/gists/starred`
|
||||
====================
|
||||
* GET: `AuthenticatedUser.get_starred_gists`
|
||||
|
||||
API `/gitignore/templates`
|
||||
==========================
|
||||
* GET: `Github.get_gitignore_templates`
|
||||
|
||||
API `/gitignore/templates/:name`
|
||||
================================
|
||||
* GET: `Github.get_gitignore_template`
|
||||
|
||||
API `/hooks`
|
||||
============
|
||||
* GET: `Github.get_hooks`
|
||||
|
||||
API `/issues`
|
||||
=============
|
||||
* GET: `AuthenticatedUser.get_issues`
|
||||
|
||||
API `/legacy/issues/search/:owner/:repository/:state/:keyword`
|
||||
==============================================================
|
||||
* GET: `Repository.legacy_search_issues`
|
||||
|
||||
API `/legacy/repos/search/:keyword`
|
||||
===================================
|
||||
* GET: `Github.legacy_search_repos`
|
||||
|
||||
API `/legacy/user/email/:email`
|
||||
===============================
|
||||
* GET: `Github.legacy_search_user_by_email`
|
||||
|
||||
API `/legacy/user/search/:keyword`
|
||||
==================================
|
||||
* GET: `Github.legacy_search_users`
|
||||
|
||||
API `/markdown`
|
||||
===============
|
||||
* POST: `Github.render_markdown`
|
||||
|
||||
API `/markdown/raw`
|
||||
===================
|
||||
* POST: see API `/markdown`
|
||||
|
||||
API `/networks/:user/:repo/events`
|
||||
==================================
|
||||
* GET: `Repository.get_network_events`
|
||||
|
||||
API `/orgs/:org`
|
||||
================
|
||||
* GET: `Github.get_organization`
|
||||
* PATCH: `Organization.edit`
|
||||
|
||||
API `/orgs/:org/events`
|
||||
=======================
|
||||
* GET: `Organization.get_events`
|
||||
|
||||
API `/orgs/:org/members`
|
||||
========================
|
||||
* GET: `Organization.get_members`
|
||||
|
||||
API `/orgs/:org/members/:user`
|
||||
==============================
|
||||
* GET: `Organization.has_in_members`
|
||||
* DELETE: `Organization.remove_from_members`
|
||||
|
||||
API `/orgs/:org/public_members`
|
||||
===============================
|
||||
* GET: `Organization.get_public_members`
|
||||
|
||||
API `/orgs/:org/public_members/:user`
|
||||
=====================================
|
||||
* GET: `Organization.has_in_public_members`
|
||||
* PUT: `Organization.add_to_public_members`
|
||||
* DELETE: `Organization.remove_from_public_members`
|
||||
|
||||
API `/orgs/:org/repos`
|
||||
======================
|
||||
* GET: `Organization.get_repos`
|
||||
* POST: `Organization.create_repo`
|
||||
|
||||
API `/orgs/:org/teams`
|
||||
======================
|
||||
* GET: `Organization.get_teams`
|
||||
* POST: `Organization.create_team`
|
||||
|
||||
API `/rate_limit`
|
||||
=================
|
||||
* GET: Not implemented, see `Github.rate_limiting`
|
||||
|
||||
API `/repos/:user/:repo`
|
||||
========================
|
||||
* GET: `AuthenticatedUser.get_repo` or `NamedUser.get_repo` or `Organization.get_repo` or `Github.get_repo`
|
||||
* PATCH: `Repository.edit`
|
||||
* DELETE: `Repository.delete`
|
||||
|
||||
API `/repos/:user/:repo/:archive_format/:ref`
|
||||
=============================================
|
||||
* GET: `Repository.get_archive_link`
|
||||
|
||||
API `/repos/:user/:repo/assignees`
|
||||
==================================
|
||||
* GET: `Repository.get_assignees`
|
||||
|
||||
API `/repos/:user/:repo/assignees/:assignee`
|
||||
============================================
|
||||
* GET: `Repository.has_in_assignees`
|
||||
|
||||
API `/repos/:user/:repo/branches`
|
||||
=================================
|
||||
* GET: `Repository.get_branches`
|
||||
|
||||
API `/repos/:user/:repo/branches/:branch`
|
||||
=========================================
|
||||
* GET: `Repository.get_branch`
|
||||
|
||||
API `/repos/:user/:repo/collaborators`
|
||||
======================================
|
||||
* GET: `Repository.get_collaborators`
|
||||
|
||||
API `/repos/:user/:repo/collaborators/:user`
|
||||
============================================
|
||||
* GET: `Repository.has_in_collaborators`
|
||||
* PUT: `Repository.add_to_collaborators`
|
||||
* DELETE: `Repository.remove_from_collaborators`
|
||||
|
||||
API `/repos/:user/:repo/comments`
|
||||
=================================
|
||||
* GET: `Repository.get_comments`
|
||||
|
||||
API `/repos/:user/:repo/comments/:id`
|
||||
=====================================
|
||||
* GET: `Repository.get_comment`
|
||||
* PATCH: `CommitComment.edit`
|
||||
* DELETE: `CommitComment.delete`
|
||||
|
||||
API `/repos/:user/:repo/commits`
|
||||
================================
|
||||
* GET: `Repository.get_commits`
|
||||
|
||||
API `/repos/:user/:repo/commits/:sha`
|
||||
=====================================
|
||||
* GET: `Repository.get_commit`
|
||||
|
||||
API `/repos/:user/:repo/commits/:sha/comments`
|
||||
==============================================
|
||||
* GET: `Commit.get_comments`
|
||||
* POST: `Commit.create_comment`
|
||||
|
||||
API `/repos/:user/:repo/compare/:base...:head`
|
||||
==============================================
|
||||
* GET: `Repository.compare`
|
||||
|
||||
API `/repos/:user/:repo/contents/:path`
|
||||
=======================================
|
||||
* GET: `Repository.get_contents`
|
||||
|
||||
API `/repos/:user/:repo/contributors`
|
||||
=====================================
|
||||
* GET: `Repository.get_contributors`
|
||||
|
||||
API `/repos/:user/:repo/downloads`
|
||||
==================================
|
||||
* GET: `Repository.get_downloads`
|
||||
* POST: `Repository.create_download`
|
||||
|
||||
API `/repos/:user/:repo/downloads/:id`
|
||||
======================================
|
||||
* GET: `Repository.get_download`
|
||||
* DELETE: `Download.delete`
|
||||
|
||||
API `/repos/:user/:repo/events`
|
||||
===============================
|
||||
* GET: `Repository.get_events`
|
||||
|
||||
API `/repos/:user/:repo/forks`
|
||||
==============================
|
||||
* GET: `Repository.get_forks`
|
||||
* POST: `AuthenticatedUser.create_fork` or `Organization.create_fork`
|
||||
|
||||
API `/repos/:user/:repo/git/blobs`
|
||||
==================================
|
||||
* POST: `Repository.create_git_blob`
|
||||
|
||||
API `/repos/:user/:repo/git/blobs/:sha`
|
||||
=======================================
|
||||
* GET: `Repository.get_git_blob`
|
||||
|
||||
API `/repos/:user/:repo/git/commits`
|
||||
====================================
|
||||
* POST: `Repository.create_git_commit`
|
||||
|
||||
API `/repos/:user/:repo/git/commits/:sha`
|
||||
=========================================
|
||||
* GET: `Repository.get_git_commit`
|
||||
|
||||
API `/repos/:user/:repo/git/refs`
|
||||
=================================
|
||||
* GET: `Repository.get_git_refs`
|
||||
* POST: `Repository.create_git_ref`
|
||||
|
||||
API `/repos/:user/:repo/git/refs/:ref`
|
||||
======================================
|
||||
* GET: `Repository.get_git_ref`
|
||||
* PATCH: `GitRef.edit`
|
||||
* DELETE: `GitRef.delete`
|
||||
|
||||
API `/repos/:user/:repo/git/tags`
|
||||
=================================
|
||||
* POST: `Repository.create_git_tag`
|
||||
|
||||
API `/repos/:user/:repo/git/tags/:sha`
|
||||
======================================
|
||||
* GET: `Repository.get_git_tag`
|
||||
|
||||
API `/repos/:user/:repo/git/trees`
|
||||
==================================
|
||||
* POST: `Repository.create_git_tree`
|
||||
|
||||
API `/repos/:user/:repo/git/trees/:sha`
|
||||
=======================================
|
||||
* GET: `Repository.get_git_tree`
|
||||
|
||||
API `/repos/:user/:repo/hooks`
|
||||
==============================
|
||||
* GET: `Repository.get_hooks`
|
||||
* POST: `Repository.create_hook`
|
||||
|
||||
API `/repos/:user/:repo/hooks/:id`
|
||||
==================================
|
||||
* GET: `Repository.get_hook`
|
||||
* PATCH: `Hook.edit`
|
||||
* DELETE: `Hook.delete`
|
||||
|
||||
API `/repos/:user/:repo/hooks/:id/test`
|
||||
=======================================
|
||||
* POST: `Hook.test`
|
||||
|
||||
API `/repos/:user/:repo/issues`
|
||||
===============================
|
||||
* GET: `Repository.get_issues`
|
||||
* POST: `Repository.create_issue`
|
||||
|
||||
API `/repos/:user/:repo/issues/:number`
|
||||
=======================================
|
||||
* GET: `Repository.get_issue`
|
||||
* PATCH: `Issue.edit`
|
||||
|
||||
API `/repos/:user/:repo/issues/:number/comments`
|
||||
================================================
|
||||
* GET: `Issue.get_comments` or `PullRequest.get_issue_comments`
|
||||
* POST: `Issue.create_comment` or `PullRequest.create_issue_comment`
|
||||
|
||||
API `/repos/:user/:repo/issues/:number/events`
|
||||
==============================================
|
||||
* GET: `Issue.get_events`
|
||||
|
||||
API `/repos/:user/:repo/issues/:number/labels`
|
||||
==============================================
|
||||
* GET: `Issue.get_labels`
|
||||
* POST: `Issue.add_to_labels`
|
||||
* PUT: `Issue.set_labels`
|
||||
* DELETE: `Issue.delete_labels`
|
||||
|
||||
API `/repos/:user/:repo/issues/:number/labels/:name`
|
||||
====================================================
|
||||
* DELETE: `Issue.remove_from_labels`
|
||||
|
||||
API `/repos/:user/:repo/issues/comments`
|
||||
============================================
|
||||
* GET: `Repository.get_issues_comments`
|
||||
|
||||
API `/repos/:user/:repo/issues/comments/:id`
|
||||
============================================
|
||||
* GET: `Issue.get_comment` or `PullRequest.get_issue_comment`
|
||||
* PATCH: `IssueComment.edit`
|
||||
* DELETE: `IssueComment.delete`
|
||||
|
||||
API `/repos/:user/:repo/issues/events`
|
||||
======================================
|
||||
* GET: `Repository.get_issues_events`
|
||||
|
||||
API `/repos/:user/:repo/issues/events/:id`
|
||||
==========================================
|
||||
* GET: `Repository.get_issues_event`
|
||||
|
||||
API `/repos/:user/:repo/keys`
|
||||
=============================
|
||||
* GET: `Repository.get_keys`
|
||||
* POST: `Repository.create_key`
|
||||
|
||||
API `/repos/:user/:repo/keys/:id`
|
||||
=================================
|
||||
* GET: `Repository.get_key`
|
||||
* PATCH: `RepositoryKey.edit`
|
||||
* DELETE: `RepositoryKey.delete`
|
||||
|
||||
API `/repos/:user/:repo/labels`
|
||||
===============================
|
||||
* GET: `Repository.get_labels`
|
||||
* POST: `Repository.create_label`
|
||||
|
||||
API `/repos/:user/:repo/labels/:name`
|
||||
=====================================
|
||||
* GET: `Repository.get_label`
|
||||
* PATCH: `Label.edit`
|
||||
* DELETE: `Label.delete`
|
||||
|
||||
API `/repos/:user/:repo/languages`
|
||||
==================================
|
||||
* GET: `Repository.get_languages`
|
||||
|
||||
API `/repos/:user/:repo/merges`
|
||||
===============================
|
||||
* POST: `Repository.merge`
|
||||
|
||||
API `/repos/:user/:repo/milestones`
|
||||
===================================
|
||||
* GET: `Repository.get_milestones`
|
||||
* POST: `Repository.create_milestone`
|
||||
|
||||
API `/repos/:user/:repo/milestones/:number`
|
||||
===========================================
|
||||
* GET: `Repository.get_milestone`
|
||||
* PATCH: `Milestone.edit`
|
||||
* DELETE: `Milestone.delete`
|
||||
|
||||
API `/repos/:user/:repo/milestones/:number/labels`
|
||||
==================================================
|
||||
* GET: `Milestone.get_labels`
|
||||
|
||||
API `/repos/:user/:repo/pulls`
|
||||
==============================
|
||||
* GET: `Repository.get_pulls`
|
||||
* POST: `Repository.create_pull`
|
||||
|
||||
API `/repos/:user/:repo/pulls/:number`
|
||||
======================================
|
||||
* GET: `Repository.get_pull`
|
||||
* PATCH: `PullRequest.edit`
|
||||
|
||||
API `/repos/:user/:repo/pulls/:number/comments`
|
||||
===============================================
|
||||
* GET: `PullRequest.get_comments` or `PullRequest.get_review_comments`
|
||||
* POST: `PullRequest.create_comment` or `PullRequest.create_review_comment`
|
||||
|
||||
API `/repos/:user/:repo/pulls/:number/commits`
|
||||
==============================================
|
||||
* GET: `PullRequest.get_commits`
|
||||
|
||||
API `/repos/:user/:repo/pulls/:number/files`
|
||||
============================================
|
||||
* GET: `PullRequest.get_files`
|
||||
|
||||
API `/repos/:user/:repo/pulls/:number/merge`
|
||||
============================================
|
||||
* GET: `PullRequest.is_merged`
|
||||
* PUT: `PullRequest.merge`
|
||||
|
||||
API `/repos/:user/:repo/pulls/comments`
|
||||
===============================================
|
||||
* GET: `Repository.get_pulls_comments` or `Repository.get_pulls_review_comments`
|
||||
|
||||
API `/repos/:user/:repo/pulls/comments/:number`
|
||||
===============================================
|
||||
* GET: `PullRequest.get_comment` or `PullRequest.get_review_comment`
|
||||
* PATCH: `PullRequestComment.edit`
|
||||
* DELETE: `PullRequestComment.delete`
|
||||
|
||||
API `/repos/:user/:repo/readme`
|
||||
===============================
|
||||
* GET: `Repository.get_readme`
|
||||
|
||||
API `/repos/:user/:repo/stargazers`
|
||||
===================================
|
||||
* GET: `Repository.get_stargazers`
|
||||
|
||||
API `/repos/:user/:repo/statuses/:sha`
|
||||
======================================
|
||||
* GET: `Commit.get_statuses`
|
||||
* POST: `Commit.create_status`
|
||||
|
||||
API `/repos/:user/:repo/subscribers`
|
||||
====================================
|
||||
* GET: `Repository.get_subscribers`
|
||||
|
||||
API `/repos/:user/:repo/tags`
|
||||
=============================
|
||||
* GET: `Repository.get_tags`
|
||||
|
||||
API `/repos/:user/:repo/teams`
|
||||
==============================
|
||||
* GET: `Repository.get_teams`
|
||||
|
||||
API `/repos/:user/:repo/watchers`
|
||||
=================================
|
||||
* GET: `Repository.get_watchers`
|
||||
|
||||
API `/teams/:id`
|
||||
================
|
||||
* GET: `Organization.get_team`
|
||||
* PATCH: `Team.edit`
|
||||
* DELETE: `Team.delete`
|
||||
|
||||
API `/teams/:id/members`
|
||||
========================
|
||||
* GET: `Team.get_members`
|
||||
|
||||
API `/teams/:id/members/:user`
|
||||
==============================
|
||||
* GET: `Team.has_in_members`
|
||||
* PUT: `Team.add_to_members`
|
||||
* DELETE: `Team.remove_from_members`
|
||||
|
||||
API `/teams/:id/repos`
|
||||
======================
|
||||
* GET: `Team.get_repos`
|
||||
|
||||
API `/teams/:id/repos/:user/:repo`
|
||||
==================================
|
||||
* GET: `Team.has_in_repos`
|
||||
* PUT: `Team.add_to_repos`
|
||||
* DELETE: `Team.remove_from_repos`
|
||||
|
||||
API `/user`
|
||||
===========
|
||||
* GET: `Github.get_user`
|
||||
* PATCH: `AuthenticatedUser.edit`
|
||||
|
||||
API `/user/emails`
|
||||
==================
|
||||
* GET: `AuthenticatedUser.get_emails`
|
||||
* POST: `AuthenticatedUser.add_to_emails`
|
||||
* DELETE: `AuthenticatedUser.remove_from_emails`
|
||||
|
||||
API `/user/followers`
|
||||
=====================
|
||||
* GET: `AuthenticatedUser.get_followers`
|
||||
|
||||
API `/user/following`
|
||||
=====================
|
||||
* GET: `AuthenticatedUser.get_following`
|
||||
|
||||
API `/user/following/:user`
|
||||
===========================
|
||||
* GET: `AuthenticatedUser.has_in_following`
|
||||
* PUT: `AuthenticatedUser.add_to_following`
|
||||
* DELETE: `AuthenticatedUser.remove_from_following`
|
||||
|
||||
API `/user/keys`
|
||||
================
|
||||
* GET: `AuthenticatedUser.get_keys`
|
||||
* POST: `AuthenticatedUser.create_key`
|
||||
|
||||
API `/user/keys/:id`
|
||||
====================
|
||||
* GET: `AuthenticatedUser.get_key`
|
||||
* PATCH: `UserKey.edit`
|
||||
* DELETE: `UserKey.delete`
|
||||
|
||||
API `/user/orgs`
|
||||
================
|
||||
* GET: `AuthenticatedUser.get_orgs`
|
||||
|
||||
API `/user/repos`
|
||||
=================
|
||||
* GET: `AuthenticatedUser.get_repos`
|
||||
* POST: `AuthenticatedUser.create_repo`
|
||||
|
||||
API `/user/starred`
|
||||
===================
|
||||
* GET: `AuthenticatedUser.get_starred`
|
||||
|
||||
API `/user/starred/:user/:repo`
|
||||
===============================
|
||||
* GET: `AuthenticatedUser.has_in_starred`
|
||||
* PUT: `AuthenticatedUser.add_to_starred`
|
||||
* DELETE: `AuthenticatedUser.remove_from_starred`
|
||||
|
||||
API `/user/subscriptions`
|
||||
=========================
|
||||
* GET: `AuthenticatedUser.get_subscriptions`
|
||||
|
||||
API `/user/subscriptions/:user/:repo`
|
||||
=====================================
|
||||
* GET: `AuthenticatedUser.has_in_subscriptions`
|
||||
* PUT: `AuthenticatedUser.add_to_subscriptions`
|
||||
* DELETE: `AuthenticatedUser.remove_from_subscriptions`
|
||||
|
||||
API `/user/watched`
|
||||
===================
|
||||
* GET: `AuthenticatedUser.get_watched`
|
||||
|
||||
API `/user/watched/:user/:repo`
|
||||
===============================
|
||||
* GET: `AuthenticatedUser.has_in_watched`
|
||||
* PUT: `AuthenticatedUser.add_to_watched`
|
||||
* DELETE: `AuthenticatedUser.remove_from_watched`
|
||||
|
||||
API `/users/:user`
|
||||
==================
|
||||
* GET: `Github.get_user`
|
||||
|
||||
API `/users/:user/events`
|
||||
=========================
|
||||
* GET: `NamedUser.get_events`
|
||||
|
||||
API `/users/:user/events/orgs/:org`
|
||||
===================================
|
||||
* GET: `AuthenticatedUser.get_organization_events`
|
||||
|
||||
API `/users/:user/events/public`
|
||||
================================
|
||||
* GET: `NamedUser.get_public_events`
|
||||
|
||||
API `/users/:user/followers`
|
||||
============================
|
||||
* GET: `NamedUser.get_followers`
|
||||
|
||||
API `/users/:user/following`
|
||||
============================
|
||||
* GET: `NamedUser.get_following`
|
||||
|
||||
API `/users/:user/gists`
|
||||
========================
|
||||
* GET: `NamedUser.get_gists`
|
||||
* POST: `NamedUser.create_gist`
|
||||
|
||||
API `/users/:user/orgs`
|
||||
=======================
|
||||
* GET: `NamedUser.get_orgs`
|
||||
|
||||
API `/users/:user/received_events`
|
||||
==================================
|
||||
* GET: `NamedUser.get_received_events`
|
||||
|
||||
API `/users/:user/received_events/public`
|
||||
=========================================
|
||||
* GET: `NamedUser.get_public_received_events`
|
||||
|
||||
API `/users/:user/repos`
|
||||
========================
|
||||
* GET: `NamedUser.get_repos`
|
||||
|
||||
API `/users/:user/starred`
|
||||
==========================
|
||||
* GET: `NamedUser.get_starred`
|
||||
|
||||
API `/users/:user/subscriptions`
|
||||
================================
|
||||
* GET: `NamedUser.get_subscriptions`
|
||||
|
||||
API `/users/:user/watched`
|
||||
==========================
|
||||
* GET: `NamedUser.get_watched`
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+14
@@ -245,3 +245,17 @@ texinfo_documents = [
|
||||
autodoc_default_flags = [ "members" ]
|
||||
autodoc_member_order = "bysource"
|
||||
autoclass_content = "both"
|
||||
|
||||
with open("github_objects.rst", "w") as github_objects:
|
||||
github_objects.write("Github objects\n")
|
||||
github_objects.write("==============\n")
|
||||
github_objects.write("\n")
|
||||
github_objects.write(".. toctree::\n")
|
||||
|
||||
for obj in ["AuthenticatedUser", "Authorization", "AuthorizationApplication", "Branch", "Commit", "CommitComment", "CommitStats", "CommitStatus", "Comparison", "ContentFile", "Download", "Event", "File", "Gist", "GistComment", "GistFile", "GistHistoryState", "GitAuthor", "GitBlob", "GitCommit", "GitObject", "GitignoreTemplate", "GitRef", "GitTag", "GitTree", "GitTreeElement", "Hook", "HookDescription", "HookResponse", "Issue", "IssueComment", "IssueEvent", "IssuePullRequest", "Label", "Milestone", "NamedUser", "Organization", "Permissions", "Plan", "PullRequest", "PullRequestComment", "PullRequestMergeStatus", "PullRequestPart", "Repository", "RepositoryKey", "Tag", "Team", "UserKey"]:
|
||||
github_objects.write(" github_objects/" + obj + "\n")
|
||||
with open("github_objects/" + obj + ".rst", "w") as github_object:
|
||||
github_object.write(obj + "\n")
|
||||
github_object.write("=" * len(obj) + "\n")
|
||||
github_object.write("\n")
|
||||
github_object.write(".. autoclass:: github." + obj + "." + obj + "()\n")
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
Github objects
|
||||
==============
|
||||
|
||||
.. toctree::
|
||||
github_objects/AuthenticatedUser
|
||||
github_objects/Authorization
|
||||
github_objects/AuthorizationApplication
|
||||
github_objects/Branch
|
||||
github_objects/Commit
|
||||
github_objects/CommitComment
|
||||
github_objects/CommitStats
|
||||
github_objects/CommitStatus
|
||||
github_objects/Comparison
|
||||
github_objects/ContentFile
|
||||
github_objects/Download
|
||||
github_objects/Event
|
||||
github_objects/File
|
||||
github_objects/Gist
|
||||
github_objects/GistComment
|
||||
github_objects/GistFile
|
||||
github_objects/GistHistoryState
|
||||
github_objects/GitAuthor
|
||||
github_objects/GitBlob
|
||||
github_objects/GitCommit
|
||||
github_objects/GitObject
|
||||
github_objects/GitignoreTemplate
|
||||
github_objects/GitRef
|
||||
github_objects/GitTag
|
||||
github_objects/GitTree
|
||||
github_objects/GitTreeElement
|
||||
github_objects/Hook
|
||||
github_objects/HookDescription
|
||||
github_objects/HookResponse
|
||||
github_objects/Issue
|
||||
github_objects/IssueComment
|
||||
github_objects/IssueEvent
|
||||
github_objects/IssuePullRequest
|
||||
github_objects/Label
|
||||
github_objects/Milestone
|
||||
github_objects/NamedUser
|
||||
github_objects/Organization
|
||||
github_objects/Permissions
|
||||
github_objects/Plan
|
||||
github_objects/PullRequest
|
||||
github_objects/PullRequestComment
|
||||
github_objects/PullRequestMergeStatus
|
||||
github_objects/PullRequestPart
|
||||
github_objects/Repository
|
||||
github_objects/RepositoryKey
|
||||
github_objects/Tag
|
||||
github_objects/Team
|
||||
github_objects/UserKey
|
||||
@@ -0,0 +1 @@
|
||||
*.rst
|
||||
@@ -1,4 +0,0 @@
|
||||
AuthenticatedUser
|
||||
=================
|
||||
|
||||
.. autoclass:: github.AuthenticatedUser.AuthenticatedUser()
|
||||
@@ -1,4 +0,0 @@
|
||||
Authorization
|
||||
=============
|
||||
|
||||
.. autoclass:: github.Authorization.Authorization()
|
||||
@@ -1,4 +0,0 @@
|
||||
AuthorizationApplication
|
||||
========================
|
||||
|
||||
.. autoclass:: github.AuthorizationApplication.AuthorizationApplication()
|
||||
@@ -1,4 +0,0 @@
|
||||
Branch
|
||||
======
|
||||
|
||||
.. autoclass:: github.Branch.Branch()
|
||||
@@ -1,4 +0,0 @@
|
||||
Commit
|
||||
======
|
||||
|
||||
.. autoclass:: github.Commit.Commit()
|
||||
@@ -1,4 +0,0 @@
|
||||
CommitComment
|
||||
=============
|
||||
|
||||
.. autoclass:: github.CommitComment.CommitComment()
|
||||
@@ -1,4 +0,0 @@
|
||||
CommitStats
|
||||
===========
|
||||
|
||||
.. autoclass:: github.CommitStats.CommitStats()
|
||||
@@ -1,4 +0,0 @@
|
||||
CommitStatus
|
||||
============
|
||||
|
||||
.. autoclass:: github.CommitStatus.CommitStatus()
|
||||
@@ -1,4 +0,0 @@
|
||||
Comparison
|
||||
==========
|
||||
|
||||
.. autoclass:: github.Comparison.Comparison()
|
||||
@@ -1,4 +0,0 @@
|
||||
ContentFile
|
||||
===========
|
||||
|
||||
.. autoclass:: github.ContentFile.ContentFile()
|
||||
@@ -1,4 +0,0 @@
|
||||
Download
|
||||
========
|
||||
|
||||
.. autoclass:: github.Download.Download()
|
||||
@@ -1,4 +0,0 @@
|
||||
Event
|
||||
=====
|
||||
|
||||
.. autoclass:: github.Event.Event()
|
||||
@@ -1,4 +0,0 @@
|
||||
File
|
||||
====
|
||||
|
||||
.. autoclass:: github.File.File()
|
||||
@@ -1,4 +0,0 @@
|
||||
Gist
|
||||
====
|
||||
|
||||
.. autoclass:: github.Gist.Gist()
|
||||
@@ -1,4 +0,0 @@
|
||||
GistComment
|
||||
===========
|
||||
|
||||
.. autoclass:: github.GistComment.GistComment()
|
||||
@@ -1,4 +0,0 @@
|
||||
GistFile
|
||||
========
|
||||
|
||||
.. autoclass:: github.GistFile.GistFile()
|
||||
@@ -1,4 +0,0 @@
|
||||
GistHistoryState
|
||||
================
|
||||
|
||||
.. autoclass:: github.GistHistoryState.GistHistoryState()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitAuthor
|
||||
=========
|
||||
|
||||
.. autoclass:: github.GitAuthor.GitAuthor()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitBlob
|
||||
=======
|
||||
|
||||
.. autoclass:: github.GitBlob.GitBlob()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitCommit
|
||||
=========
|
||||
|
||||
.. autoclass:: github.GitCommit.GitCommit()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitObject
|
||||
=========
|
||||
|
||||
.. autoclass:: github.GitObject.GitObject()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitRef
|
||||
======
|
||||
|
||||
.. autoclass:: github.GitRef.GitRef()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitTag
|
||||
======
|
||||
|
||||
.. autoclass:: github.GitTag.GitTag()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitTree
|
||||
=======
|
||||
|
||||
.. autoclass:: github.GitTree.GitTree()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitTreeElement
|
||||
==============
|
||||
|
||||
.. autoclass:: github.GitTreeElement.GitTreeElement()
|
||||
@@ -1,4 +0,0 @@
|
||||
GitignoreTemplate
|
||||
=================
|
||||
|
||||
.. autoclass:: github.GitignoreTemplate.GitignoreTemplate()
|
||||
@@ -1,4 +0,0 @@
|
||||
Hook
|
||||
====
|
||||
|
||||
.. autoclass:: github.Hook.Hook()
|
||||
@@ -1,4 +0,0 @@
|
||||
HookDescription
|
||||
===============
|
||||
|
||||
.. autoclass:: github.HookDescription.HookDescription()
|
||||
@@ -1,4 +0,0 @@
|
||||
HookResponse
|
||||
============
|
||||
|
||||
.. autoclass:: github.HookResponse.HookResponse()
|
||||
@@ -1,4 +0,0 @@
|
||||
Issue
|
||||
=====
|
||||
|
||||
.. autoclass:: github.Issue.Issue()
|
||||
@@ -1,4 +0,0 @@
|
||||
IssueComment
|
||||
============
|
||||
|
||||
.. autoclass:: github.IssueComment.IssueComment()
|
||||
@@ -1,4 +0,0 @@
|
||||
IssueEvent
|
||||
==========
|
||||
|
||||
.. autoclass:: github.IssueEvent.IssueEvent()
|
||||
@@ -1,4 +0,0 @@
|
||||
IssuePullRequest
|
||||
================
|
||||
|
||||
.. autoclass:: github.IssuePullRequest.IssuePullRequest()
|
||||
@@ -1,4 +0,0 @@
|
||||
Label
|
||||
=====
|
||||
|
||||
.. autoclass:: github.Label.Label()
|
||||
@@ -1,4 +0,0 @@
|
||||
Milestone
|
||||
=========
|
||||
|
||||
.. autoclass:: github.Milestone.Milestone()
|
||||
@@ -1,4 +0,0 @@
|
||||
NamedUser
|
||||
=========
|
||||
|
||||
.. autoclass:: github.NamedUser.NamedUser()
|
||||
@@ -1,4 +0,0 @@
|
||||
Organization
|
||||
============
|
||||
|
||||
.. autoclass:: github.Organization.Organization()
|
||||
@@ -1,4 +0,0 @@
|
||||
Permissions
|
||||
===========
|
||||
|
||||
.. autoclass:: github.Permissions.Permissions()
|
||||
@@ -1,4 +0,0 @@
|
||||
Plan
|
||||
====
|
||||
|
||||
.. autoclass:: github.Plan.Plan()
|
||||
@@ -1,4 +0,0 @@
|
||||
PullRequest
|
||||
===========
|
||||
|
||||
.. autoclass:: github.PullRequest.PullRequest()
|
||||
@@ -1,4 +0,0 @@
|
||||
PullRequestComment
|
||||
==================
|
||||
|
||||
.. autoclass:: github.PullRequestComment.PullRequestComment()
|
||||
@@ -1,4 +0,0 @@
|
||||
PullRequestMergeStatus
|
||||
======================
|
||||
|
||||
.. autoclass:: github.PullRequestMergeStatus.PullRequestMergeStatus()
|
||||
@@ -1,4 +0,0 @@
|
||||
PullRequestPart
|
||||
===============
|
||||
|
||||
.. autoclass:: github.PullRequestPart.PullRequestPart()
|
||||
@@ -1,4 +0,0 @@
|
||||
Repository
|
||||
==========
|
||||
|
||||
.. autoclass:: github.Repository.Repository()
|
||||
@@ -1,4 +0,0 @@
|
||||
RepositoryKey
|
||||
=============
|
||||
|
||||
.. autoclass:: github.RepositoryKey.RepositoryKey()
|
||||
@@ -1,4 +0,0 @@
|
||||
Tag
|
||||
===
|
||||
|
||||
.. autoclass:: github.Tag.Tag()
|
||||
@@ -1,4 +0,0 @@
|
||||
Team
|
||||
====
|
||||
|
||||
.. autoclass:: github.Team.Team()
|
||||
@@ -1,4 +0,0 @@
|
||||
UserKey
|
||||
=======
|
||||
|
||||
.. autoclass:: github.UserKey.UserKey()
|
||||
@@ -1,190 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import subprocess
|
||||
import glob
|
||||
import re
|
||||
import collections
|
||||
|
||||
|
||||
class ClassDescription:
|
||||
def __init__(self):
|
||||
self.properties = dict()
|
||||
self.methods = collections.OrderedDict()
|
||||
|
||||
|
||||
class MethodDescription:
|
||||
def __init__(self, returnType):
|
||||
self.verb = None
|
||||
self.url = None
|
||||
self.returnType = returnType
|
||||
self.parameters = collections.OrderedDict()
|
||||
|
||||
|
||||
class Generator():
|
||||
privateClasses = [
|
||||
"PaginatedList",
|
||||
"PaginatedListBase",
|
||||
"GithubObject",
|
||||
"BasicGithubObject",
|
||||
"_NotSetType",
|
||||
"Requester",
|
||||
]
|
||||
|
||||
def getClassDocstring(self, className):
|
||||
if className in self.privateClasses:
|
||||
return None
|
||||
else:
|
||||
return [
|
||||
"This class represents " + className + "s as returned for example by http://developer.github.com/v3/todo"
|
||||
]
|
||||
|
||||
def getMemberDocstring(self, className, memberName):
|
||||
if className in self.privateClasses:
|
||||
return None
|
||||
elif className in self.classDescriptions:
|
||||
classDescription = self.classDescriptions[className]
|
||||
if memberName in classDescription.properties:
|
||||
return [
|
||||
":type: " + self.__formatType(classDescription.properties[memberName])
|
||||
]
|
||||
elif memberName in classDescription.methods:
|
||||
return [
|
||||
":calls: `" + classDescription.methods[memberName].verb + " " + classDescription.methods[memberName].url + " <http://developer.github.com/v3/todo>`_",
|
||||
# ":auth. level: ?",
|
||||
] + [
|
||||
":param " + parameterName + ": " + self.__formatType(parameterType) for parameterName, parameterType in classDescription.methods[memberName].parameters.items()
|
||||
] + [
|
||||
":rtype: " + self.__formatType(str(classDescription.methods[memberName].returnType))
|
||||
]
|
||||
elif memberName.startswith("_"): # private member
|
||||
return None
|
||||
else:
|
||||
print "Unknown member", className, memberName
|
||||
return None
|
||||
else:
|
||||
print "Unknown class", className
|
||||
return None
|
||||
|
||||
def __formatType(self, type):
|
||||
if type.startswith("`PaginatedList` of "):
|
||||
return ":class:`github.PaginatedList.PaginatedList` of " + self.__formatType(type[19:])
|
||||
elif type.startswith("list of "):
|
||||
return "list of " + self.__formatType(type[8:])
|
||||
elif type.startswith("dict of string to "):
|
||||
return "dict of string to " + self.__formatType(type[18:])
|
||||
elif type.startswith("`") and type.endswith("`"):
|
||||
type = type[1:-1]
|
||||
return ":class:`github." + type + "." + type + "`"
|
||||
elif type == "`Milestone` or \"none\" or \"*\"":
|
||||
return ":class:`github.Milestone.Milestone` or \"none\" or \"*\""
|
||||
elif type == "`NamedUser` or \"none\" or \"*\"":
|
||||
return ":class:`github.NamedUser.NamedUser` or \"none\" or \"*\""
|
||||
elif type == "`Milestone` or None":
|
||||
return ":class:`github.Milestone.Milestone` or None"
|
||||
elif type == "`NamedUser` or None":
|
||||
return ":class:`github.NamedUser.NamedUser` or None"
|
||||
elif type in [
|
||||
"bool", "string", "None", "integer",
|
||||
"datetime.datetime", "date",
|
||||
"\"open\" or \"closed\"",
|
||||
"dict", "(int, int)"
|
||||
]:
|
||||
return type
|
||||
else:
|
||||
raise Exception("Unknown type " + type)
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
self.restoreSources()
|
||||
self.readReferenceOfClasses()
|
||||
self.readReferenceOfApis()
|
||||
self.generate()
|
||||
|
||||
def restoreSources(self):
|
||||
subprocess.check_call(["git", "checkout", "--", "github"])
|
||||
|
||||
def readReferenceOfClasses(self):
|
||||
self.classDescriptions = dict()
|
||||
with open("doc/ReferenceOfClasses.md") as f:
|
||||
for line in f:
|
||||
line = line.rstrip()
|
||||
if line.startswith("Class `"):
|
||||
className = line[7:-1]
|
||||
self.classDescriptions[className] = ClassDescription()
|
||||
if line.startswith("*"):
|
||||
if "rate_limiting" in line:
|
||||
self.classDescriptions[className].properties["rate_limiting"] = "(int, int)"
|
||||
elif "(" in line:
|
||||
methodName, returnType = re.match("^\* `(.*)\(.*\)`(?:: (.*))?$", line).groups()
|
||||
self.classDescriptions[className].methods[methodName] = MethodDescription(returnType)
|
||||
else:
|
||||
attributeName, attributeType = re.match("^\* `(.*)`: (.*)$", line).groups()
|
||||
self.classDescriptions[className].properties[attributeName] = attributeType
|
||||
if line.startswith(" *"):
|
||||
parameterName, parameterType = re.match("^ \* `(.*)`: (.*)$", line).groups()
|
||||
self.classDescriptions[className].methods[methodName].parameters[parameterName] = parameterType
|
||||
|
||||
def readReferenceOfApis(self):
|
||||
with open("doc/ReferenceOfApis.md") as f:
|
||||
for line in f:
|
||||
line = line.rstrip()
|
||||
if line.startswith("API"):
|
||||
url = line[5:-1]
|
||||
if line.startswith("*") and line not in ["* POST: see API `/markdown`", "* GET: Not implemented, see `Github.rate_limiting`"]:
|
||||
verb, methods = re.match("^\* (.*): (.*)$", line).groups()
|
||||
for method in methods.split(" or "):
|
||||
className, methodName = re.match("^`(.*)\.(.*)`", method).groups()
|
||||
self.classDescriptions[className].methods[methodName].verb = verb
|
||||
self.classDescriptions[className].methods[methodName].url = url
|
||||
|
||||
def generate(self):
|
||||
for f in glob.glob("github/*.py"):
|
||||
self.generateForFile(f)
|
||||
|
||||
def generateForFile(self, fileName):
|
||||
self.writeLines(fileName, self.processLines(self.readLines(fileName)))
|
||||
|
||||
def processLines(self, lines):
|
||||
nextDefIsStaticMethod = False
|
||||
nextDefIsClassMethod = False
|
||||
|
||||
for line in lines:
|
||||
yield line
|
||||
if line.startswith("class"):
|
||||
className = re.match("^class (.*?)(?:\(.*\))?:$", line).group(1)
|
||||
for docStringLine in self.formatDocstring(" ", self.getClassDocstring(className), True):
|
||||
yield docStringLine
|
||||
if line.startswith(" def"):
|
||||
if nextDefIsStaticMethod or nextDefIsClassMethod:
|
||||
pass
|
||||
else:
|
||||
assert re.match("^ def (.*?)\(self.*\):$", line), line
|
||||
memberName = re.match("^ def (.*?)\(self.*\):$", line).group(1)
|
||||
for docStringLine in self.formatDocstring(" ", self.getMemberDocstring(className, memberName)):
|
||||
yield docStringLine
|
||||
|
||||
nextDefIsStaticMethod = line == " @staticmethod"
|
||||
nextDefIsClassMethod = line == " @classmethod"
|
||||
|
||||
def formatDocstring(self, indent, lines, addBlankLine=False):
|
||||
if lines is not None:
|
||||
yield indent + '"""'
|
||||
for docStringLine in lines:
|
||||
yield indent + docStringLine
|
||||
yield indent + '"""'
|
||||
if addBlankLine:
|
||||
yield ""
|
||||
|
||||
def readLines(self, fileName):
|
||||
with open(fileName) as f:
|
||||
return list(line.rstrip() for line in f)
|
||||
|
||||
def writeLines(self, fileName, lines):
|
||||
with open(fileName, "wb") as f:
|
||||
for line in lines:
|
||||
f.write(line + "\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
Generator().run()
|
||||
@@ -28,132 +28,216 @@ import github.Authorization
|
||||
|
||||
|
||||
class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents AuthenticatedUsers as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def avatar_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._avatar_url)
|
||||
return self._NoneIfNotSet(self._avatar_url)
|
||||
|
||||
@property
|
||||
def bio(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._bio)
|
||||
return self._NoneIfNotSet(self._bio)
|
||||
|
||||
@property
|
||||
def blog(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._blog)
|
||||
return self._NoneIfNotSet(self._blog)
|
||||
|
||||
@property
|
||||
def collaborators(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._collaborators)
|
||||
return self._NoneIfNotSet(self._collaborators)
|
||||
|
||||
@property
|
||||
def company(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._company)
|
||||
return self._NoneIfNotSet(self._company)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def disk_usage(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._disk_usage)
|
||||
return self._NoneIfNotSet(self._disk_usage)
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._email)
|
||||
return self._NoneIfNotSet(self._email)
|
||||
|
||||
@property
|
||||
def followers(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._followers)
|
||||
return self._NoneIfNotSet(self._followers)
|
||||
|
||||
@property
|
||||
def following(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._following)
|
||||
return self._NoneIfNotSet(self._following)
|
||||
|
||||
@property
|
||||
def gravatar_id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._gravatar_id)
|
||||
return self._NoneIfNotSet(self._gravatar_id)
|
||||
|
||||
@property
|
||||
def hireable(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
self._completeIfNotSet(self._hireable)
|
||||
return self._NoneIfNotSet(self._hireable)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def location(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._location)
|
||||
return self._NoneIfNotSet(self._location)
|
||||
|
||||
@property
|
||||
def login(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._login)
|
||||
return self._NoneIfNotSet(self._login)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._name)
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def owned_private_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._owned_private_repos)
|
||||
return self._NoneIfNotSet(self._owned_private_repos)
|
||||
|
||||
@property
|
||||
def plan(self):
|
||||
"""
|
||||
:type: :class:`github.Plan.Plan`
|
||||
"""
|
||||
self._completeIfNotSet(self._plan)
|
||||
return self._NoneIfNotSet(self._plan)
|
||||
|
||||
@property
|
||||
def private_gists(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._private_gists)
|
||||
return self._NoneIfNotSet(self._private_gists)
|
||||
|
||||
@property
|
||||
def public_gists(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._public_gists)
|
||||
return self._NoneIfNotSet(self._public_gists)
|
||||
|
||||
@property
|
||||
def public_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._public_repos)
|
||||
return self._NoneIfNotSet(self._public_repos)
|
||||
|
||||
@property
|
||||
def total_private_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._total_private_repos)
|
||||
return self._NoneIfNotSet(self._total_private_repos)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._type)
|
||||
return self._NoneIfNotSet(self._type)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def add_to_emails(self, *emails):
|
||||
"""
|
||||
:calls: `POST /user/emails <http://developer.github.com/v3/todo>`_
|
||||
:param email: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert all(isinstance(element, (str, unicode)) for element in emails), emails
|
||||
post_parameters = emails
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
@@ -164,6 +248,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def add_to_following(self, following):
|
||||
"""
|
||||
:calls: `PUT /user/following/:user <http://developer.github.com/v3/todo>`_
|
||||
:param following: :class:`github.NamedUser.NamedUser`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(following, github.NamedUser.NamedUser), following
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"PUT",
|
||||
@@ -173,6 +262,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def add_to_starred(self, starred):
|
||||
"""
|
||||
:calls: `PUT /user/starred/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param starred: :class:`github.Repository.Repository`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(starred, github.Repository.Repository), starred
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"PUT",
|
||||
@@ -182,6 +276,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def add_to_subscriptions(self, subscription):
|
||||
"""
|
||||
:calls: `PUT /user/subscriptions/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param subscription: :class:`github.Repository.Repository`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(subscription, github.Repository.Repository), subscription
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"PUT",
|
||||
@@ -191,6 +290,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def add_to_watched(self, watched):
|
||||
"""
|
||||
:calls: `PUT /user/watched/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param watched: :class:`github.Repository.Repository`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(watched, github.Repository.Repository), watched
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"PUT",
|
||||
@@ -200,6 +304,15 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def create_authorization(self, scopes=github.GithubObject.NotSet, note=github.GithubObject.NotSet, note_url=github.GithubObject.NotSet, client_id=github.GithubObject.NotSet, client_secret=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /authorizations <http://developer.github.com/v3/todo>`_
|
||||
:param scopes: list of string
|
||||
:param note: string
|
||||
:param note_url: string
|
||||
:param client_id: string
|
||||
:param client_secret: string
|
||||
:rtype: :class:`github.Authorization.Authorization`
|
||||
"""
|
||||
assert scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes
|
||||
assert note is github.GithubObject.NotSet or isinstance(note, (str, unicode)), note
|
||||
assert note_url is github.GithubObject.NotSet or isinstance(note_url, (str, unicode)), note_url
|
||||
@@ -225,6 +338,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return github.Authorization.Authorization(self._requester, data, completed=True)
|
||||
|
||||
def create_fork(self, repo):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/forks <http://developer.github.com/v3/todo>`_
|
||||
:param repo: :class:`github.Repository.Repository`
|
||||
:rtype: :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(repo, github.Repository.Repository), repo
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"POST",
|
||||
@@ -235,6 +353,13 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return github.Repository.Repository(self._requester, data, completed=True)
|
||||
|
||||
def create_gist(self, public, files, description=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /gists <http://developer.github.com/v3/todo>`_
|
||||
:param public: bool
|
||||
:param files: dict of string to :class:`github.InputFileContent.InputFileContent`
|
||||
:param description: string
|
||||
:rtype: :class:`github.Gist.Gist`
|
||||
"""
|
||||
assert isinstance(public, bool), public
|
||||
assert all(isinstance(element, github.InputFileContent) for element in files.itervalues()), files
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
@@ -253,6 +378,12 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return github.Gist.Gist(self._requester, data, completed=True)
|
||||
|
||||
def create_key(self, title, key):
|
||||
"""
|
||||
:calls: `POST /user/keys <http://developer.github.com/v3/todo>`_
|
||||
:param title: string
|
||||
:param key: string
|
||||
:rtype: :class:`github.UserKey.UserKey`
|
||||
"""
|
||||
assert isinstance(title, (str, unicode)), title
|
||||
assert isinstance(key, (str, unicode)), key
|
||||
post_parameters = {
|
||||
@@ -268,6 +399,19 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return github.UserKey.UserKey(self._requester, data, completed=True)
|
||||
|
||||
def create_repo(self, name, description=github.GithubObject.NotSet, homepage=github.GithubObject.NotSet, private=github.GithubObject.NotSet, has_issues=github.GithubObject.NotSet, has_wiki=github.GithubObject.NotSet, has_downloads=github.GithubObject.NotSet, auto_init=github.GithubObject.NotSet, gitignore_template=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /user/repos <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:param description: string
|
||||
:param homepage: string
|
||||
:param private: bool
|
||||
:param has_issues: bool
|
||||
:param has_wiki: bool
|
||||
:param has_downloads: bool
|
||||
:param auto_init: bool
|
||||
:param gitignore_template: string
|
||||
:rtype: :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
assert homepage is github.GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage
|
||||
@@ -305,6 +449,17 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return github.Repository.Repository(self._requester, data, completed=True)
|
||||
|
||||
def edit(self, name=github.GithubObject.NotSet, email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, location=github.GithubObject.NotSet, hireable=github.GithubObject.NotSet, bio=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /user <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:param email: string
|
||||
:param blog: string
|
||||
:param company: string
|
||||
:param location: string
|
||||
:param hireable: bool
|
||||
:param bio: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert name is github.GithubObject.NotSet or isinstance(name, (str, unicode)), name
|
||||
assert email is github.GithubObject.NotSet or isinstance(email, (str, unicode)), email
|
||||
assert blog is github.GithubObject.NotSet or isinstance(blog, (str, unicode)), blog
|
||||
@@ -336,6 +491,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
self._useAttributes(data)
|
||||
|
||||
def get_authorization(self, id):
|
||||
"""
|
||||
:calls: `GET /authorizations/:id <http://developer.github.com/v3/todo>`_
|
||||
:param id: integer
|
||||
:rtype: :class:`github.Authorization.Authorization`
|
||||
"""
|
||||
assert isinstance(id, (int, long)), id
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -346,6 +506,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return github.Authorization.Authorization(self._requester, data, completed=True)
|
||||
|
||||
def get_authorizations(self):
|
||||
"""
|
||||
:calls: `GET /authorizations <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Authorization.Authorization`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Authorization.Authorization,
|
||||
self._requester,
|
||||
@@ -354,6 +518,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_emails(self):
|
||||
"""
|
||||
:calls: `GET /user/emails <http://developer.github.com/v3/todo>`_
|
||||
:rtype: list of string
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
"/user/emails",
|
||||
@@ -363,6 +531,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return data
|
||||
|
||||
def get_events(self):
|
||||
"""
|
||||
:calls: `GET /events <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Event.Event,
|
||||
self._requester,
|
||||
@@ -371,6 +543,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_followers(self):
|
||||
"""
|
||||
:calls: `GET /user/followers <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.NamedUser.NamedUser,
|
||||
self._requester,
|
||||
@@ -379,6 +555,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_following(self):
|
||||
"""
|
||||
:calls: `GET /user/following <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.NamedUser.NamedUser,
|
||||
self._requester,
|
||||
@@ -387,6 +567,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_gists(self):
|
||||
"""
|
||||
:calls: `GET /gists <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Gist.Gist`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Gist.Gist,
|
||||
self._requester,
|
||||
@@ -395,6 +579,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_issues(self):
|
||||
"""
|
||||
:calls: `GET /issues <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Issue.Issue,
|
||||
self._requester,
|
||||
@@ -403,6 +591,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_key(self, id):
|
||||
"""
|
||||
:calls: `GET /user/keys/:id <http://developer.github.com/v3/todo>`_
|
||||
:param id: integer
|
||||
:rtype: :class:`github.UserKey.UserKey`
|
||||
"""
|
||||
assert isinstance(id, (int, long)), id
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -413,6 +606,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return github.UserKey.UserKey(self._requester, data, completed=True)
|
||||
|
||||
def get_keys(self):
|
||||
"""
|
||||
:calls: `GET /user/keys <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.UserKey.UserKey`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.UserKey.UserKey,
|
||||
self._requester,
|
||||
@@ -421,6 +618,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_organization_events(self, org):
|
||||
"""
|
||||
:calls: `GET /users/:user/events/orgs/:org <http://developer.github.com/v3/todo>`_
|
||||
:param org: :class:`github.Organization.Organization`
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
|
||||
"""
|
||||
assert isinstance(org, github.Organization.Organization), org
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Event.Event,
|
||||
@@ -430,6 +632,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_orgs(self):
|
||||
"""
|
||||
:calls: `GET /user/orgs <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Organization.Organization,
|
||||
self._requester,
|
||||
@@ -438,6 +644,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_repo(self, name):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:rtype: :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -448,6 +659,13 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return github.Repository.Repository(self._requester, data, completed=True)
|
||||
|
||||
def get_repos(self, type=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /user/repos <http://developer.github.com/v3/todo>`_
|
||||
:param type: string
|
||||
:param sort: string
|
||||
:param direction: string
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert type is github.GithubObject.NotSet or isinstance(type, (str, unicode)), type
|
||||
assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort
|
||||
assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction
|
||||
@@ -466,6 +684,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_starred(self):
|
||||
"""
|
||||
:calls: `GET /user/starred <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Repository.Repository,
|
||||
self._requester,
|
||||
@@ -474,6 +696,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_starred_gists(self):
|
||||
"""
|
||||
:calls: `GET /gists/starred <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Gist.Gist`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Gist.Gist,
|
||||
self._requester,
|
||||
@@ -482,6 +708,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_subscriptions(self):
|
||||
"""
|
||||
:calls: `GET /user/subscriptions <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Repository.Repository,
|
||||
self._requester,
|
||||
@@ -490,6 +720,10 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_watched(self):
|
||||
"""
|
||||
:calls: `GET /user/watched <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Repository.Repository,
|
||||
self._requester,
|
||||
@@ -498,6 +732,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def has_in_following(self, following):
|
||||
"""
|
||||
:calls: `GET /user/following/:user <http://developer.github.com/v3/todo>`_
|
||||
:param following: :class:`github.NamedUser.NamedUser`
|
||||
:rtype: bool
|
||||
"""
|
||||
assert isinstance(following, github.NamedUser.NamedUser), following
|
||||
status, headers, data = self._requester.requestRaw(
|
||||
"GET",
|
||||
@@ -508,6 +747,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return status == 204
|
||||
|
||||
def has_in_starred(self, starred):
|
||||
"""
|
||||
:calls: `GET /user/starred/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param starred: :class:`github.Repository.Repository`
|
||||
:rtype: bool
|
||||
"""
|
||||
assert isinstance(starred, github.Repository.Repository), starred
|
||||
status, headers, data = self._requester.requestRaw(
|
||||
"GET",
|
||||
@@ -518,6 +762,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return status == 204
|
||||
|
||||
def has_in_subscriptions(self, subscription):
|
||||
"""
|
||||
:calls: `GET /user/subscriptions/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param subscription: :class:`github.Repository.Repository`
|
||||
:rtype: bool
|
||||
"""
|
||||
assert isinstance(subscription, github.Repository.Repository), subscription
|
||||
status, headers, data = self._requester.requestRaw(
|
||||
"GET",
|
||||
@@ -528,6 +777,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return status == 204
|
||||
|
||||
def has_in_watched(self, watched):
|
||||
"""
|
||||
:calls: `GET /user/watched/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param watched: :class:`github.Repository.Repository`
|
||||
:rtype: bool
|
||||
"""
|
||||
assert isinstance(watched, github.Repository.Repository), watched
|
||||
status, headers, data = self._requester.requestRaw(
|
||||
"GET",
|
||||
@@ -538,6 +792,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
return status == 204
|
||||
|
||||
def remove_from_emails(self, *emails):
|
||||
"""
|
||||
:calls: `DELETE /user/emails <http://developer.github.com/v3/todo>`_
|
||||
:param email: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert all(isinstance(element, (str, unicode)) for element in emails), emails
|
||||
post_parameters = emails
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
@@ -548,6 +807,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def remove_from_following(self, following):
|
||||
"""
|
||||
:calls: `DELETE /user/following/:user <http://developer.github.com/v3/todo>`_
|
||||
:param following: :class:`github.NamedUser.NamedUser`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(following, github.NamedUser.NamedUser), following
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
@@ -557,6 +821,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def remove_from_starred(self, starred):
|
||||
"""
|
||||
:calls: `DELETE /user/starred/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param starred: :class:`github.Repository.Repository`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(starred, github.Repository.Repository), starred
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
@@ -566,6 +835,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def remove_from_subscriptions(self, subscription):
|
||||
"""
|
||||
:calls: `DELETE /user/subscriptions/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param subscription: :class:`github.Repository.Repository`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(subscription, github.Repository.Repository), subscription
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
@@ -575,6 +849,11 @@ class AuthenticatedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def remove_from_watched(self, watched):
|
||||
"""
|
||||
:calls: `DELETE /user/watched/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param watched: :class:`github.Repository.Repository`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(watched, github.Repository.Repository), watched
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
|
||||
@@ -19,52 +19,87 @@ import github.AuthorizationApplication
|
||||
|
||||
|
||||
class Authorization(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Authorizations as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def app(self):
|
||||
"""
|
||||
:type: :class:`github.AuthorizationApplication.AuthorizationApplication`
|
||||
"""
|
||||
self._completeIfNotSet(self._app)
|
||||
return self._NoneIfNotSet(self._app)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def note(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._note)
|
||||
return self._NoneIfNotSet(self._note)
|
||||
|
||||
@property
|
||||
def note_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._note_url)
|
||||
return self._NoneIfNotSet(self._note_url)
|
||||
|
||||
@property
|
||||
def scopes(self):
|
||||
"""
|
||||
:type: list of string
|
||||
"""
|
||||
self._completeIfNotSet(self._scopes)
|
||||
return self._NoneIfNotSet(self._scopes)
|
||||
|
||||
@property
|
||||
def token(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._token)
|
||||
return self._NoneIfNotSet(self._token)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /authorizations/:id <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -73,6 +108,15 @@ class Authorization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, scopes=github.GithubObject.NotSet, add_scopes=github.GithubObject.NotSet, remove_scopes=github.GithubObject.NotSet, note=github.GithubObject.NotSet, note_url=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /authorizations/:id <http://developer.github.com/v3/todo>`_
|
||||
:param scopes: list of string
|
||||
:param add_scopes: list of string
|
||||
:param remove_scopes: list of string
|
||||
:param note: string
|
||||
:param note_url: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes
|
||||
assert add_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_scopes), add_scopes
|
||||
assert remove_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_scopes), remove_scopes
|
||||
|
||||
@@ -17,13 +17,23 @@ import github.GithubObject
|
||||
|
||||
|
||||
class AuthorizationApplication(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents AuthorizationApplications as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._name)
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
|
||||
@@ -19,12 +19,22 @@ import github.Commit
|
||||
|
||||
|
||||
class Branch(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents Branchs as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def commit(self):
|
||||
"""
|
||||
:type: :class:`github.Commit.Commit`
|
||||
"""
|
||||
return self._NoneIfNotSet(self._commit)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -25,47 +25,83 @@ import github.CommitComment
|
||||
|
||||
|
||||
class Commit(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Commits as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def author(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._author)
|
||||
return self._NoneIfNotSet(self._author)
|
||||
|
||||
@property
|
||||
def commit(self):
|
||||
"""
|
||||
:type: :class:`github.GitCommit.GitCommit`
|
||||
"""
|
||||
self._completeIfNotSet(self._commit)
|
||||
return self._NoneIfNotSet(self._commit)
|
||||
|
||||
@property
|
||||
def committer(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._committer)
|
||||
return self._NoneIfNotSet(self._committer)
|
||||
|
||||
@property
|
||||
def files(self):
|
||||
"""
|
||||
:type: list of :class:`github.File.File`
|
||||
"""
|
||||
self._completeIfNotSet(self._files)
|
||||
return self._NoneIfNotSet(self._files)
|
||||
|
||||
@property
|
||||
def parents(self):
|
||||
"""
|
||||
:type: list of :class:`github.Commit.Commit`
|
||||
"""
|
||||
self._completeIfNotSet(self._parents)
|
||||
return self._NoneIfNotSet(self._parents)
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._sha)
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def stats(self):
|
||||
"""
|
||||
:type: :class:`github.CommitStats.CommitStats`
|
||||
"""
|
||||
self._completeIfNotSet(self._stats)
|
||||
return self._NoneIfNotSet(self._stats)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def create_comment(self, body, line=github.GithubObject.NotSet, path=github.GithubObject.NotSet, position=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/commits/:sha/comments <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:param line: integer
|
||||
:param path: string
|
||||
:param position: integer
|
||||
:rtype: :class:`github.CommitComment.CommitComment`
|
||||
"""
|
||||
assert isinstance(body, (str, unicode)), body
|
||||
assert line is github.GithubObject.NotSet or isinstance(line, (int, long)), line
|
||||
assert path is github.GithubObject.NotSet or isinstance(path, (str, unicode)), path
|
||||
@@ -88,6 +124,13 @@ class Commit(github.GithubObject.GithubObject):
|
||||
return github.CommitComment.CommitComment(self._requester, data, completed=True)
|
||||
|
||||
def create_status(self, state, target_url=github.GithubObject.NotSet, description=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/statuses/:sha <http://developer.github.com/v3/todo>`_
|
||||
:param state: string
|
||||
:param target_url: string
|
||||
:param description: string
|
||||
:rtype: :class:`github.CommitStatus.CommitStatus`
|
||||
"""
|
||||
assert isinstance(state, (str, unicode)), state
|
||||
assert target_url is github.GithubObject.NotSet or isinstance(target_url, (str, unicode)), target_url
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
@@ -107,6 +150,10 @@ class Commit(github.GithubObject.GithubObject):
|
||||
return github.CommitStatus.CommitStatus(self._requester, data, completed=True)
|
||||
|
||||
def get_comments(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/commits/:sha/comments <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitComment.CommitComment`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.CommitComment.CommitComment,
|
||||
self._requester,
|
||||
@@ -115,6 +162,10 @@ class Commit(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_statuses(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/statuses/:sha <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitStatus.CommitStatus`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.CommitStatus.CommitStatus,
|
||||
self._requester,
|
||||
|
||||
@@ -19,62 +19,103 @@ import github.NamedUser
|
||||
|
||||
|
||||
class CommitComment(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents CommitComments as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def body(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._body)
|
||||
return self._NoneIfNotSet(self._body)
|
||||
|
||||
@property
|
||||
def commit_id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._commit_id)
|
||||
return self._NoneIfNotSet(self._commit_id)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def line(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._line)
|
||||
return self._NoneIfNotSet(self._line)
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._path)
|
||||
return self._NoneIfNotSet(self._path)
|
||||
|
||||
@property
|
||||
def position(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._position)
|
||||
return self._NoneIfNotSet(self._position)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._user)
|
||||
return self._NoneIfNotSet(self._user)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -83,6 +124,11 @@ class CommitComment(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, body):
|
||||
"""
|
||||
:calls: `PATCH /repos/:user/:repo/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(body, (str, unicode)), body
|
||||
post_parameters = {
|
||||
"body": body,
|
||||
|
||||
@@ -17,16 +17,29 @@ import github.GithubObject
|
||||
|
||||
|
||||
class CommitStats(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents CommitStatss as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def additions(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._additions)
|
||||
|
||||
@property
|
||||
def deletions(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._deletions)
|
||||
|
||||
@property
|
||||
def total(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._total)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -19,32 +19,57 @@ import github.NamedUser
|
||||
|
||||
|
||||
class CommitStatus(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents CommitStatuss as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def creator(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
return self._NoneIfNotSet(self._creator)
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._description)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._state)
|
||||
|
||||
@property
|
||||
def target_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._target_url)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -20,63 +20,103 @@ import github.File
|
||||
|
||||
|
||||
class Comparison(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Comparisons as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def ahead_by(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._ahead_by)
|
||||
return self._NoneIfNotSet(self._ahead_by)
|
||||
|
||||
@property
|
||||
def base_commit(self):
|
||||
"""
|
||||
:type: :class:`github.Commit.Commit`
|
||||
"""
|
||||
self._completeIfNotSet(self._base_commit)
|
||||
return self._NoneIfNotSet(self._base_commit)
|
||||
|
||||
@property
|
||||
def behind_by(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._behind_by)
|
||||
return self._NoneIfNotSet(self._behind_by)
|
||||
|
||||
@property
|
||||
def commits(self):
|
||||
"""
|
||||
:type: list of :class:`github.Commit.Commit`
|
||||
"""
|
||||
self._completeIfNotSet(self._commits)
|
||||
return self._NoneIfNotSet(self._commits)
|
||||
|
||||
@property
|
||||
def diff_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._diff_url)
|
||||
return self._NoneIfNotSet(self._diff_url)
|
||||
|
||||
@property
|
||||
def files(self):
|
||||
"""
|
||||
:type: list of :class:`github.File.File`
|
||||
"""
|
||||
self._completeIfNotSet(self._files)
|
||||
return self._NoneIfNotSet(self._files)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def patch_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._patch_url)
|
||||
return self._NoneIfNotSet(self._patch_url)
|
||||
|
||||
@property
|
||||
def permalink_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._permalink_url)
|
||||
return self._NoneIfNotSet(self._permalink_url)
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._status)
|
||||
return self._NoneIfNotSet(self._status)
|
||||
|
||||
@property
|
||||
def total_commits(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._total_commits)
|
||||
return self._NoneIfNotSet(self._total_commits)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
|
||||
@@ -17,32 +17,57 @@ import github.GithubObject
|
||||
|
||||
|
||||
class ContentFile(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents ContentFiles as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def content(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._content)
|
||||
|
||||
@property
|
||||
def encoding(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._encoding)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._path)
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._size)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._type)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -17,107 +17,175 @@ import github.GithubObject
|
||||
|
||||
|
||||
class Download(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Downloads as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def accesskeyid(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._accesskeyid)
|
||||
return self._NoneIfNotSet(self._accesskeyid)
|
||||
|
||||
@property
|
||||
def acl(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._acl)
|
||||
return self._NoneIfNotSet(self._acl)
|
||||
|
||||
@property
|
||||
def bucket(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._bucket)
|
||||
return self._NoneIfNotSet(self._bucket)
|
||||
|
||||
@property
|
||||
def content_type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._content_type)
|
||||
return self._NoneIfNotSet(self._content_type)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._description)
|
||||
return self._NoneIfNotSet(self._description)
|
||||
|
||||
@property
|
||||
def download_count(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._download_count)
|
||||
return self._NoneIfNotSet(self._download_count)
|
||||
|
||||
@property
|
||||
def expirationdate(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._expirationdate)
|
||||
return self._NoneIfNotSet(self._expirationdate)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def mime_type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._mime_type)
|
||||
return self._NoneIfNotSet(self._mime_type)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._name)
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._path)
|
||||
return self._NoneIfNotSet(self._path)
|
||||
|
||||
@property
|
||||
def policy(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._policy)
|
||||
return self._NoneIfNotSet(self._policy)
|
||||
|
||||
@property
|
||||
def prefix(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._prefix)
|
||||
return self._NoneIfNotSet(self._prefix)
|
||||
|
||||
@property
|
||||
def redirect(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
self._completeIfNotSet(self._redirect)
|
||||
return self._NoneIfNotSet(self._redirect)
|
||||
|
||||
@property
|
||||
def s3_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._s3_url)
|
||||
return self._NoneIfNotSet(self._s3_url)
|
||||
|
||||
@property
|
||||
def signature(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._signature)
|
||||
return self._NoneIfNotSet(self._signature)
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._size)
|
||||
return self._NoneIfNotSet(self._size)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/downloads/:id <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
|
||||
@@ -21,36 +21,64 @@ import github.NamedUser
|
||||
|
||||
|
||||
class Event(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents Events as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def actor(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
return self._NoneIfNotSet(self._actor)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def org(self):
|
||||
"""
|
||||
:type: :class:`github.Organization.Organization`
|
||||
"""
|
||||
return self._NoneIfNotSet(self._org)
|
||||
|
||||
@property
|
||||
def payload(self):
|
||||
"""
|
||||
:type: dict
|
||||
"""
|
||||
return self._NoneIfNotSet(self._payload)
|
||||
|
||||
@property
|
||||
def public(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
return self._NoneIfNotSet(self._public)
|
||||
|
||||
@property
|
||||
def repo(self):
|
||||
"""
|
||||
:type: :class:`github.Repository.Repository`
|
||||
"""
|
||||
return self._NoneIfNotSet(self._repo)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._type)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -17,40 +17,71 @@ import github.GithubObject
|
||||
|
||||
|
||||
class File(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents Files as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def additions(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._additions)
|
||||
|
||||
@property
|
||||
def blob_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._blob_url)
|
||||
|
||||
@property
|
||||
def changes(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._changes)
|
||||
|
||||
@property
|
||||
def deletions(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._deletions)
|
||||
|
||||
@property
|
||||
def filename(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._filename)
|
||||
|
||||
@property
|
||||
def patch(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._patch)
|
||||
|
||||
@property
|
||||
def raw_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._raw_url)
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._status)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -23,82 +23,136 @@ import github.GistHistoryState
|
||||
|
||||
|
||||
class Gist(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Gists as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def comments(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._comments)
|
||||
return self._NoneIfNotSet(self._comments)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._description)
|
||||
return self._NoneIfNotSet(self._description)
|
||||
|
||||
@property
|
||||
def files(self):
|
||||
"""
|
||||
:type: dict of string to :class:`github.GistFile.GistFile`
|
||||
"""
|
||||
self._completeIfNotSet(self._files)
|
||||
return self._NoneIfNotSet(self._files)
|
||||
|
||||
@property
|
||||
def fork_of(self):
|
||||
"""
|
||||
:type: :class:`github.Gist.Gist`
|
||||
"""
|
||||
self._completeIfNotSet(self._fork_of)
|
||||
return self._NoneIfNotSet(self._fork_of)
|
||||
|
||||
@property
|
||||
def forks(self):
|
||||
"""
|
||||
:type: list of :class:`github.Gist.Gist`
|
||||
"""
|
||||
self._completeIfNotSet(self._forks)
|
||||
return self._NoneIfNotSet(self._forks)
|
||||
|
||||
@property
|
||||
def git_pull_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._git_pull_url)
|
||||
return self._NoneIfNotSet(self._git_pull_url)
|
||||
|
||||
@property
|
||||
def git_push_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._git_push_url)
|
||||
return self._NoneIfNotSet(self._git_push_url)
|
||||
|
||||
@property
|
||||
def history(self):
|
||||
"""
|
||||
:type: list of :class:`github.GistHistoryState.GistHistoryState`
|
||||
"""
|
||||
self._completeIfNotSet(self._history)
|
||||
return self._NoneIfNotSet(self._history)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def public(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
self._completeIfNotSet(self._public)
|
||||
return self._NoneIfNotSet(self._public)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._user)
|
||||
return self._NoneIfNotSet(self._user)
|
||||
|
||||
def create_comment(self, body):
|
||||
"""
|
||||
:calls: `POST /gists/:id/comments <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:rtype: :class:`github.GistComment.GistComment`
|
||||
"""
|
||||
assert isinstance(body, (str, unicode)), body
|
||||
post_parameters = {
|
||||
"body": body,
|
||||
@@ -112,6 +166,10 @@ class Gist(github.GithubObject.GithubObject):
|
||||
return github.GistComment.GistComment(self._requester, data, completed=True)
|
||||
|
||||
def create_fork(self):
|
||||
"""
|
||||
:calls: `POST /gists/:id/fork <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.Gist.Gist`
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"POST",
|
||||
self.url + "/fork",
|
||||
@@ -121,6 +179,10 @@ class Gist(github.GithubObject.GithubObject):
|
||||
return Gist(self._requester, data, completed=True)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /gists/:id <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -129,6 +191,12 @@ class Gist(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, description=github.GithubObject.NotSet, files=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /gists/:id <http://developer.github.com/v3/todo>`_
|
||||
:param description: string
|
||||
:param files: dict of string to :class:`github.InputFileContent.InputFileContent`
|
||||
:rtype: None
|
||||
"""
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
assert files is github.GithubObject.NotSet or all(isinstance(element, github.InputFileContent) for element in files.itervalues()), files
|
||||
post_parameters = dict()
|
||||
@@ -145,6 +213,11 @@ class Gist(github.GithubObject.GithubObject):
|
||||
self._useAttributes(data)
|
||||
|
||||
def get_comment(self, id):
|
||||
"""
|
||||
:calls: `GET /gists/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:param id: integer
|
||||
:rtype: :class:`github.GistComment.GistComment`
|
||||
"""
|
||||
assert isinstance(id, (int, long)), id
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -155,6 +228,10 @@ class Gist(github.GithubObject.GithubObject):
|
||||
return github.GistComment.GistComment(self._requester, data, completed=True)
|
||||
|
||||
def get_comments(self):
|
||||
"""
|
||||
:calls: `GET /gists/:id/comments <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.GistComment.GistComment`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.GistComment.GistComment,
|
||||
self._requester,
|
||||
@@ -163,6 +240,10 @@ class Gist(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def is_starred(self):
|
||||
"""
|
||||
:calls: `GET /gists/:id/star <http://developer.github.com/v3/todo>`_
|
||||
:rtype: bool
|
||||
"""
|
||||
status, headers, data = self._requester.requestRaw(
|
||||
"GET",
|
||||
self.url + "/star",
|
||||
@@ -172,6 +253,10 @@ class Gist(github.GithubObject.GithubObject):
|
||||
return status == 204
|
||||
|
||||
def reset_starred(self):
|
||||
"""
|
||||
:calls: `DELETE /gists/:id/star <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url + "/star",
|
||||
@@ -180,6 +265,10 @@ class Gist(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def set_starred(self):
|
||||
"""
|
||||
:calls: `PUT /gists/:id/star <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"PUT",
|
||||
self.url + "/star",
|
||||
|
||||
@@ -19,37 +19,63 @@ import github.NamedUser
|
||||
|
||||
|
||||
class GistComment(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents GistComments as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def body(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._body)
|
||||
return self._NoneIfNotSet(self._body)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._user)
|
||||
return self._NoneIfNotSet(self._user)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /gists/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -58,6 +84,11 @@ class GistComment(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, body):
|
||||
"""
|
||||
:calls: `PATCH /gists/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(body, (str, unicode)), body
|
||||
post_parameters = {
|
||||
"body": body,
|
||||
|
||||
@@ -17,24 +17,43 @@ import github.GithubObject
|
||||
|
||||
|
||||
class GistFile(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents GistFiles as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def content(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._content)
|
||||
|
||||
@property
|
||||
def filename(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._filename)
|
||||
|
||||
@property
|
||||
def language(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._language)
|
||||
|
||||
@property
|
||||
def raw_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._raw_url)
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._size)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -20,28 +20,47 @@ import github.CommitStats
|
||||
|
||||
|
||||
class GistHistoryState(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents GistHistoryStates as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def change_status(self):
|
||||
"""
|
||||
:type: :class:`github.CommitStats.CommitStats`
|
||||
"""
|
||||
self._completeIfNotSet(self._change_status)
|
||||
return self._NoneIfNotSet(self._change_status)
|
||||
|
||||
@property
|
||||
def committed_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._committed_at)
|
||||
return self._NoneIfNotSet(self._committed_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._user)
|
||||
return self._NoneIfNotSet(self._user)
|
||||
|
||||
@property
|
||||
def version(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._version)
|
||||
return self._NoneIfNotSet(self._version)
|
||||
|
||||
|
||||
@@ -17,16 +17,29 @@ import github.GithubObject
|
||||
|
||||
|
||||
class GitAuthor(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents GitAuthors as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def date(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
return self._NoneIfNotSet(self._date)
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._email)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -17,28 +17,47 @@ import github.GithubObject
|
||||
|
||||
|
||||
class GitBlob(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents GitBlobs as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def content(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._content)
|
||||
return self._NoneIfNotSet(self._content)
|
||||
|
||||
@property
|
||||
def encoding(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._encoding)
|
||||
return self._NoneIfNotSet(self._encoding)
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._sha)
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._size)
|
||||
return self._NoneIfNotSet(self._size)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
|
||||
@@ -20,38 +20,63 @@ import github.GitTree
|
||||
|
||||
|
||||
class GitCommit(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents GitCommits as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def author(self):
|
||||
"""
|
||||
:type: :class:`github.GitAuthor.GitAuthor`
|
||||
"""
|
||||
self._completeIfNotSet(self._author)
|
||||
return self._NoneIfNotSet(self._author)
|
||||
|
||||
@property
|
||||
def committer(self):
|
||||
"""
|
||||
:type: :class:`github.GitAuthor.GitAuthor`
|
||||
"""
|
||||
self._completeIfNotSet(self._committer)
|
||||
return self._NoneIfNotSet(self._committer)
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._message)
|
||||
return self._NoneIfNotSet(self._message)
|
||||
|
||||
@property
|
||||
def parents(self):
|
||||
"""
|
||||
:type: list of :class:`github.GitCommit.GitCommit`
|
||||
"""
|
||||
self._completeIfNotSet(self._parents)
|
||||
return self._NoneIfNotSet(self._parents)
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._sha)
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def tree(self):
|
||||
"""
|
||||
:type: :class:`github.GitTree.GitTree`
|
||||
"""
|
||||
self._completeIfNotSet(self._tree)
|
||||
return self._NoneIfNotSet(self._tree)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
|
||||
@@ -17,16 +17,29 @@ import github.GithubObject
|
||||
|
||||
|
||||
class GitObject(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents GitObjects as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._type)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -19,22 +19,39 @@ import github.GitObject
|
||||
|
||||
|
||||
class GitRef(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents GitRefs as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def object(self):
|
||||
"""
|
||||
:type: :class:`github.GitObject.GitObject`
|
||||
"""
|
||||
self._completeIfNotSet(self._object)
|
||||
return self._NoneIfNotSet(self._object)
|
||||
|
||||
@property
|
||||
def ref(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._ref)
|
||||
return self._NoneIfNotSet(self._ref)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/git/refs/:ref <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -43,6 +60,12 @@ class GitRef(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, sha, force=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /repos/:user/:repo/git/refs/:ref <http://developer.github.com/v3/todo>`_
|
||||
:param sha: string
|
||||
:param force: bool
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(sha, (str, unicode)), sha
|
||||
assert force is github.GithubObject.NotSet or isinstance(force, bool), force
|
||||
post_parameters = {
|
||||
|
||||
@@ -20,33 +20,55 @@ import github.GitObject
|
||||
|
||||
|
||||
class GitTag(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents GitTags as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._message)
|
||||
return self._NoneIfNotSet(self._message)
|
||||
|
||||
@property
|
||||
def object(self):
|
||||
"""
|
||||
:type: :class:`github.GitObject.GitObject`
|
||||
"""
|
||||
self._completeIfNotSet(self._object)
|
||||
return self._NoneIfNotSet(self._object)
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._sha)
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def tag(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._tag)
|
||||
return self._NoneIfNotSet(self._tag)
|
||||
|
||||
@property
|
||||
def tagger(self):
|
||||
"""
|
||||
:type: :class:`github.GitAuthor.GitAuthor`
|
||||
"""
|
||||
self._completeIfNotSet(self._tagger)
|
||||
return self._NoneIfNotSet(self._tagger)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
|
||||
@@ -19,18 +19,31 @@ import github.GitTreeElement
|
||||
|
||||
|
||||
class GitTree(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents GitTrees as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._sha)
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def tree(self):
|
||||
"""
|
||||
:type: list of :class:`github.GitTreeElement.GitTreeElement`
|
||||
"""
|
||||
self._completeIfNotSet(self._tree)
|
||||
return self._NoneIfNotSet(self._tree)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
|
||||
@@ -17,28 +17,50 @@ import github.GithubObject
|
||||
|
||||
|
||||
class GitTreeElement(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents GitTreeElements as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def mode(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._mode)
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._path)
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._sha)
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._size)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._type)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -33,6 +33,10 @@ DEFAULT_TIMEOUT = 10
|
||||
|
||||
|
||||
class Github(object):
|
||||
"""
|
||||
This class represents Githubs as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None, user_agent=None):
|
||||
"""
|
||||
:param login_or_token: string
|
||||
@@ -63,9 +67,17 @@ class Github(object):
|
||||
|
||||
@property
|
||||
def rate_limiting(self):
|
||||
"""
|
||||
:type: (int, int)
|
||||
"""
|
||||
return self.__requester.rate_limiting
|
||||
|
||||
def get_user(self, login=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /users/:user <http://developer.github.com/v3/todo>`_
|
||||
:param login: string
|
||||
:rtype: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
assert login is github.GithubObject.NotSet or isinstance(login, (str, unicode)), login
|
||||
if login is github.GithubObject.NotSet:
|
||||
return AuthenticatedUser.AuthenticatedUser(self.__requester, {"url": "/user"}, completed=False)
|
||||
@@ -79,6 +91,11 @@ class Github(object):
|
||||
return github.NamedUser.NamedUser(self.__requester, data, completed=True)
|
||||
|
||||
def get_organization(self, login):
|
||||
"""
|
||||
:calls: `GET /orgs/:org <http://developer.github.com/v3/todo>`_
|
||||
:param login: string
|
||||
:rtype: :class:`github.Organization.Organization`
|
||||
"""
|
||||
assert isinstance(login, (str, unicode)), login
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -89,6 +106,10 @@ class Github(object):
|
||||
return github.Organization.Organization(self.__requester, data, completed=True)
|
||||
|
||||
def get_repo(self, full_name):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(full_name, (str, unicode)), full_name
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -99,6 +120,11 @@ class Github(object):
|
||||
return Repository.Repository(self.__requester, data, completed=True)
|
||||
|
||||
def get_gist(self, id):
|
||||
"""
|
||||
:calls: `GET /gists/:id <http://developer.github.com/v3/todo>`_
|
||||
:param id: string
|
||||
:rtype: :class:`github.Gist.Gist`
|
||||
"""
|
||||
assert isinstance(id, (str, unicode)), id
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -109,6 +135,10 @@ class Github(object):
|
||||
return github.Gist.Gist(self.__requester, data, completed=True)
|
||||
|
||||
def get_gists(self):
|
||||
"""
|
||||
:calls: `GET /gists/public <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Gist.Gist`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Gist.Gist,
|
||||
self.__requester,
|
||||
@@ -117,6 +147,12 @@ class Github(object):
|
||||
)
|
||||
|
||||
def legacy_search_repos(self, keyword, language=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /legacy/repos/search/:keyword <http://developer.github.com/v3/todo>`_
|
||||
:param keyword: string
|
||||
:param language: string
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(keyword, (str, unicode)), keyword
|
||||
assert language is github.GithubObject.NotSet or isinstance(language, (str, unicode)), language
|
||||
args = {} if language is github.GithubObject.NotSet else {"language": language}
|
||||
@@ -130,6 +166,11 @@ class Github(object):
|
||||
)
|
||||
|
||||
def legacy_search_users(self, keyword):
|
||||
"""
|
||||
:calls: `GET /legacy/user/search/:keyword <http://developer.github.com/v3/todo>`_
|
||||
:param keyword: string
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
assert isinstance(keyword, (str, unicode)), keyword
|
||||
return Legacy.PaginatedList(
|
||||
"/legacy/user/search/" + urllib.quote(keyword),
|
||||
@@ -141,6 +182,11 @@ class Github(object):
|
||||
)
|
||||
|
||||
def legacy_search_user_by_email(self, email):
|
||||
"""
|
||||
:calls: `GET /legacy/user/email/:email <http://developer.github.com/v3/todo>`_
|
||||
:param email: string
|
||||
:rtype: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
assert isinstance(email, (str, unicode)), email
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -151,6 +197,12 @@ class Github(object):
|
||||
return github.NamedUser.NamedUser(self.__requester, Legacy.convertUser(data["user"]), completed=False)
|
||||
|
||||
def render_markdown(self, text, context=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /markdown <http://developer.github.com/v3/todo>`_
|
||||
:param text: string
|
||||
:param context: :class:`github.Repository.Repository`
|
||||
:rtype: string
|
||||
"""
|
||||
assert isinstance(text, (str, unicode)), text
|
||||
assert context is github.GithubObject.NotSet or isinstance(context, github.Repository.Repository), context
|
||||
post_parameters = {
|
||||
@@ -168,6 +220,10 @@ class Github(object):
|
||||
return data
|
||||
|
||||
def get_hooks(self):
|
||||
"""
|
||||
:calls: `GET /hooks <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.HookDescription.HookDescription`
|
||||
"""
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
"/hooks",
|
||||
@@ -177,6 +233,10 @@ class Github(object):
|
||||
return [HookDescription.HookDescription(self.__requester, attributes, completed=True) for attributes in data]
|
||||
|
||||
def get_gitignore_templates(self):
|
||||
"""
|
||||
:calls: `GET /gitignore/templates <http://developer.github.com/v3/todo>`_
|
||||
:rtype: list of string
|
||||
"""
|
||||
headers, data = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
"/gitignore/templates",
|
||||
@@ -186,6 +246,10 @@ class Github(object):
|
||||
return data
|
||||
|
||||
def get_gitignore_template(self, name):
|
||||
"""
|
||||
:calls: `GET /gitignore/templates/:name <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.GitignoreTemplate.GitignoreTemplate`
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
headers, attributes = self.__requester.requestAndCheck(
|
||||
"GET",
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
|
||||
|
||||
class GithubException(Exception):
|
||||
"""
|
||||
This class represents GithubExceptions as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
def __init__(self, status, data):
|
||||
Exception.__init__(self)
|
||||
self.status = status
|
||||
|
||||
@@ -17,12 +17,22 @@ import github.GithubObject
|
||||
|
||||
|
||||
class GitignoreTemplate(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents GitignoreTemplates as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def source(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._source)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -19,52 +19,87 @@ import github.HookResponse
|
||||
|
||||
|
||||
class Hook(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Hooks as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def active(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
self._completeIfNotSet(self._active)
|
||||
return self._NoneIfNotSet(self._active)
|
||||
|
||||
@property
|
||||
def config(self):
|
||||
"""
|
||||
:type: dict
|
||||
"""
|
||||
self._completeIfNotSet(self._config)
|
||||
return self._NoneIfNotSet(self._config)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def events(self):
|
||||
"""
|
||||
:type: list of string
|
||||
"""
|
||||
self._completeIfNotSet(self._events)
|
||||
return self._NoneIfNotSet(self._events)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def last_response(self):
|
||||
"""
|
||||
:type: :class:`github.HookResponse.HookResponse`
|
||||
"""
|
||||
self._completeIfNotSet(self._last_response)
|
||||
return self._NoneIfNotSet(self._last_response)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._name)
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/hooks/:id <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -73,6 +108,16 @@ class Hook(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, name, config, events=github.GithubObject.NotSet, add_events=github.GithubObject.NotSet, remove_events=github.GithubObject.NotSet, active=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /repos/:user/:repo/hooks/:id <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:param config: dict
|
||||
:param events: list of string
|
||||
:param add_events: list of string
|
||||
:param remove_events: list of string
|
||||
:param active: bool
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert isinstance(config, dict), config
|
||||
assert events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events
|
||||
@@ -100,6 +145,10 @@ class Hook(github.GithubObject.GithubObject):
|
||||
self._useAttributes(data)
|
||||
|
||||
def test(self):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/hooks/:id/test <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"POST",
|
||||
self.url + "/test",
|
||||
|
||||
@@ -17,20 +17,36 @@ import github.GithubObject
|
||||
|
||||
|
||||
class HookDescription(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents HookDescriptions as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def events(self):
|
||||
"""
|
||||
:type: list of string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._events)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def schema(self):
|
||||
"""
|
||||
:type: list of list of string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._schema)
|
||||
|
||||
@property
|
||||
def supported_events(self):
|
||||
"""
|
||||
:type: list of string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._supported_events)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -17,16 +17,29 @@ import github.GithubObject
|
||||
|
||||
|
||||
class HookResponse(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents HookResponses as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def code(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._code)
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._message)
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._status)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
|
||||
|
||||
class InputFileContent(object):
|
||||
"""
|
||||
This class represents InputFileContents as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
def __init__(self, content):
|
||||
"""
|
||||
:param content: string
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
|
||||
|
||||
class InputGitAuthor(object):
|
||||
"""
|
||||
This class represents InputGitAuthors as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
def __init__(self, name, email, date):
|
||||
"""
|
||||
:param name: string
|
||||
|
||||
@@ -17,6 +17,10 @@ import github.GithubObject
|
||||
|
||||
|
||||
class InputGitTreeElement(object):
|
||||
"""
|
||||
This class represents InputGitTreeElements as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
def __init__(self, path, mode, type, content=github.GithubObject.NotSet, sha=github.GithubObject.NotSet):
|
||||
"""
|
||||
:param path: string
|
||||
|
||||
+109
@@ -26,97 +26,160 @@ import github.IssuePullRequest
|
||||
|
||||
|
||||
class Issue(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Issues as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def assignee(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._assignee)
|
||||
return self._NoneIfNotSet(self._assignee)
|
||||
|
||||
@property
|
||||
def body(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._body)
|
||||
return self._NoneIfNotSet(self._body)
|
||||
|
||||
@property
|
||||
def closed_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._closed_at)
|
||||
return self._NoneIfNotSet(self._closed_at)
|
||||
|
||||
@property
|
||||
def closed_by(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._closed_by)
|
||||
return self._NoneIfNotSet(self._closed_by)
|
||||
|
||||
@property
|
||||
def comments(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._comments)
|
||||
return self._NoneIfNotSet(self._comments)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def labels(self):
|
||||
"""
|
||||
:type: list of :class:`github.Label.Label`
|
||||
"""
|
||||
self._completeIfNotSet(self._labels)
|
||||
return self._NoneIfNotSet(self._labels)
|
||||
|
||||
@property
|
||||
def milestone(self):
|
||||
"""
|
||||
:type: :class:`github.Milestone.Milestone`
|
||||
"""
|
||||
self._completeIfNotSet(self._milestone)
|
||||
return self._NoneIfNotSet(self._milestone)
|
||||
|
||||
@property
|
||||
def number(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._number)
|
||||
return self._NoneIfNotSet(self._number)
|
||||
|
||||
@property
|
||||
def pull_request(self):
|
||||
"""
|
||||
:type: :class:`github.IssuePullRequest.IssuePullRequest`
|
||||
"""
|
||||
self._completeIfNotSet(self._pull_request)
|
||||
return self._NoneIfNotSet(self._pull_request)
|
||||
|
||||
@property
|
||||
def repository(self):
|
||||
"""
|
||||
:type: :class:`github.Repository.Repository`
|
||||
"""
|
||||
self._completeIfNotSet(self._repository)
|
||||
return self._NoneIfNotSet(self._repository)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._state)
|
||||
return self._NoneIfNotSet(self._state)
|
||||
|
||||
@property
|
||||
def title(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._title)
|
||||
return self._NoneIfNotSet(self._title)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._user)
|
||||
return self._NoneIfNotSet(self._user)
|
||||
|
||||
def add_to_labels(self, *labels):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/issues/:number/labels <http://developer.github.com/v3/todo>`_
|
||||
:param label: :class:`github.Label.Label`
|
||||
:rtype: None
|
||||
"""
|
||||
assert all(isinstance(element, github.Label.Label) for element in labels), labels
|
||||
post_parameters = [label.name for label in labels]
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
@@ -127,6 +190,11 @@ class Issue(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def create_comment(self, body):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/issues/:number/comments <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:rtype: :class:`github.IssueComment.IssueComment`
|
||||
"""
|
||||
assert isinstance(body, (str, unicode)), body
|
||||
post_parameters = {
|
||||
"body": body,
|
||||
@@ -140,6 +208,10 @@ class Issue(github.GithubObject.GithubObject):
|
||||
return github.IssueComment.IssueComment(self._requester, data, completed=True)
|
||||
|
||||
def delete_labels(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/issues/:number/labels <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url + "/labels",
|
||||
@@ -148,6 +220,16 @@ class Issue(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, title=github.GithubObject.NotSet, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, state=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /repos/:user/:repo/issues/:number <http://developer.github.com/v3/todo>`_
|
||||
:param title: string
|
||||
:param body: string
|
||||
:param assignee: :class:`github.NamedUser.NamedUser` or None
|
||||
:param state: string
|
||||
:param milestone: :class:`github.Milestone.Milestone` or None
|
||||
:param labels: list of string
|
||||
:rtype: None
|
||||
"""
|
||||
assert title is github.GithubObject.NotSet or isinstance(title, (str, unicode)), title
|
||||
assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body
|
||||
assert assignee is github.GithubObject.NotSet or assignee is None or isinstance(assignee, github.NamedUser.NamedUser), assignee
|
||||
@@ -176,6 +258,11 @@ class Issue(github.GithubObject.GithubObject):
|
||||
self._useAttributes(data)
|
||||
|
||||
def get_comment(self, id):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/issues/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:param id: integer
|
||||
:rtype: :class:`github.IssueComment.IssueComment`
|
||||
"""
|
||||
assert isinstance(id, (int, long)), id
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -186,6 +273,10 @@ class Issue(github.GithubObject.GithubObject):
|
||||
return github.IssueComment.IssueComment(self._requester, data, completed=True)
|
||||
|
||||
def get_comments(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/issues/:number/comments <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.IssueComment.IssueComment`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.IssueComment.IssueComment,
|
||||
self._requester,
|
||||
@@ -194,6 +285,10 @@ class Issue(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_events(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/issues/:number/events <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.IssueEvent.IssueEvent`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.IssueEvent.IssueEvent,
|
||||
self._requester,
|
||||
@@ -202,6 +297,10 @@ class Issue(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_labels(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/issues/:number/labels <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Label.Label`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Label.Label,
|
||||
self._requester,
|
||||
@@ -210,6 +309,11 @@ class Issue(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def remove_from_labels(self, label):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/issues/:number/labels/:name <http://developer.github.com/v3/todo>`_
|
||||
:param label: :class:`github.Label.Label`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(label, github.Label.Label), label
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
@@ -219,6 +323,11 @@ class Issue(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def set_labels(self, *labels):
|
||||
"""
|
||||
:calls: `PUT /repos/:user/:repo/issues/:number/labels <http://developer.github.com/v3/todo>`_
|
||||
:param label: :class:`github.Label.Label`
|
||||
:rtype: None
|
||||
"""
|
||||
assert all(isinstance(element, github.Label.Label) for element in labels), labels
|
||||
post_parameters = [label.name for label in labels]
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
|
||||
@@ -19,37 +19,63 @@ import github.NamedUser
|
||||
|
||||
|
||||
class IssueComment(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents IssueComments as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def body(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._body)
|
||||
return self._NoneIfNotSet(self._body)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._user)
|
||||
return self._NoneIfNotSet(self._user)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/issues/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -58,6 +84,11 @@ class IssueComment(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, body):
|
||||
"""
|
||||
:calls: `PATCH /repos/:user/:repo/issues/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(body, (str, unicode)), body
|
||||
post_parameters = {
|
||||
"body": body,
|
||||
|
||||
@@ -20,38 +20,63 @@ import github.NamedUser
|
||||
|
||||
|
||||
class IssueEvent(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents IssueEvents as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def actor(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._actor)
|
||||
return self._NoneIfNotSet(self._actor)
|
||||
|
||||
@property
|
||||
def commit_id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._commit_id)
|
||||
return self._NoneIfNotSet(self._commit_id)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def event(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._event)
|
||||
return self._NoneIfNotSet(self._event)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def issue(self):
|
||||
"""
|
||||
:type: :class:`github.Issue.Issue`
|
||||
"""
|
||||
self._completeIfNotSet(self._issue)
|
||||
return self._NoneIfNotSet(self._issue)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
|
||||
@@ -17,16 +17,29 @@ import github.GithubObject
|
||||
|
||||
|
||||
class IssuePullRequest(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents IssuePullRequests as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def diff_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._diff_url)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def patch_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._patch_url)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -19,22 +19,39 @@ import github.GithubObject
|
||||
|
||||
|
||||
class Label(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Labels as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def color(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._color)
|
||||
return self._NoneIfNotSet(self._color)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._name)
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/labels/:name <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -43,6 +60,12 @@ class Label(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, name, color):
|
||||
"""
|
||||
:calls: `PATCH /repos/:user/:repo/labels/:name <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:param color: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert isinstance(color, (str, unicode)), color
|
||||
post_parameters = {
|
||||
|
||||
@@ -23,62 +23,103 @@ import github.Label
|
||||
|
||||
|
||||
class Milestone(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Milestones as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def closed_issues(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._closed_issues)
|
||||
return self._NoneIfNotSet(self._closed_issues)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def creator(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._creator)
|
||||
return self._NoneIfNotSet(self._creator)
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._description)
|
||||
return self._NoneIfNotSet(self._description)
|
||||
|
||||
@property
|
||||
def due_on(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._due_on)
|
||||
return self._NoneIfNotSet(self._due_on)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def number(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._number)
|
||||
return self._NoneIfNotSet(self._number)
|
||||
|
||||
@property
|
||||
def open_issues(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._open_issues)
|
||||
return self._NoneIfNotSet(self._open_issues)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._state)
|
||||
return self._NoneIfNotSet(self._state)
|
||||
|
||||
@property
|
||||
def title(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._title)
|
||||
return self._NoneIfNotSet(self._title)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /repos/:user/:repo/milestones/:number <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -87,6 +128,14 @@ class Milestone(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, title, state=github.GithubObject.NotSet, description=github.GithubObject.NotSet, due_on=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /repos/:user/:repo/milestones/:number <http://developer.github.com/v3/todo>`_
|
||||
:param title: string
|
||||
:param state: string
|
||||
:param description: string
|
||||
:param due_on: date
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(title, (str, unicode)), title
|
||||
assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
@@ -109,6 +158,10 @@ class Milestone(github.GithubObject.GithubObject):
|
||||
self._useAttributes(data)
|
||||
|
||||
def get_labels(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/milestones/:number/labels <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Label.Label`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Label.Label,
|
||||
self._requester,
|
||||
|
||||
@@ -25,137 +25,226 @@ import github.Event
|
||||
|
||||
|
||||
class NamedUser(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents NamedUsers as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def avatar_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._avatar_url)
|
||||
return self._NoneIfNotSet(self._avatar_url)
|
||||
|
||||
@property
|
||||
def bio(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._bio)
|
||||
return self._NoneIfNotSet(self._bio)
|
||||
|
||||
@property
|
||||
def blog(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._blog)
|
||||
return self._NoneIfNotSet(self._blog)
|
||||
|
||||
@property
|
||||
def collaborators(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._collaborators)
|
||||
return self._NoneIfNotSet(self._collaborators)
|
||||
|
||||
@property
|
||||
def company(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._company)
|
||||
return self._NoneIfNotSet(self._company)
|
||||
|
||||
@property
|
||||
def contributions(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._contributions)
|
||||
return self._NoneIfNotSet(self._contributions)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def disk_usage(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._disk_usage)
|
||||
return self._NoneIfNotSet(self._disk_usage)
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._email)
|
||||
return self._NoneIfNotSet(self._email)
|
||||
|
||||
@property
|
||||
def followers(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._followers)
|
||||
return self._NoneIfNotSet(self._followers)
|
||||
|
||||
@property
|
||||
def following(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._following)
|
||||
return self._NoneIfNotSet(self._following)
|
||||
|
||||
@property
|
||||
def gravatar_id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._gravatar_id)
|
||||
return self._NoneIfNotSet(self._gravatar_id)
|
||||
|
||||
@property
|
||||
def hireable(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
self._completeIfNotSet(self._hireable)
|
||||
return self._NoneIfNotSet(self._hireable)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def location(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._location)
|
||||
return self._NoneIfNotSet(self._location)
|
||||
|
||||
@property
|
||||
def login(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._login)
|
||||
return self._NoneIfNotSet(self._login)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._name)
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def owned_private_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._owned_private_repos)
|
||||
return self._NoneIfNotSet(self._owned_private_repos)
|
||||
|
||||
@property
|
||||
def plan(self):
|
||||
"""
|
||||
:type: :class:`github.Plan.Plan`
|
||||
"""
|
||||
self._completeIfNotSet(self._plan)
|
||||
return self._NoneIfNotSet(self._plan)
|
||||
|
||||
@property
|
||||
def private_gists(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._private_gists)
|
||||
return self._NoneIfNotSet(self._private_gists)
|
||||
|
||||
@property
|
||||
def public_gists(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._public_gists)
|
||||
return self._NoneIfNotSet(self._public_gists)
|
||||
|
||||
@property
|
||||
def public_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._public_repos)
|
||||
return self._NoneIfNotSet(self._public_repos)
|
||||
|
||||
@property
|
||||
def total_private_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._total_private_repos)
|
||||
return self._NoneIfNotSet(self._total_private_repos)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._type)
|
||||
return self._NoneIfNotSet(self._type)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def create_gist(self, public, files, description=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /users/:user/gists <http://developer.github.com/v3/todo>`_
|
||||
:param public: bool
|
||||
:param files: dict of string to :class:`github.InputFileContent.InputFileContent`
|
||||
:param description: string
|
||||
:rtype: :class:`github.Gist.Gist`
|
||||
"""
|
||||
assert isinstance(public, bool), public
|
||||
assert all(isinstance(element, github.InputFileContent) for element in files.itervalues()), files
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
@@ -174,6 +263,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
return github.Gist.Gist(self._requester, data, completed=True)
|
||||
|
||||
def get_events(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/events <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Event.Event,
|
||||
self._requester,
|
||||
@@ -182,6 +275,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_followers(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/followers <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
NamedUser,
|
||||
self._requester,
|
||||
@@ -190,6 +287,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_following(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/following <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
NamedUser,
|
||||
self._requester,
|
||||
@@ -198,6 +299,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_gists(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/gists <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Gist.Gist`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Gist.Gist,
|
||||
self._requester,
|
||||
@@ -206,6 +311,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_orgs(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/orgs <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Organization.Organization,
|
||||
self._requester,
|
||||
@@ -214,6 +323,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_public_events(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/events/public <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Event.Event,
|
||||
self._requester,
|
||||
@@ -222,6 +335,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_public_received_events(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/received_events/public <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Event.Event,
|
||||
self._requester,
|
||||
@@ -230,6 +347,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_received_events(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/received_events <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Event.Event,
|
||||
self._requester,
|
||||
@@ -238,6 +359,11 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_repo(self, name):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:rtype: :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -248,6 +374,11 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
return github.Repository.Repository(self._requester, data, completed=True)
|
||||
|
||||
def get_repos(self, type=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /users/:user/repos <http://developer.github.com/v3/todo>`_
|
||||
:param type: string
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert type is github.GithubObject.NotSet or isinstance(type, (str, unicode)), type
|
||||
url_parameters = dict()
|
||||
if type is not github.GithubObject.NotSet:
|
||||
@@ -260,6 +391,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_starred(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/starred <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Repository.Repository,
|
||||
self._requester,
|
||||
@@ -268,6 +403,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_subscriptions(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/subscriptions <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Repository.Repository,
|
||||
self._requester,
|
||||
@@ -276,6 +415,10 @@ class NamedUser(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_watched(self):
|
||||
"""
|
||||
:calls: `GET /users/:user/watched <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Repository.Repository,
|
||||
self._requester,
|
||||
|
||||
@@ -24,127 +24,208 @@ import github.NamedUser
|
||||
|
||||
|
||||
class Organization(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Organizations as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def avatar_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._avatar_url)
|
||||
return self._NoneIfNotSet(self._avatar_url)
|
||||
|
||||
@property
|
||||
def billing_email(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._billing_email)
|
||||
return self._NoneIfNotSet(self._billing_email)
|
||||
|
||||
@property
|
||||
def blog(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._blog)
|
||||
return self._NoneIfNotSet(self._blog)
|
||||
|
||||
@property
|
||||
def collaborators(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._collaborators)
|
||||
return self._NoneIfNotSet(self._collaborators)
|
||||
|
||||
@property
|
||||
def company(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._company)
|
||||
return self._NoneIfNotSet(self._company)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def disk_usage(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._disk_usage)
|
||||
return self._NoneIfNotSet(self._disk_usage)
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._email)
|
||||
return self._NoneIfNotSet(self._email)
|
||||
|
||||
@property
|
||||
def followers(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._followers)
|
||||
return self._NoneIfNotSet(self._followers)
|
||||
|
||||
@property
|
||||
def following(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._following)
|
||||
return self._NoneIfNotSet(self._following)
|
||||
|
||||
@property
|
||||
def gravatar_id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._gravatar_id)
|
||||
return self._NoneIfNotSet(self._gravatar_id)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def location(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._location)
|
||||
return self._NoneIfNotSet(self._location)
|
||||
|
||||
@property
|
||||
def login(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._login)
|
||||
return self._NoneIfNotSet(self._login)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._name)
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def owned_private_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._owned_private_repos)
|
||||
return self._NoneIfNotSet(self._owned_private_repos)
|
||||
|
||||
@property
|
||||
def plan(self):
|
||||
"""
|
||||
:type: :class:`github.Plan.Plan`
|
||||
"""
|
||||
self._completeIfNotSet(self._plan)
|
||||
return self._NoneIfNotSet(self._plan)
|
||||
|
||||
@property
|
||||
def private_gists(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._private_gists)
|
||||
return self._NoneIfNotSet(self._private_gists)
|
||||
|
||||
@property
|
||||
def public_gists(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._public_gists)
|
||||
return self._NoneIfNotSet(self._public_gists)
|
||||
|
||||
@property
|
||||
def public_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._public_repos)
|
||||
return self._NoneIfNotSet(self._public_repos)
|
||||
|
||||
@property
|
||||
def total_private_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._total_private_repos)
|
||||
return self._NoneIfNotSet(self._total_private_repos)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._type)
|
||||
return self._NoneIfNotSet(self._type)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def add_to_public_members(self, public_member):
|
||||
"""
|
||||
:calls: `PUT /orgs/:org/public_members/:user <http://developer.github.com/v3/todo>`_
|
||||
:param public_member: :class:`github.NamedUser.NamedUser`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(public_member, github.NamedUser.NamedUser), public_member
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"PUT",
|
||||
@@ -154,6 +235,11 @@ class Organization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def create_fork(self, repo):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/forks <http://developer.github.com/v3/todo>`_
|
||||
:param repo: :class:`github.Repository.Repository`
|
||||
:rtype: :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(repo, github.Repository.Repository), repo
|
||||
url_parameters = {
|
||||
"org": self.login,
|
||||
@@ -167,6 +253,20 @@ class Organization(github.GithubObject.GithubObject):
|
||||
return github.Repository.Repository(self._requester, data, completed=True)
|
||||
|
||||
def create_repo(self, name, description=github.GithubObject.NotSet, homepage=github.GithubObject.NotSet, private=github.GithubObject.NotSet, has_issues=github.GithubObject.NotSet, has_wiki=github.GithubObject.NotSet, has_downloads=github.GithubObject.NotSet, team_id=github.GithubObject.NotSet, auto_init=github.GithubObject.NotSet, gitignore_template=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /orgs/:org/repos <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:param description: string
|
||||
:param homepage: string
|
||||
:param private: bool
|
||||
:param has_issues: bool
|
||||
:param has_wiki: bool
|
||||
:param has_downloads: bool
|
||||
:param team_id: :class:`github.Team.Team`
|
||||
:param auto_init: bool
|
||||
:param gitignore_template: string
|
||||
:rtype: :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
assert homepage is github.GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage
|
||||
@@ -207,6 +307,13 @@ class Organization(github.GithubObject.GithubObject):
|
||||
return github.Repository.Repository(self._requester, data, completed=True)
|
||||
|
||||
def create_team(self, name, repo_names=github.GithubObject.NotSet, permission=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `POST /orgs/:org/teams <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:param repo_names: list of :class:`github.Repository.Repository`
|
||||
:param permission: string
|
||||
:rtype: :class:`github.Team.Team`
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert repo_names is github.GithubObject.NotSet or all(isinstance(element, github.Repository.Repository) for element in repo_names), repo_names
|
||||
assert permission is github.GithubObject.NotSet or isinstance(permission, (str, unicode)), permission
|
||||
@@ -226,6 +333,16 @@ class Organization(github.GithubObject.GithubObject):
|
||||
return github.Team.Team(self._requester, data, completed=True)
|
||||
|
||||
def edit(self, billing_email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, email=github.GithubObject.NotSet, location=github.GithubObject.NotSet, name=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /orgs/:org <http://developer.github.com/v3/todo>`_
|
||||
:param billing_email: string
|
||||
:param blog: string
|
||||
:param company: string
|
||||
:param email: string
|
||||
:param location: string
|
||||
:param name: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert billing_email is github.GithubObject.NotSet or isinstance(billing_email, (str, unicode)), billing_email
|
||||
assert blog is github.GithubObject.NotSet or isinstance(blog, (str, unicode)), blog
|
||||
assert company is github.GithubObject.NotSet or isinstance(company, (str, unicode)), company
|
||||
@@ -254,6 +371,10 @@ class Organization(github.GithubObject.GithubObject):
|
||||
self._useAttributes(data)
|
||||
|
||||
def get_events(self):
|
||||
"""
|
||||
:calls: `GET /orgs/:org/events <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Event.Event,
|
||||
self._requester,
|
||||
@@ -262,6 +383,10 @@ class Organization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_members(self):
|
||||
"""
|
||||
:calls: `GET /orgs/:org/members <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.NamedUser.NamedUser,
|
||||
self._requester,
|
||||
@@ -270,6 +395,10 @@ class Organization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_public_members(self):
|
||||
"""
|
||||
:calls: `GET /orgs/:org/public_members <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.NamedUser.NamedUser,
|
||||
self._requester,
|
||||
@@ -278,6 +407,11 @@ class Organization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_repo(self, name):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo <http://developer.github.com/v3/todo>`_
|
||||
:param name: string
|
||||
:rtype: :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -288,6 +422,11 @@ class Organization(github.GithubObject.GithubObject):
|
||||
return github.Repository.Repository(self._requester, data, completed=True)
|
||||
|
||||
def get_repos(self, type=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /orgs/:org/repos <http://developer.github.com/v3/todo>`_
|
||||
:param type: string
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
assert type is github.GithubObject.NotSet or isinstance(type, (str, unicode)), type
|
||||
url_parameters = dict()
|
||||
if type is not github.GithubObject.NotSet:
|
||||
@@ -300,6 +439,11 @@ class Organization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_team(self, id):
|
||||
"""
|
||||
:calls: `GET /teams/:id <http://developer.github.com/v3/todo>`_
|
||||
:param id: integer
|
||||
:rtype: :class:`github.Team.Team`
|
||||
"""
|
||||
assert isinstance(id, (int, long)), id
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -310,6 +454,10 @@ class Organization(github.GithubObject.GithubObject):
|
||||
return github.Team.Team(self._requester, data, completed=True)
|
||||
|
||||
def get_teams(self):
|
||||
"""
|
||||
:calls: `GET /orgs/:org/teams <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Team.Team,
|
||||
self._requester,
|
||||
@@ -318,6 +466,11 @@ class Organization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def has_in_members(self, member):
|
||||
"""
|
||||
:calls: `GET /orgs/:org/members/:user <http://developer.github.com/v3/todo>`_
|
||||
:param member: :class:`github.NamedUser.NamedUser`
|
||||
:rtype: bool
|
||||
"""
|
||||
assert isinstance(member, github.NamedUser.NamedUser), member
|
||||
status, headers, data = self._requester.requestRaw(
|
||||
"GET",
|
||||
@@ -328,6 +481,11 @@ class Organization(github.GithubObject.GithubObject):
|
||||
return status == 204
|
||||
|
||||
def has_in_public_members(self, public_member):
|
||||
"""
|
||||
:calls: `GET /orgs/:org/public_members/:user <http://developer.github.com/v3/todo>`_
|
||||
:param public_member: :class:`github.NamedUser.NamedUser`
|
||||
:rtype: bool
|
||||
"""
|
||||
assert isinstance(public_member, github.NamedUser.NamedUser), public_member
|
||||
status, headers, data = self._requester.requestRaw(
|
||||
"GET",
|
||||
@@ -338,6 +496,11 @@ class Organization(github.GithubObject.GithubObject):
|
||||
return status == 204
|
||||
|
||||
def remove_from_members(self, member):
|
||||
"""
|
||||
:calls: `DELETE /orgs/:org/members/:user <http://developer.github.com/v3/todo>`_
|
||||
:param member: :class:`github.NamedUser.NamedUser`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(member, github.NamedUser.NamedUser), member
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
@@ -347,6 +510,11 @@ class Organization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def remove_from_public_members(self, public_member):
|
||||
"""
|
||||
:calls: `DELETE /orgs/:org/public_members/:user <http://developer.github.com/v3/todo>`_
|
||||
:param public_member: :class:`github.NamedUser.NamedUser`
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(public_member, github.NamedUser.NamedUser), public_member
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
|
||||
@@ -17,16 +17,29 @@ import github.GithubObject
|
||||
|
||||
|
||||
class Permissions(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents Permissionss as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def admin(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
return self._NoneIfNotSet(self._admin)
|
||||
|
||||
@property
|
||||
def pull(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
return self._NoneIfNotSet(self._pull)
|
||||
|
||||
@property
|
||||
def push(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
return self._NoneIfNotSet(self._push)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -17,20 +17,36 @@ import github.GithubObject
|
||||
|
||||
|
||||
class Plan(github.GithubObject.BasicGithubObject):
|
||||
"""
|
||||
This class represents Plans as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def collaborators(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._collaborators)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._NoneIfNotSet(self._name)
|
||||
|
||||
@property
|
||||
def private_repos(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._private_repos)
|
||||
|
||||
@property
|
||||
def space(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
return self._NoneIfNotSet(self._space)
|
||||
|
||||
def _initAttributes(self):
|
||||
|
||||
@@ -26,145 +26,246 @@ import github.Commit
|
||||
|
||||
|
||||
class PullRequest(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents PullRequests as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def additions(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._additions)
|
||||
return self._NoneIfNotSet(self._additions)
|
||||
|
||||
@property
|
||||
def assignee(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._assignee)
|
||||
return self._NoneIfNotSet(self._assignee)
|
||||
|
||||
@property
|
||||
def base(self):
|
||||
"""
|
||||
:type: :class:`github.PullRequestPart.PullRequestPart`
|
||||
"""
|
||||
self._completeIfNotSet(self._base)
|
||||
return self._NoneIfNotSet(self._base)
|
||||
|
||||
@property
|
||||
def body(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._body)
|
||||
return self._NoneIfNotSet(self._body)
|
||||
|
||||
@property
|
||||
def changed_files(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._changed_files)
|
||||
return self._NoneIfNotSet(self._changed_files)
|
||||
|
||||
@property
|
||||
def closed_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._closed_at)
|
||||
return self._NoneIfNotSet(self._closed_at)
|
||||
|
||||
@property
|
||||
def comments(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._comments)
|
||||
return self._NoneIfNotSet(self._comments)
|
||||
|
||||
@property
|
||||
def commits(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._commits)
|
||||
return self._NoneIfNotSet(self._commits)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def deletions(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._deletions)
|
||||
return self._NoneIfNotSet(self._deletions)
|
||||
|
||||
@property
|
||||
def diff_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._diff_url)
|
||||
return self._NoneIfNotSet(self._diff_url)
|
||||
|
||||
@property
|
||||
def head(self):
|
||||
"""
|
||||
:type: :class:`github.PullRequestPart.PullRequestPart`
|
||||
"""
|
||||
self._completeIfNotSet(self._head)
|
||||
return self._NoneIfNotSet(self._head)
|
||||
|
||||
@property
|
||||
def html_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._html_url)
|
||||
return self._NoneIfNotSet(self._html_url)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def issue_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._issue_url)
|
||||
return self._NoneIfNotSet(self._issue_url)
|
||||
|
||||
@property
|
||||
def mergeable(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
self._completeIfNotSet(self._mergeable)
|
||||
return self._NoneIfNotSet(self._mergeable)
|
||||
|
||||
@property
|
||||
def merged(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
self._completeIfNotSet(self._merged)
|
||||
return self._NoneIfNotSet(self._merged)
|
||||
|
||||
@property
|
||||
def merged_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._merged_at)
|
||||
return self._NoneIfNotSet(self._merged_at)
|
||||
|
||||
@property
|
||||
def merged_by(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._merged_by)
|
||||
return self._NoneIfNotSet(self._merged_by)
|
||||
|
||||
@property
|
||||
def number(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._number)
|
||||
return self._NoneIfNotSet(self._number)
|
||||
|
||||
@property
|
||||
def patch_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._patch_url)
|
||||
return self._NoneIfNotSet(self._patch_url)
|
||||
|
||||
@property
|
||||
def review_comments(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._review_comments)
|
||||
return self._NoneIfNotSet(self._review_comments)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._state)
|
||||
return self._NoneIfNotSet(self._state)
|
||||
|
||||
@property
|
||||
def title(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._title)
|
||||
return self._NoneIfNotSet(self._title)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
self._completeIfNotSet(self._user)
|
||||
return self._NoneIfNotSet(self._user)
|
||||
|
||||
def create_comment(self, body, commit_id, path, position):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/pulls/:number/comments <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:param commit_id: :class:`github.Commit.Commit`
|
||||
:param path: string
|
||||
:param position: integer
|
||||
:rtype: :class:`github.PullRequestComment.PullRequestComment`
|
||||
"""
|
||||
return self.create_review_comment(body, commit_id, path, position)
|
||||
|
||||
def create_review_comment(self, body, commit_id, path, position):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/pulls/:number/comments <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:param commit_id: :class:`github.Commit.Commit`
|
||||
:param path: string
|
||||
:param position: integer
|
||||
:rtype: :class:`github.PullRequestComment.PullRequestComment`
|
||||
"""
|
||||
assert isinstance(body, (str, unicode)), body
|
||||
assert isinstance(commit_id, github.Commit.Commit), commit_id
|
||||
assert isinstance(path, (str, unicode)), path
|
||||
@@ -184,6 +285,11 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
return github.PullRequestComment.PullRequestComment(self._requester, data, completed=True)
|
||||
|
||||
def create_issue_comment(self, body):
|
||||
"""
|
||||
:calls: `POST /repos/:user/:repo/issues/:number/comments <http://developer.github.com/v3/todo>`_
|
||||
:param body: string
|
||||
:rtype: :class:`github.IssueComment.IssueComment`
|
||||
"""
|
||||
assert isinstance(body, (str, unicode)), body
|
||||
post_parameters = {
|
||||
"body": body,
|
||||
@@ -197,6 +303,13 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
return github.IssueComment.IssueComment(self._requester, data, completed=True)
|
||||
|
||||
def edit(self, title=github.GithubObject.NotSet, body=github.GithubObject.NotSet, state=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /repos/:user/:repo/pulls/:number <http://developer.github.com/v3/todo>`_
|
||||
:param title: string
|
||||
:param body: string
|
||||
:param state: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert title is github.GithubObject.NotSet or isinstance(title, (str, unicode)), title
|
||||
assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body
|
||||
assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state
|
||||
@@ -216,9 +329,19 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
self._useAttributes(data)
|
||||
|
||||
def get_comment(self, id):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/pulls/comments/:number <http://developer.github.com/v3/todo>`_
|
||||
:param id: integer
|
||||
:rtype: :class:`github.PullRequestComment.PullRequestComment`
|
||||
"""
|
||||
return self.get_review_comment(id)
|
||||
|
||||
def get_review_comment(self, id):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/pulls/comments/:number <http://developer.github.com/v3/todo>`_
|
||||
:param id: integer
|
||||
:rtype: :class:`github.PullRequestComment.PullRequestComment`
|
||||
"""
|
||||
assert isinstance(id, (int, long)), id
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -229,9 +352,17 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
return github.PullRequestComment.PullRequestComment(self._requester, data, completed=True)
|
||||
|
||||
def get_comments(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/pulls/:number/comments <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequestComment.PullRequestComment`
|
||||
"""
|
||||
return self.get_review_comments()
|
||||
|
||||
def get_review_comments(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/pulls/:number/comments <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequestComment.PullRequestComment`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.PullRequestComment.PullRequestComment,
|
||||
self._requester,
|
||||
@@ -240,6 +371,10 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_commits(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/pulls/:number/commits <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Commit.Commit`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Commit.Commit,
|
||||
self._requester,
|
||||
@@ -248,6 +383,10 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_files(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/pulls/:number/files <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.File.File`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.File.File,
|
||||
self._requester,
|
||||
@@ -256,6 +395,11 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def get_issue_comment(self, id):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/issues/comments/:id <http://developer.github.com/v3/todo>`_
|
||||
:param id: integer
|
||||
:rtype: :class:`github.IssueComment.IssueComment`
|
||||
"""
|
||||
assert isinstance(id, (int, long)), id
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"GET",
|
||||
@@ -266,6 +410,10 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
return github.IssueComment.IssueComment(self._requester, data, completed=True)
|
||||
|
||||
def get_issue_comments(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/issues/:number/comments <http://developer.github.com/v3/todo>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.IssueComment.IssueComment`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.IssueComment.IssueComment,
|
||||
self._requester,
|
||||
@@ -274,6 +422,10 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def is_merged(self):
|
||||
"""
|
||||
:calls: `GET /repos/:user/:repo/pulls/:number/merge <http://developer.github.com/v3/todo>`_
|
||||
:rtype: bool
|
||||
"""
|
||||
status, headers, data = self._requester.requestRaw(
|
||||
"GET",
|
||||
self.url + "/merge",
|
||||
@@ -283,6 +435,11 @@ class PullRequest(github.GithubObject.GithubObject):
|
||||
return status == 204
|
||||
|
||||
def merge(self, commit_message=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PUT /repos/:user/:repo/pulls/:number/merge <http://developer.github.com/v3/todo>`_
|
||||
:param commit_message: string
|
||||
:rtype: :class:`github.PullRequestMergeStatus.PullRequestMergeStatus`
|
||||
"""
|
||||
assert commit_message is github.GithubObject.NotSet or isinstance(commit_message, (str, unicode)), commit_message
|
||||
post_parameters = dict()
|
||||
if commit_message is not github.GithubObject.NotSet:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user