diff --git a/doc/.gitignore b/doc/.gitignore index 84c048a7..28bed887 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1 +1,2 @@ /build/ +github_objects.rst diff --git a/doc/ReferenceOfApis.md b/doc/ReferenceOfApis.md deleted file mode 100644 index 0cb3efd1..00000000 --- a/doc/ReferenceOfApis.md +++ /dev/null @@ -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` - diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md deleted file mode 100644 index 2278ba23..00000000 --- a/doc/ReferenceOfClasses.md +++ /dev/null @@ -1,1560 +0,0 @@ -You don't normaly create instances of any class but `Github`. -You obtain instances through calls to `search_`, `get_` and `create_` methods. - -Class `Github` -============== - -Constructed from user's login and password or OAuth token or nothing: - - g = Github( login, password ) - g = Github( token ) - g = Github() - -You can also use your client_id and client_secret: - g = github.Github(client_id="YourClientId", client_secret="YourClientSecret") - -You can add an argument `base_url = "http://my.enterprise.com:8080/path/to/github"` to connect to a local install of Github (ie. Github Enterprise). -You can add an argument `user_agent` to send a custom User-Agent header to Github. -Another argument, that can be passed is `timeout` which has default value `10`. - -Attributes ----------- -* `rate_limiting`: tuple of two integers: remaining and limit, as explained in [Rate Limiting](http://developer.github.com/v3/#rate-limiting) - -Methods -------- -* `get_user()`: `AuthenticatedUser` -* `get_user( login )`: `NamedUser` - * `login`: string -* `get_organization( login )`: `Organization` - * `login`: string -* `get_repo( full_name )`: `Repository` -* `get_gist( id )`: `Gist` - * `id`: string -* `get_gists()`: `PaginatedList` of `Gist` -* `get_hooks()`: `PaginatedList` of `HookDescription` -* `legacy_search_repos( keyword, [language] )`: `PaginatedList` of `Repository` - * `keyword`: string - * `language`: string -* `legacy_search_users( keyword )`: `PaginatedList` of `NamedUser` - * `keyword`: string -* `legacy_search_user_by_email( email )`: `NamedUser` - * `email`: string -* `render_markdown( text, [context] )`: string - * `text`: string - * `context`: `Repository` -* `get_gitignore_templates()`: list of string -* `get_gitignore_template( name )`: `GitignoreTemplate` - -Class `PaginatedList` -===================== - -This class implements lazy [pagination requests](http://developer.github.com/v3/#pagination) and hides pagination from you. It is the return type of `get_` methods that return a collection. - -You can iterate on it in a `for f in user.get_followers():` loop or with any [itertools](http://docs.python.org/library/itertools.html) functions. - -You cannot know the number of objects returned before the end of the iteration. If that's *really* what you need, you cant use `len( list( user.get_followers() ) )`, -which does all the requests needed to enumerate the user's followers. Note that there is often an attribute giving this value (in that case `user.followers`). - -You can also call `get_page( page )` to explicitely get a specific page if you don't want to hide pagination. `page` starts at 0. -* `get_page( page )`: list - * `page`: integer - -Class `GithubException` -======================= - -Attributes ----------- -* `status`: integer -* `data`: dict - -Class `AuthenticatedUser` -========================= - -Attributes ----------- -* `avatar_url`: string -* `bio`: string -* `blog`: string -* `collaborators`: integer -* `company`: string -* `created_at`: datetime.datetime -* `disk_usage`: integer -* `email`: string -* `followers`: integer -* `following`: integer -* `gravatar_id`: string -* `hireable`: bool -* `html_url`: string -* `id`: integer -* `location`: string -* `login`: string -* `name`: string -* `owned_private_repos`: integer -* `plan`: `Plan` -* `private_gists`: integer -* `public_gists`: integer -* `public_repos`: integer -* `total_private_repos`: integer -* `type`: string -* `url`: string - -Authorizations --------------- -* `create_authorization( [scopes, note, note_url] )`: `Authorization` - * `scopes`: list of string - * `note`: string - * `note_url`: string - * `client_id`: string - * `client_secret`: string -* `get_authorization( id )`: `Authorization` - * `id`: integer -* `get_authorizations()`: `PaginatedList` of `Authorization` - -Emails ------- -* `add_to_emails( email, ... )` - * `email`: string -* `get_emails()`: list of string -* `remove_from_emails( email, ... )` - * `email`: string - -Events ------- -* `get_events()`: `PaginatedList` of `Event` -* `get_organization_events( org )`: `PaginatedList` of `Event` - * `org`: `Organization` - -Followers ---------- -* `get_followers()`: `PaginatedList` of `NamedUser` - -Following ---------- -* `add_to_following( following )` - * `following`: `NamedUser` -* `get_following()`: `PaginatedList` of `NamedUser` -* `has_in_following( following )`: bool - * `following`: `NamedUser` -* `remove_from_following( following )` - * `following`: `NamedUser` - -Forking -------- -* `create_fork( repo )`: `Repository` - * `repo`: `Repository` - -Gists ------ -* `create_gist( public, files, [description] )`: `Gist` - * `public`: bool - * `files`: dict of string to `InputFileContent` - * `description`: string -* `get_gists()`: `PaginatedList` of `Gist` -* `get_starred_gists()`: `PaginatedList` of `Gist` - -Issues ------- -* `get_issues()`: `PaginatedList` of `Issue` - -Keys ----- -* `create_key( title, key )`: `UserKey` - * `title`: string - * `key`: string -* `get_key( id )`: `UserKey` - * `id`: integer -* `get_keys()`: `PaginatedList` of `UserKey` - -Modification ------------- -* `edit( [name, email, blog, company, location, hireable, bio] )` - * `name`: string - * `email`: string - * `blog`: string - * `company`: string - * `location`: string - * `hireable`: bool - * `bio`: string - -Orgs ----- -* `get_orgs()`: `PaginatedList` of `Organization` - -Repos ------ -* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, auto_init, gitignore_template] )`: `Repository` - * `name`: string - * `description`: string - * `homepage`: string - * `private`: bool - * `has_issues`: bool - * `has_wiki`: bool - * `has_downloads`: bool - * `auto_init`: bool - * `gitignore_template`: string -* `get_repo( name )`: `Repository` - * `name`: string -* `get_repos( [type, sort, direction] )`: `PaginatedList` of `Repository` - * `type`: string - * `sort`: string - * `direction`: string - -Starred -------- -* `add_to_starred( starred )` - * `starred`: `Repository` -* `get_starred()`: `PaginatedList` of `Repository` -* `has_in_starred( starred )`: bool - * `starred`: `Repository` -* `remove_from_starred( starred )` - * `starred`: `Repository` - -Subscriptions -------------- -* `add_to_subscriptions( subscription )` - * `subscription`: `Repository` -* `get_subscriptions()`: `PaginatedList` of `Repository` -* `has_in_subscriptions( subscription )`: bool - * `subscription`: `Repository` -* `remove_from_subscriptions( subscription )` - * `subscription`: `Repository` - -Watched -------- -* `add_to_watched( watched )` - * `watched`: `Repository` -* `get_watched()`: `PaginatedList` of `Repository` -* `has_in_watched( watched )`: bool - * `watched`: `Repository` -* `remove_from_watched( watched )` - * `watched`: `Repository` - -Class `Authorization` -===================== - -Attributes ----------- -* `app`: `AuthorizationApplication` -* `created_at`: datetime.datetime -* `id`: integer -* `note`: string -* `note_url`: string -* `scopes`: list of string -* `token`: string -* `updated_at`: datetime.datetime -* `url`: string - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( [scopes, add_scopes, remove_scopes, note, note_url] )` - * `scopes`: list of string - * `add_scopes`: list of string - * `remove_scopes`: list of string - * `note`: string - * `note_url`: string - -Class `AuthorizationApplication` -================================ - -Attributes ----------- -* `name`: string -* `url`: string - -Class `Branch` -============== - -Attributes ----------- -* `commit`: `Commit` -* `name`: string - -Class `Commit` -============== - -Attributes ----------- -* `author`: `NamedUser` -* `commit`: `GitCommit` -* `committer`: `NamedUser` -* `files`: list of `File` -* `parents`: list of `Commit` -* `sha`: string -* `stats`: `CommitStats` -* `url`: string - -Comments --------- -* `create_comment( body, [line, path, position] )`: `CommitComment` - * `body`: string - * `line`: integer - * `path`: string - * `position`: integer -* `get_comments()`: `PaginatedList` of `CommitComment` - -Statuses --------- -* `create_status( state, [target_url, description] )`: `CommitStatus` - * `state`: string - * `target_url`: string - * `description`: string -* `get_statuses()`: `PaginatedList` of `CommitStatus` - -Class `CommitComment` -===================== - -Attributes ----------- -* `body`: string -* `commit_id`: string -* `created_at`: datetime.datetime -* `html_url`: string -* `id`: integer -* `line`: integer -* `path`: string -* `position`: integer -* `updated_at`: datetime.datetime -* `url`: string -* `user`: `NamedUser` - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( body )` - * `body`: string - -Class `CommitStats` -=================== - -Attributes ----------- -* `additions`: integer -* `deletions`: integer -* `total`: integer - -Class `CommitStatus` -==================== - -Attributes ----------- -* `created_at`: datetime.datetime -* `creator`: `NamedUser` -* `description`: string -* `id`: integer -* `state`: string -* `target_url`: string -* `updated_at`: datetime.datetime - -Class `Comparison` -================== - -Attributes ----------- -* `ahead_by`: integer -* `base_commit`: `Commit` -* `behind_by`: integer -* `commits`: list of `Commit` -* `diff_url`: string -* `files`: list of `File` -* `html_url`: string -* `patch_url`: string -* `permalink_url`: string -* `status`: string -* `total_commits`: integer -* `url`: string - -Class `ContentFile` -=================== - -Attributes ----------- -* `content`: string -* `encoding`: string -* `name`: string -* `path`: string -* `sha`: string -* `size`: integer -* `type`: string - -Class `Download` -================ - -Attributes ----------- -* `accesskeyid`: string -* `acl`: string -* `bucket`: string -* `content_type`: string -* `created_at`: datetime.datetime -* `description`: string -* `download_count`: integer -* `expirationdate`: datetime.datetime -* `html_url`: string -* `id`: integer -* `mime_type`: string -* `name`: string -* `path`: string -* `policy`: string -* `prefix`: string -* `redirect`: bool -* `s3_url`: string -* `signature`: string -* `size`: integer -* `url`: string - -Deletion --------- -* `delete()` - -Class `Event` -============= - -Attributes ----------- -* `actor`: `NamedUser` -* `created_at`: datetime.datetime -* `id`: string -* `org`: `Organization` -* `payload`: dict -* `public`: bool -* `repo`: `Repository` -* `type`: string - -Class `File` -============ - -Attributes ----------- -* `additions`: integer -* `blob_url`: string -* `changes`: integer -* `deletions`: integer -* `filename`: string -* `patch`: string -* `raw_url`: string -* `sha`: string -* `status`: string - -Class `Gist` -============ - -Attributes ----------- -* `comments`: integer -* `created_at`: datetime.datetime -* `description`: string -* `files`: dict of string to `GistFile` -* `fork_of`: `Gist` -* `forks`: list of `Gist` -* `git_pull_url`: string -* `git_push_url`: string -* `history`: list of `GistHistoryState` -* `html_url`: string -* `id`: string -* `public`: bool -* `updated_at`: datetime.datetime -* `url`: string -* `user`: `NamedUser` - -Comments --------- -* `create_comment( body )`: `GistComment` - * `body`: string -* `get_comment( id )`: `GistComment` - * `id`: integer -* `get_comments()`: `PaginatedList` of `GistComment` - -Deletion --------- -* `delete()` - -Forking -------- -* `create_fork()`: `Gist` - -Modification ------------- -* `edit( [description, files] )` - * `description`: string - * `files`: dict of string to `InputFileContent` - -Starring --------- -* `is_starred()`: bool -* `reset_starred()` -* `set_starred()` - -Class `GistComment` -=================== - -Attributes ----------- -* `body`: string -* `created_at`: datetime.datetime -* `id`: integer -* `updated_at`: datetime.datetime -* `url`: string -* `user`: `NamedUser` - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( body )` - * `body`: string - -Class `GistFile` -================ - -Attributes ----------- -* `content`: string -* `filename`: string -* `language`: string -* `raw_url`: string -* `size`: integer - -Class `GistHistoryState` -======================== - -Attributes ----------- -* `change_status`: `CommitStats` -* `committed_at`: datetime.datetime -* `url`: string -* `user`: `NamedUser` -* `version`: string - -Class `GitAuthor` -================= - -Attributes ----------- -* `date`: datetime.datetime -* `email`: string -* `name`: string - -Class `GitBlob` -=============== - -Attributes ----------- -* `content`: string -* `encoding`: string -* `sha`: string -* `size`: integer -* `url`: string - -Class `GitCommit` -================= - -Attributes ----------- -* `author`: `GitAuthor` -* `committer`: `GitAuthor` -* `message`: string -* `parents`: list of `GitCommit` -* `sha`: string -* `tree`: `GitTree` -* `url`: string - -Class `GitObject` -================= - -Attributes ----------- -* `sha`: string -* `type`: string -* `url`: string - -Class `GitignoreTemplate` -========================= - -Attributes ----------- -* `name`: string -* `source`: string - -Class `GitRef` -============== - -Attributes ----------- -* `object`: `GitObject` -* `ref`: string -* `url`: string - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( sha, [force] )` - * `sha`: string - * `force`: bool - -Class `GitTag` -============== - -Attributes ----------- -* `message`: string -* `object`: `GitObject` -* `sha`: string -* `tag`: string -* `tagger`: `GitAuthor` -* `url`: string - -Class `GitTree` -=============== - -Attributes ----------- -* `sha`: string -* `tree`: list of `GitTreeElement` -* `url`: string - -Class `GitTreeElement` -====================== - -Attributes ----------- -* `mode`: string -* `path`: string -* `sha`: string -* `size`: integer -* `type`: string -* `url`: string - -Class `Hook` -============ - -Attributes ----------- -* `active`: bool -* `config`: dict -* `created_at`: datetime.datetime -* `events`: list of string -* `id`: integer -* `last_response`: `HookResponse` -* `name`: string -* `updated_at`: datetime.datetime -* `url`: string - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( name, config, [events, add_events, remove_events, active] )` - * `name`: string - * `config`: dict - * `events`: list of string - * `add_events`: list of string - * `remove_events`: list of string - * `active`: bool - -Testing -------- -* `test()` - -Class `HookDescription` -======================= - -Attributes ----------- -* `events`: list of string -* `name`: string -* `schema`: list of list of string -* `supported_events`: list of string - -Class `HookResponse` -==================== - -Attributes ----------- -* `code`: integer -* `message`: string -* `status`: string - -Class `Issue` -============= - -Attributes ----------- -* `assignee`: `NamedUser` -* `body`: string -* `closed_at`: datetime.datetime -* `closed_by`: `NamedUser` -* `comments`: integer -* `created_at`: datetime.datetime -* `html_url`: string -* `id`: integer -* `labels`: list of `Label` -* `milestone`: `Milestone` -* `number`: integer -* `pull_request`: `IssuePullRequest` -* `repository`: `Repository` -* `state`: string -* `title`: string -* `updated_at`: datetime.datetime -* `url`: string -* `user`: `NamedUser` - -Comments --------- -* `create_comment( body )`: `IssueComment` - * `body`: string -* `get_comment( id )`: `IssueComment` - * `id`: integer -* `get_comments()`: `PaginatedList` of `IssueComment` - -Events ------- -* `get_events()`: `PaginatedList` of `IssueEvent` - -Labels ------- -* `add_to_labels( label, ... )` - * `label`: `Label` -* `delete_labels()` -* `get_labels()`: `PaginatedList` of `Label` -* `remove_from_labels( label )` - * `label`: `Label` -* `set_labels( label, ... )` - * `label`: `Label` - -Modification ------------- -* `edit( [title, body, assignee, state, milestone, labels] )` - * `title`: string - * `body`: string - * `assignee`: `NamedUser` or None - * `state`: string - * `milestone`: `Milestone` or None - * `labels`: list of string - -Class `IssueComment` -==================== - -Attributes ----------- -* `body`: string -* `created_at`: datetime.datetime -* `id`: integer -* `updated_at`: datetime.datetime -* `url`: string -* `user`: `NamedUser` - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( body )` - * `body`: string - -Class `IssueEvent` -================== - -Attributes ----------- -* `actor`: `NamedUser` -* `commit_id`: string -* `created_at`: datetime.datetime -* `event`: string -* `id`: integer -* `issue`: `Issue` -* `url`: string - -Class `IssuePullRequest` -======================== - -Attributes ----------- -* `diff_url`: string -* `html_url`: string -* `patch_url`: string - -Class `Label` -============= - -Attributes ----------- -* `color`: string -* `name`: string -* `url`: string - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( name, color )` - * `name`: string - * `color`: string - -Class `Milestone` -================= - -Attributes ----------- -* `closed_issues`: integer -* `created_at`: datetime.datetime -* `creator`: `NamedUser` -* `description`: string -* `due_on`: datetime.datetime -* `id`: integer -* `number`: integer -* `open_issues`: integer -* `state`: string -* `title`: string -* `url`: string - -Deletion --------- -* `delete()` - -Labels ------- -* `get_labels()`: `PaginatedList` of `Label` - -Modification ------------- -* `edit( title, [state, description, due_on] )` - * `title`: string - * `state`: string - * `description`: string - * `due_on`: date - -Class `NamedUser` -================= - -Attributes ----------- -* `avatar_url`: string -* `bio`: string -* `blog`: string -* `collaborators`: integer -* `company`: string -* `contributions`: integer -* `created_at`: datetime.datetime -* `disk_usage`: integer -* `email`: string -* `followers`: integer -* `following`: integer -* `gravatar_id`: string -* `hireable`: bool -* `html_url`: string -* `id`: integer -* `location`: string -* `login`: string -* `name`: string -* `owned_private_repos`: integer -* `plan`: `Plan` -* `private_gists`: integer -* `public_gists`: integer -* `public_repos`: integer -* `total_private_repos`: integer -* `type`: string -* `url`: string - -Events ------- -* `get_events()`: `PaginatedList` of `Event` -* `get_public_events()`: `PaginatedList` of `Event` -* `get_received_events()`: `PaginatedList` of `Event` -* `get_public_received_events()`: `PaginatedList` of `Event` - -Followers ---------- -* `get_followers()`: `PaginatedList` of `NamedUser` - -Following ---------- -* `get_following()`: `PaginatedList` of `NamedUser` - -Gists ------ -* `create_gist( public, files, [description] )`: `Gist` - * `public`: bool - * `files`: dict of string to `InputFileContent` - * `description`: string -* `get_gists()`: `PaginatedList` of `Gist` - -Orgs ----- -* `get_orgs()`: `PaginatedList` of `Organization` - -Repos ------ -* `get_repo( name )`: `Repository` - * `name`: string -* `get_repos( [type] )`: `PaginatedList` of `Repository` - * `type`: string - -Starred -------- -* `get_starred()`: `PaginatedList` of `Repository` - -Subscriptions -------------- -* `get_subscriptions()`: `PaginatedList` of `Repository` - -Watched -------- -* `get_watched()`: `PaginatedList` of `Repository` - -Class `Organization` -==================== - -Attributes ----------- -* `avatar_url`: string -* `billing_email`: string -* `blog`: string -* `collaborators`: integer -* `company`: string -* `created_at`: datetime.datetime -* `disk_usage`: integer -* `email`: string -* `followers`: integer -* `following`: integer -* `gravatar_id`: string -* `html_url`: string -* `id`: integer -* `location`: string -* `login`: string -* `name`: string -* `owned_private_repos`: integer -* `plan`: `Plan` -* `private_gists`: integer -* `public_gists`: integer -* `public_repos`: integer -* `total_private_repos`: integer -* `type`: string -* `url`: string - -Events ------- -* `get_events()`: `PaginatedList` of `Event` - -Forking -------- -* `create_fork( repo )`: `Repository` - * `repo`: `Repository` - -Members -------- -* `get_members()`: `PaginatedList` of `NamedUser` -* `has_in_members( member )`: bool - * `member`: `NamedUser` -* `remove_from_members( member )` - * `member`: `NamedUser` - -Modification ------------- -* `edit( [billing_email, blog, company, email, location, name] )` - * `billing_email`: string - * `blog`: string - * `company`: string - * `email`: string - * `location`: string - * `name`: string - -Public_members --------------- -* `add_to_public_members( public_member )` - * `public_member`: `NamedUser` -* `get_public_members()`: `PaginatedList` of `NamedUser` -* `has_in_public_members( public_member )`: bool - * `public_member`: `NamedUser` -* `remove_from_public_members( public_member )` - * `public_member`: `NamedUser` - -Repos ------ -* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id, auto_init, gitignore_template] )`: `Repository` - * `name`: string - * `description`: string - * `homepage`: string - * `private`: bool - * `has_issues`: bool - * `has_wiki`: bool - * `has_downloads`: bool - * `team_id`: `Team` - * `auto_init`: bool - * `gitignore_template`: string -* `get_repo( name )`: `Repository` - * `name`: string -* `get_repos( [type] )`: `PaginatedList` of `Repository` - * `type`: string - -Teams ------ -* `create_team( name, [repo_names, permission] )`: `Team` - * `name`: string - * `repo_names`: list of `Repository` - * `permission`: string -* `get_team( id )`: `Team` - * `id`: integer -* `get_teams()`: `PaginatedList` of `Team` - -Class `Permissions` -=================== - -Attributes ----------- -* `admin`: bool -* `pull`: bool -* `push`: bool - -Class `Plan` -============ - -Attributes ----------- -* `collaborators`: integer -* `name`: string -* `private_repos`: integer -* `space`: integer - -Class `PullRequest` -=================== - -Attributes ----------- -* `additions`: integer -* `assignee`: `NamedUser` -* `base`: `PullRequestPart` -* `body`: string -* `changed_files`: integer -* `closed_at`: datetime.datetime -* `comments`: integer -* `commits`: integer -* `created_at`: datetime.datetime -* `deletions`: integer -* `diff_url`: string -* `head`: `PullRequestPart` -* `html_url`: string -* `id`: integer -* `issue_url`: string -* `mergeable`: bool -* `merged`: bool -* `merged_at`: datetime.datetime -* `merged_by`: `NamedUser` -* `number`: integer -* `patch_url`: string -* `review_comments`: integer -* `state`: string -* `title`: string -* `updated_at`: datetime.datetime -* `url`: string -* `user`: `NamedUser` - -Review comments ---------------- -* `create_comment( body, commit_id, path, position )`: `PullRequestComment` - * `body`: string - * `commit_id`: `Commit` - * `path`: string - * `position`: integer -* `create_review_comment( body, commit_id, path, position )`: `PullRequestComment` - * `body`: string - * `commit_id`: `Commit` - * `path`: string - * `position`: integer -* `get_comment( id )`: `PullRequestComment` - * `id`: integer -* `get_review_comment( id )`: `PullRequestComment` - * `id`: integer -* `get_comments()`: `PaginatedList` of `PullRequestComment` -* `get_review_comments()`: `PaginatedList` of `PullRequestComment` - -Commits -------- -* `get_commits()`: `PaginatedList` of `Commit` - -Files ------ -* `get_files()`: `PaginatedList` of `File` - -Issue comments --------------- -* `create_issue_comment( body )`: `IssueComment` - * `body`: string -* `get_issue_comment( id )`: `IssueComment` - * `id`: integer -* `get_issue_comments()`: `PaginatedList` of `IssueComment` - -Merging -------- -* `is_merged()`: bool -* `merge( [commit_message] )`: `PullRequestMergeStatus` - * `commit_message`: string - -Modification ------------- -* `edit( [title, body, state] )` - * `title`: string - * `body`: string - * `state`: string - -Class `PullRequestComment` -========================== - -Attributes ----------- -* `body`: string -* `commit_id`: string -* `created_at`: datetime.datetime -* `id`: integer -* `original_commit_id`: string -* `original_position`: integer -* `path`: string -* `position`: integer -* `updated_at`: datetime.datetime -* `url`: string -* `user`: `NamedUser` - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( body )` - * `body`: string - -Class `PullRequestMergeStatus` -============================== - -Attributes ----------- -* `merged`: bool -* `message`: string -* `sha`: string - -Class `PullRequestPart` -======================= - -Attributes ----------- -* `label`: string -* `ref`: string -* `repo`: `Repository` -* `sha`: string -* `user`: `NamedUser` - -Class `Repository` -================== - -Attributes ----------- -* `clone_url`: string -* `created_at`: datetime.datetime -* `description`: string -* `fork`: bool -* `forks`: integer -* `full_name`: string -* `git_url`: string -* `has_downloads`: bool -* `has_issues`: bool -* `has_wiki`: bool -* `homepage`: string -* `html_url`: string -* `id`: integer -* `language`: string -* `master_branch`: string -* `name`: string -* `open_issues`: integer -* `organization`: `Organization` -* `owner`: `NamedUser` -* `parent`: `Repository` -* `permissions`: `Permissions` -* `private`: bool -* `pushed_at`: datetime.datetime -* `size`: integer -* `source`: `Repository` -* `ssh_url`: string -* `svn_url`: string -* `updated_at`: datetime.datetime -* `url`: string -* `watchers`: integer - -Comparison ----------- -* `compare( base, head )`: `Comparison` - * `base`: string - * `head`: string - -Assignees ---------- -* `get_assignees()`: `PaginatedList` of `NamedUser` -* `has_in_assignees( assignee )`: bool - * `assignee`: `NamedUser` - -Branches --------- -* `get_branch( branch )`: `Branch` - * `branch`: string -* `get_branches()`: `PaginatedList` of `Branch` - -Collaborators -------------- -* `add_to_collaborators( collaborator )` - * `collaborator`: `NamedUser` -* `get_collaborators()`: `PaginatedList` of `NamedUser` -* `has_in_collaborators( collaborator )`: bool - * `collaborator`: `NamedUser` -* `remove_from_collaborators( collaborator )` - * `collaborator`: `NamedUser` - -Comments --------- -* `get_comment( id )`: `CommitComment` - * `id`: integer -* `get_comments()`: `PaginatedList` of `CommitComment` -* `get_issues_comments([sort, direction, since])`: `PaginatedList` of `IssueComment` - * `sort`: string - * `direction`: string - * `since`: datetime.datetime -* `get_pulls_comments([sort, direction, since])`: `PaginatedList` of `PullRequestComment` - * `sort`: string - * `direction`: string - * `since`: datetime.datetime -* `get_pulls_review_comments([sort, direction, since])`: `PaginatedList` of `PullRequestComment` - * `sort`: string - * `direction`: string - * `since`: datetime.datetime - -Commits -------- -* `get_commit( sha )`: `Commit` - * `sha`: string -* `get_commits( [sha, path] )`: `PaginatedList` of `Commit` - * `sha`: string - * `path`: string - -Contents --------- -* `get_readme( [ref] )`: `ContentFile` - * `ref`: string -* `get_contents( path, [ref] )`: `ContentFile` - * `path`: string - * `ref`: string -* `get_archive_link( archive_format, [ref] )`: string - * `archive_format`: string - * `ref`: string - -Contributors ------------- -* `get_contributors()`: `PaginatedList` of `NamedUser` - -Deletion --------- -* `delete()` - -Downloads ---------- -* `create_download( name, size, [description, content_type] )`: `Download` - * `name`: string - * `size`: integer - * `description`: string - * `content_type`: string -* `get_download( id )`: `Download` - * `id`: integer -* `get_downloads()`: `PaginatedList` of `Download` - -Events ------- -* `get_events()`: `PaginatedList` of `Event` -* `get_network_events()`: `PaginatedList` of `Event` - -Forks ------ -* `get_forks()`: `PaginatedList` of `Repository` - -Git_blobs ---------- -* `create_git_blob( content, encoding )`: `GitBlob` - * `content`: string - * `encoding`: string -* `get_git_blob( sha )`: `GitBlob` - * `sha`: string - -Git_commits ------------ -* `create_git_commit( message, tree, parents, [author, committer] )`: `GitCommit` - * `message`: string - * `tree`: `GitTree` - * `parents`: list of `GitCommit` - * `author`: `InputGitAuthor` - * `committer`: `InputGitAuthor` -* `get_git_commit( sha )`: `GitCommit` - * `sha`: string - -Git_refs --------- -* `create_git_ref( ref, sha )`: `GitRef` - * `ref`: string - * `sha`: string -* `get_git_ref( ref )`: `GitRef` - * `ref`: string -* `get_git_refs()`: `PaginatedList` of `GitRef` - -Git_tags --------- -* `create_git_tag( tag, message, object, type, [tagger] )`: `GitTag` - * `tag`: string - * `message`: string - * `object`: string - * `type`: string - * `tagger`: `InputGitAuthor` -* `get_git_tag( sha )`: `GitTag` - * `sha`: string - -Git_trees ---------- -* `create_git_tree( tree, [base_tree] )`: `GitTree` - * `tree`: list of `InputGitTreeElement` - * `base_tree`: `GitTree` -* `get_git_tree( sha, [recursive] )`: `GitTree` - * `sha`: string - * `recursive`: bool - -Hooks ------ -* `create_hook( name, config, [events, active] )`: `Hook` - * `name`: string - * `config`: dict - * `events`: list of string - * `active`: bool -* `get_hook( id )`: `Hook` - * `id`: integer -* `get_hooks()`: `PaginatedList` of `Hook` - -Issues ------- -* `create_issue( title, [body, assignee, milestone, labels] )`: `Issue` - * `title`: string - * `body`: string - * `assignee`: `NamedUser` - * `milestone`: `Milestone` - * `labels`: list of `Label` -* `get_issue( number )`: `Issue` - * `number`: integer -* `get_issues( [milestone, state, assignee, mentioned, labels, sort, direction, since] )`: `PaginatedList` of `Issue` - * `milestone`: `Milestone` or "none" or "*" - * `state`: string - * `assignee`: `NamedUser` or "none" or "*" - * `mentioned`: `NamedUser` - * `labels`: list of `Label` - * `sort`: string - * `direction`: string - * `since`: datetime.datetime -* `legacy_search_issues( state, keyword )`: `PaginatedList` of `Issue` - * `state`: "open" or "closed" - * `keyword`: string - -Issues_events -------------- -* `get_issues_event( id )`: `IssueEvent` - * `id`: integer -* `get_issues_events()`: `PaginatedList` of `IssueEvent` - -Keys ----- -* `create_key( title, key )`: `RepositoryKey` - * `title`: string - * `key`: string -* `get_key( id )`: `RepositoryKey` - * `id`: integer -* `get_keys()`: `PaginatedList` of `RepositoryKey` - -Labels ------- -* `create_label( name, color )`: `Label` - * `name`: string - * `color`: string -* `get_label( name )`: `Label` - * `name`: string -* `get_labels()`: `PaginatedList` of `Label` - -Languages ---------- -* `get_languages()`: dict of string to integer - -Merging -------- -* `merge( base, head, [commit_message] )`: `Commit` - * `base`: string - * `head`: string - * `commit_message`: string - -Milestones ----------- -* `create_milestone( title, [state, description, due_on] )`: `Milestone` - * `title`: string - * `state`: string - * `description`: string - * `due_on`: date -* `get_milestone( number )`: `Milestone` - * `number`: integer -* `get_milestones( [state, sort, direction] )`: `PaginatedList` of `Milestone` - * `state`: string - * `sort`: string - * `direction`: string - -Modification ------------- -* `edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads, default_branch] )` - * `name`: string - * `description`: string - * `homepage`: string - * `public`: bool - * `has_issues`: bool - * `has_wiki`: bool - * `has_downloads`: bool - * `default_branch`: string - -Pulls ------ -* `create_pull( < title, body, base, head > or < issue, base, head > )`: `PullRequest` - * `title`: string - * `body`: string - * `issue`: `Issue` - * `base`: string - * `head`: string -* `get_pull( number )`: `PullRequest` - * `number`: integer -* `get_pulls( [state] )`: `PaginatedList` of `PullRequest` - * `state`: string - -Stargazers ----------- -* `get_stargazers()`: `PaginatedList` of `NamedUser` - -Subscribers ------------ -* `get_subscribers()`: `PaginatedList` of `NamedUser` - -Tags ----- -* `get_tags()`: `PaginatedList` of `Tag` - -Teams ------ -* `get_teams()`: `PaginatedList` of `Team` - -Watchers --------- -* `get_watchers()`: `PaginatedList` of `NamedUser` - -Class `RepositoryKey` -===================== - -Attributes ----------- -* `id`: integer -* `key`: string -* `title`: string -* `url`: string -* `verified`: bool - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( [title, key] )` - * `title`: string - * `key`: string - -Class `Tag` -=========== - -Attributes ----------- -* `commit`: `Commit` -* `name`: string -* `tarball_url`: string -* `zipball_url`: string - -Class `Team` -============ - -Attributes ----------- -* `id`: integer -* `members_count`: integer -* `name`: string -* `permission`: string -* `repos_count`: integer -* `url`: string - -Deletion --------- -* `delete()` - -Members -------- -* `add_to_members( member )` - * `member`: `NamedUser` -* `get_members()`: `PaginatedList` of `NamedUser` -* `has_in_members( member )`: bool - * `member`: `NamedUser` -* `remove_from_members( member )` - * `member`: `NamedUser` - -Modification ------------- -* `edit( name, [permission] )` - * `name`: string - * `permission`: string - -Repos ------ -* `add_to_repos( repo )` - * `repo`: `Repository` -* `get_repos()`: `PaginatedList` of `Repository` -* `has_in_repos( repo )`: bool - * `repo`: `Repository` -* `remove_from_repos( repo )` - * `repo`: `Repository` - -Class `UserKey` -=============== - -Attributes ----------- -* `id`: integer -* `key`: string -* `title`: string -* `url`: string -* `verified`: bool - -Deletion --------- -* `delete()` - -Modification ------------- -* `edit( [title, key] )` - * `title`: string - * `key`: string diff --git a/doc/conf.py b/doc/conf.py index 0a74614a..bf1e0ee0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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") diff --git a/doc/github_objects.rst b/doc/github_objects.rst deleted file mode 100644 index 498def97..00000000 --- a/doc/github_objects.rst +++ /dev/null @@ -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 diff --git a/doc/github_objects/.gitignore b/doc/github_objects/.gitignore new file mode 100644 index 00000000..30d85567 --- /dev/null +++ b/doc/github_objects/.gitignore @@ -0,0 +1 @@ +*.rst diff --git a/doc/github_objects/AuthenticatedUser.rst b/doc/github_objects/AuthenticatedUser.rst deleted file mode 100644 index 0ac14ac6..00000000 --- a/doc/github_objects/AuthenticatedUser.rst +++ /dev/null @@ -1,4 +0,0 @@ -AuthenticatedUser -================= - -.. autoclass:: github.AuthenticatedUser.AuthenticatedUser() diff --git a/doc/github_objects/Authorization.rst b/doc/github_objects/Authorization.rst deleted file mode 100644 index dbcc1054..00000000 --- a/doc/github_objects/Authorization.rst +++ /dev/null @@ -1,4 +0,0 @@ -Authorization -============= - -.. autoclass:: github.Authorization.Authorization() diff --git a/doc/github_objects/AuthorizationApplication.rst b/doc/github_objects/AuthorizationApplication.rst deleted file mode 100644 index 72011674..00000000 --- a/doc/github_objects/AuthorizationApplication.rst +++ /dev/null @@ -1,4 +0,0 @@ -AuthorizationApplication -======================== - -.. autoclass:: github.AuthorizationApplication.AuthorizationApplication() diff --git a/doc/github_objects/Branch.rst b/doc/github_objects/Branch.rst deleted file mode 100644 index a680f83d..00000000 --- a/doc/github_objects/Branch.rst +++ /dev/null @@ -1,4 +0,0 @@ -Branch -====== - -.. autoclass:: github.Branch.Branch() diff --git a/doc/github_objects/Commit.rst b/doc/github_objects/Commit.rst deleted file mode 100644 index 4778d154..00000000 --- a/doc/github_objects/Commit.rst +++ /dev/null @@ -1,4 +0,0 @@ -Commit -====== - -.. autoclass:: github.Commit.Commit() diff --git a/doc/github_objects/CommitComment.rst b/doc/github_objects/CommitComment.rst deleted file mode 100644 index 752b204e..00000000 --- a/doc/github_objects/CommitComment.rst +++ /dev/null @@ -1,4 +0,0 @@ -CommitComment -============= - -.. autoclass:: github.CommitComment.CommitComment() diff --git a/doc/github_objects/CommitStats.rst b/doc/github_objects/CommitStats.rst deleted file mode 100644 index 1b3a6863..00000000 --- a/doc/github_objects/CommitStats.rst +++ /dev/null @@ -1,4 +0,0 @@ -CommitStats -=========== - -.. autoclass:: github.CommitStats.CommitStats() diff --git a/doc/github_objects/CommitStatus.rst b/doc/github_objects/CommitStatus.rst deleted file mode 100644 index 5357f9af..00000000 --- a/doc/github_objects/CommitStatus.rst +++ /dev/null @@ -1,4 +0,0 @@ -CommitStatus -============ - -.. autoclass:: github.CommitStatus.CommitStatus() diff --git a/doc/github_objects/Comparison.rst b/doc/github_objects/Comparison.rst deleted file mode 100644 index 387193a1..00000000 --- a/doc/github_objects/Comparison.rst +++ /dev/null @@ -1,4 +0,0 @@ -Comparison -========== - -.. autoclass:: github.Comparison.Comparison() diff --git a/doc/github_objects/ContentFile.rst b/doc/github_objects/ContentFile.rst deleted file mode 100644 index 99abc5ac..00000000 --- a/doc/github_objects/ContentFile.rst +++ /dev/null @@ -1,4 +0,0 @@ -ContentFile -=========== - -.. autoclass:: github.ContentFile.ContentFile() diff --git a/doc/github_objects/Download.rst b/doc/github_objects/Download.rst deleted file mode 100644 index 12105e50..00000000 --- a/doc/github_objects/Download.rst +++ /dev/null @@ -1,4 +0,0 @@ -Download -======== - -.. autoclass:: github.Download.Download() diff --git a/doc/github_objects/Event.rst b/doc/github_objects/Event.rst deleted file mode 100644 index 7580a3e1..00000000 --- a/doc/github_objects/Event.rst +++ /dev/null @@ -1,4 +0,0 @@ -Event -===== - -.. autoclass:: github.Event.Event() diff --git a/doc/github_objects/File.rst b/doc/github_objects/File.rst deleted file mode 100644 index 56f36480..00000000 --- a/doc/github_objects/File.rst +++ /dev/null @@ -1,4 +0,0 @@ -File -==== - -.. autoclass:: github.File.File() diff --git a/doc/github_objects/Gist.rst b/doc/github_objects/Gist.rst deleted file mode 100644 index 6873968a..00000000 --- a/doc/github_objects/Gist.rst +++ /dev/null @@ -1,4 +0,0 @@ -Gist -==== - -.. autoclass:: github.Gist.Gist() diff --git a/doc/github_objects/GistComment.rst b/doc/github_objects/GistComment.rst deleted file mode 100644 index f1b739eb..00000000 --- a/doc/github_objects/GistComment.rst +++ /dev/null @@ -1,4 +0,0 @@ -GistComment -=========== - -.. autoclass:: github.GistComment.GistComment() diff --git a/doc/github_objects/GistFile.rst b/doc/github_objects/GistFile.rst deleted file mode 100644 index 17ec2487..00000000 --- a/doc/github_objects/GistFile.rst +++ /dev/null @@ -1,4 +0,0 @@ -GistFile -======== - -.. autoclass:: github.GistFile.GistFile() diff --git a/doc/github_objects/GistHistoryState.rst b/doc/github_objects/GistHistoryState.rst deleted file mode 100644 index 4d615107..00000000 --- a/doc/github_objects/GistHistoryState.rst +++ /dev/null @@ -1,4 +0,0 @@ -GistHistoryState -================ - -.. autoclass:: github.GistHistoryState.GistHistoryState() diff --git a/doc/github_objects/GitAuthor.rst b/doc/github_objects/GitAuthor.rst deleted file mode 100644 index 238a2b15..00000000 --- a/doc/github_objects/GitAuthor.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitAuthor -========= - -.. autoclass:: github.GitAuthor.GitAuthor() diff --git a/doc/github_objects/GitBlob.rst b/doc/github_objects/GitBlob.rst deleted file mode 100644 index 8c883f11..00000000 --- a/doc/github_objects/GitBlob.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitBlob -======= - -.. autoclass:: github.GitBlob.GitBlob() diff --git a/doc/github_objects/GitCommit.rst b/doc/github_objects/GitCommit.rst deleted file mode 100644 index 56fbc557..00000000 --- a/doc/github_objects/GitCommit.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitCommit -========= - -.. autoclass:: github.GitCommit.GitCommit() diff --git a/doc/github_objects/GitObject.rst b/doc/github_objects/GitObject.rst deleted file mode 100644 index 903ed56a..00000000 --- a/doc/github_objects/GitObject.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitObject -========= - -.. autoclass:: github.GitObject.GitObject() diff --git a/doc/github_objects/GitRef.rst b/doc/github_objects/GitRef.rst deleted file mode 100644 index ba134099..00000000 --- a/doc/github_objects/GitRef.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitRef -====== - -.. autoclass:: github.GitRef.GitRef() diff --git a/doc/github_objects/GitTag.rst b/doc/github_objects/GitTag.rst deleted file mode 100644 index bb5eb8f5..00000000 --- a/doc/github_objects/GitTag.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitTag -====== - -.. autoclass:: github.GitTag.GitTag() diff --git a/doc/github_objects/GitTree.rst b/doc/github_objects/GitTree.rst deleted file mode 100644 index b7137126..00000000 --- a/doc/github_objects/GitTree.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitTree -======= - -.. autoclass:: github.GitTree.GitTree() diff --git a/doc/github_objects/GitTreeElement.rst b/doc/github_objects/GitTreeElement.rst deleted file mode 100644 index 346c6668..00000000 --- a/doc/github_objects/GitTreeElement.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitTreeElement -============== - -.. autoclass:: github.GitTreeElement.GitTreeElement() diff --git a/doc/github_objects/GitignoreTemplate.rst b/doc/github_objects/GitignoreTemplate.rst deleted file mode 100644 index 8b1da472..00000000 --- a/doc/github_objects/GitignoreTemplate.rst +++ /dev/null @@ -1,4 +0,0 @@ -GitignoreTemplate -================= - -.. autoclass:: github.GitignoreTemplate.GitignoreTemplate() diff --git a/doc/github_objects/Hook.rst b/doc/github_objects/Hook.rst deleted file mode 100644 index 08ecada6..00000000 --- a/doc/github_objects/Hook.rst +++ /dev/null @@ -1,4 +0,0 @@ -Hook -==== - -.. autoclass:: github.Hook.Hook() diff --git a/doc/github_objects/HookDescription.rst b/doc/github_objects/HookDescription.rst deleted file mode 100644 index 29acd7c2..00000000 --- a/doc/github_objects/HookDescription.rst +++ /dev/null @@ -1,4 +0,0 @@ -HookDescription -=============== - -.. autoclass:: github.HookDescription.HookDescription() diff --git a/doc/github_objects/HookResponse.rst b/doc/github_objects/HookResponse.rst deleted file mode 100644 index a042aa98..00000000 --- a/doc/github_objects/HookResponse.rst +++ /dev/null @@ -1,4 +0,0 @@ -HookResponse -============ - -.. autoclass:: github.HookResponse.HookResponse() diff --git a/doc/github_objects/Issue.rst b/doc/github_objects/Issue.rst deleted file mode 100644 index 28a36690..00000000 --- a/doc/github_objects/Issue.rst +++ /dev/null @@ -1,4 +0,0 @@ -Issue -===== - -.. autoclass:: github.Issue.Issue() diff --git a/doc/github_objects/IssueComment.rst b/doc/github_objects/IssueComment.rst deleted file mode 100644 index ab769381..00000000 --- a/doc/github_objects/IssueComment.rst +++ /dev/null @@ -1,4 +0,0 @@ -IssueComment -============ - -.. autoclass:: github.IssueComment.IssueComment() diff --git a/doc/github_objects/IssueEvent.rst b/doc/github_objects/IssueEvent.rst deleted file mode 100644 index 1bcd17a5..00000000 --- a/doc/github_objects/IssueEvent.rst +++ /dev/null @@ -1,4 +0,0 @@ -IssueEvent -========== - -.. autoclass:: github.IssueEvent.IssueEvent() diff --git a/doc/github_objects/IssuePullRequest.rst b/doc/github_objects/IssuePullRequest.rst deleted file mode 100644 index 169daffc..00000000 --- a/doc/github_objects/IssuePullRequest.rst +++ /dev/null @@ -1,4 +0,0 @@ -IssuePullRequest -================ - -.. autoclass:: github.IssuePullRequest.IssuePullRequest() diff --git a/doc/github_objects/Label.rst b/doc/github_objects/Label.rst deleted file mode 100644 index 54514d54..00000000 --- a/doc/github_objects/Label.rst +++ /dev/null @@ -1,4 +0,0 @@ -Label -===== - -.. autoclass:: github.Label.Label() diff --git a/doc/github_objects/Milestone.rst b/doc/github_objects/Milestone.rst deleted file mode 100644 index cb5daeff..00000000 --- a/doc/github_objects/Milestone.rst +++ /dev/null @@ -1,4 +0,0 @@ -Milestone -========= - -.. autoclass:: github.Milestone.Milestone() diff --git a/doc/github_objects/NamedUser.rst b/doc/github_objects/NamedUser.rst deleted file mode 100644 index c6eb0d19..00000000 --- a/doc/github_objects/NamedUser.rst +++ /dev/null @@ -1,4 +0,0 @@ -NamedUser -========= - -.. autoclass:: github.NamedUser.NamedUser() diff --git a/doc/github_objects/Organization.rst b/doc/github_objects/Organization.rst deleted file mode 100644 index fee7d4f8..00000000 --- a/doc/github_objects/Organization.rst +++ /dev/null @@ -1,4 +0,0 @@ -Organization -============ - -.. autoclass:: github.Organization.Organization() diff --git a/doc/github_objects/Permissions.rst b/doc/github_objects/Permissions.rst deleted file mode 100644 index 21f630f1..00000000 --- a/doc/github_objects/Permissions.rst +++ /dev/null @@ -1,4 +0,0 @@ -Permissions -=========== - -.. autoclass:: github.Permissions.Permissions() diff --git a/doc/github_objects/Plan.rst b/doc/github_objects/Plan.rst deleted file mode 100644 index 2087244b..00000000 --- a/doc/github_objects/Plan.rst +++ /dev/null @@ -1,4 +0,0 @@ -Plan -==== - -.. autoclass:: github.Plan.Plan() diff --git a/doc/github_objects/PullRequest.rst b/doc/github_objects/PullRequest.rst deleted file mode 100644 index 98b917b3..00000000 --- a/doc/github_objects/PullRequest.rst +++ /dev/null @@ -1,4 +0,0 @@ -PullRequest -=========== - -.. autoclass:: github.PullRequest.PullRequest() diff --git a/doc/github_objects/PullRequestComment.rst b/doc/github_objects/PullRequestComment.rst deleted file mode 100644 index 0216b6e6..00000000 --- a/doc/github_objects/PullRequestComment.rst +++ /dev/null @@ -1,4 +0,0 @@ -PullRequestComment -================== - -.. autoclass:: github.PullRequestComment.PullRequestComment() diff --git a/doc/github_objects/PullRequestMergeStatus.rst b/doc/github_objects/PullRequestMergeStatus.rst deleted file mode 100644 index bd6424e5..00000000 --- a/doc/github_objects/PullRequestMergeStatus.rst +++ /dev/null @@ -1,4 +0,0 @@ -PullRequestMergeStatus -====================== - -.. autoclass:: github.PullRequestMergeStatus.PullRequestMergeStatus() diff --git a/doc/github_objects/PullRequestPart.rst b/doc/github_objects/PullRequestPart.rst deleted file mode 100644 index e84e544e..00000000 --- a/doc/github_objects/PullRequestPart.rst +++ /dev/null @@ -1,4 +0,0 @@ -PullRequestPart -=============== - -.. autoclass:: github.PullRequestPart.PullRequestPart() diff --git a/doc/github_objects/Repository.rst b/doc/github_objects/Repository.rst deleted file mode 100644 index 46af45d0..00000000 --- a/doc/github_objects/Repository.rst +++ /dev/null @@ -1,4 +0,0 @@ -Repository -========== - -.. autoclass:: github.Repository.Repository() diff --git a/doc/github_objects/RepositoryKey.rst b/doc/github_objects/RepositoryKey.rst deleted file mode 100644 index 5c4bfd45..00000000 --- a/doc/github_objects/RepositoryKey.rst +++ /dev/null @@ -1,4 +0,0 @@ -RepositoryKey -============= - -.. autoclass:: github.RepositoryKey.RepositoryKey() diff --git a/doc/github_objects/Tag.rst b/doc/github_objects/Tag.rst deleted file mode 100644 index 698ebf1a..00000000 --- a/doc/github_objects/Tag.rst +++ /dev/null @@ -1,4 +0,0 @@ -Tag -=== - -.. autoclass:: github.Tag.Tag() diff --git a/doc/github_objects/Team.rst b/doc/github_objects/Team.rst deleted file mode 100644 index 848990c2..00000000 --- a/doc/github_objects/Team.rst +++ /dev/null @@ -1,4 +0,0 @@ -Team -==== - -.. autoclass:: github.Team.Team() diff --git a/doc/github_objects/UserKey.rst b/doc/github_objects/UserKey.rst deleted file mode 100644 index e1e51f9d..00000000 --- a/doc/github_objects/UserKey.rst +++ /dev/null @@ -1,4 +0,0 @@ -UserKey -======= - -.. autoclass:: github.UserKey.UserKey() diff --git a/generateDocstrings.py b/generateDocstrings.py deleted file mode 100755 index 61ceeac9..00000000 --- a/generateDocstrings.py +++ /dev/null @@ -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 + " `_", - # ":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() diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index b726900e..d5999548 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :param watched: :class:`github.Repository.Repository` + :rtype: None + """ assert isinstance(watched, github.Repository.Repository), watched headers, data = self._requester.requestAndCheck( "DELETE", diff --git a/github/Authorization.py b/github/Authorization.py index e6876565..dd273132 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -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 `_ + :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 `_ + :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 diff --git a/github/AuthorizationApplication.py b/github/AuthorizationApplication.py index 15326561..ec98ffb2 100644 --- a/github/AuthorizationApplication.py +++ b/github/AuthorizationApplication.py @@ -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) diff --git a/github/Branch.py b/github/Branch.py index c843d54e..d6a19252 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -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): diff --git a/github/Commit.py b/github/Commit.py index 6998596e..c7f90009 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -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 `_ + :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 `_ + :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 `_ + :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 `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitStatus.CommitStatus` + """ return github.PaginatedList.PaginatedList( github.CommitStatus.CommitStatus, self._requester, diff --git a/github/CommitComment.py b/github/CommitComment.py index f5d93c72..bb377ded 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -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 `_ + :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 `_ + :param body: string + :rtype: None + """ assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, diff --git a/github/CommitStats.py b/github/CommitStats.py index 7740614b..3089ed99 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -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): diff --git a/github/CommitStatus.py b/github/CommitStatus.py index 29b7e43b..a033c7e2 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -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): diff --git a/github/Comparison.py b/github/Comparison.py index 8fe9771e..d21c68a3 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -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) diff --git a/github/ContentFile.py b/github/ContentFile.py index 4f43188c..8799b6ea 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -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): diff --git a/github/Download.py b/github/Download.py index 6e172a1e..8e9d8a59 100644 --- a/github/Download.py +++ b/github/Download.py @@ -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 `_ + :rtype: None + """ headers, data = self._requester.requestAndCheck( "DELETE", self.url, diff --git a/github/Event.py b/github/Event.py index 238907d2..6b0b73dc 100644 --- a/github/Event.py +++ b/github/Event.py @@ -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): diff --git a/github/File.py b/github/File.py index f01f0183..1c58862a 100644 --- a/github/File.py +++ b/github/File.py @@ -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): diff --git a/github/Gist.py b/github/Gist.py index cdf7339a..5758da03 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :rtype: None + """ headers, data = self._requester.requestAndCheck( "PUT", self.url + "/star", diff --git a/github/GistComment.py b/github/GistComment.py index 1d0a573c..d20d3a16 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -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 `_ + :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 `_ + :param body: string + :rtype: None + """ assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, diff --git a/github/GistFile.py b/github/GistFile.py index 4e2fb323..c014ead8 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -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): diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 89c8349e..5bf0f11f 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -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) diff --git a/github/GitAuthor.py b/github/GitAuthor.py index fe378303..78a7553d 100644 --- a/github/GitAuthor.py +++ b/github/GitAuthor.py @@ -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): diff --git a/github/GitBlob.py b/github/GitBlob.py index bd5a304f..86daaa33 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -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) diff --git a/github/GitCommit.py b/github/GitCommit.py index 3e3afe88..f9c33f7d 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -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) diff --git a/github/GitObject.py b/github/GitObject.py index e5a2db27..50d7bad0 100644 --- a/github/GitObject.py +++ b/github/GitObject.py @@ -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): diff --git a/github/GitRef.py b/github/GitRef.py index ce6a0904..39788a36 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -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 `_ + :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 `_ + :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 = { diff --git a/github/GitTag.py b/github/GitTag.py index fa16597e..6d22500c 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -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) diff --git a/github/GitTree.py b/github/GitTree.py index 926776f9..4f8bb50c 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -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) diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index d2ec2027..fbabe7a7 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -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): diff --git a/github/Github.py b/github/Github.py index 15214d40..6933692a 100644 --- a/github/Github.py +++ b/github/Github.py @@ -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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :rtype: :class:`github.GitignoreTemplate.GitignoreTemplate` + """ assert isinstance(name, (str, unicode)), name headers, attributes = self.__requester.requestAndCheck( "GET", diff --git a/github/GithubException.py b/github/GithubException.py index 11b615a5..feb2e2b2 100644 --- a/github/GithubException.py +++ b/github/GithubException.py @@ -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 diff --git a/github/GitignoreTemplate.py b/github/GitignoreTemplate.py index b683b913..c9edea37 100644 --- a/github/GitignoreTemplate.py +++ b/github/GitignoreTemplate.py @@ -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): diff --git a/github/Hook.py b/github/Hook.py index a1faccb1..68f3bb8a 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -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 `_ + :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 `_ + :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 `_ + :rtype: None + """ headers, data = self._requester.requestAndCheck( "POST", self.url + "/test", diff --git a/github/HookDescription.py b/github/HookDescription.py index 68fd4269..c13df687 100644 --- a/github/HookDescription.py +++ b/github/HookDescription.py @@ -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): diff --git a/github/HookResponse.py b/github/HookResponse.py index 3554c481..552538b8 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -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): diff --git a/github/InputFileContent.py b/github/InputFileContent.py index 035ecbf3..88aade39 100644 --- a/github/InputFileContent.py +++ b/github/InputFileContent.py @@ -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 diff --git a/github/InputGitAuthor.py b/github/InputGitAuthor.py index 3f3da182..dbf6b390 100644 --- a/github/InputGitAuthor.py +++ b/github/InputGitAuthor.py @@ -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 diff --git a/github/InputGitTreeElement.py b/github/InputGitTreeElement.py index 36436928..4b211e23 100644 --- a/github/InputGitTreeElement.py +++ b/github/InputGitTreeElement.py @@ -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 diff --git a/github/Issue.py b/github/Issue.py index c502f30e..ba788be1 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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( diff --git a/github/IssueComment.py b/github/IssueComment.py index aab643a4..2dbd24c6 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -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 `_ + :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 `_ + :param body: string + :rtype: None + """ assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 08992044..a6d7d57a 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -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) diff --git a/github/IssuePullRequest.py b/github/IssuePullRequest.py index 3ca15e69..8c29f2e7 100644 --- a/github/IssuePullRequest.py +++ b/github/IssuePullRequest.py @@ -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): diff --git a/github/Label.py b/github/Label.py index 5e5410ee..0e71bd95 100644 --- a/github/Label.py +++ b/github/Label.py @@ -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 `_ + :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 `_ + :param name: string + :param color: string + :rtype: None + """ assert isinstance(name, (str, unicode)), name assert isinstance(color, (str, unicode)), color post_parameters = { diff --git a/github/Milestone.py b/github/Milestone.py index e646a225..7f269222 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -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 `_ + :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 `_ + :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 `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Label.Label` + """ return github.PaginatedList.PaginatedList( github.Label.Label, self._requester, diff --git a/github/NamedUser.py b/github/NamedUser.py index 15df5907..74958096 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` + """ return github.PaginatedList.PaginatedList( github.Repository.Repository, self._requester, diff --git a/github/Organization.py b/github/Organization.py index c6aadb54..27bb9e0d 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :param public_member: :class:`github.NamedUser.NamedUser` + :rtype: None + """ assert isinstance(public_member, github.NamedUser.NamedUser), public_member headers, data = self._requester.requestAndCheck( "DELETE", diff --git a/github/Permissions.py b/github/Permissions.py index 32df3015..64986f3c 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -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): diff --git a/github/Plan.py b/github/Plan.py index 4d4764a2..18a17fc0 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -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): diff --git a/github/PullRequest.py b/github/PullRequest.py index 0799aa64..f28b0d00 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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 `_ + :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: diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index dbbb95b7..a59c8ad8 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -19,62 +19,103 @@ import github.NamedUser class PullRequestComment(github.GithubObject.GithubObject): + """ + This class represents PullRequestComments 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 id(self): + """ + :type: integer + """ self._completeIfNotSet(self._id) return self._NoneIfNotSet(self._id) @property def original_commit_id(self): + """ + :type: string + """ self._completeIfNotSet(self._original_commit_id) return self._NoneIfNotSet(self._original_commit_id) @property def original_position(self): + """ + :type: integer + """ self._completeIfNotSet(self._original_position) return self._NoneIfNotSet(self._original_position) @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/pulls/comments/:number `_ + :rtype: None + """ headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -83,6 +124,11 @@ class PullRequestComment(github.GithubObject.GithubObject): ) def edit(self, body): + """ + :calls: `PATCH /repos/:user/:repo/pulls/comments/:number `_ + :param body: string + :rtype: None + """ assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, diff --git a/github/PullRequestMergeStatus.py b/github/PullRequestMergeStatus.py index 4e2a6eb8..d06566ab 100644 --- a/github/PullRequestMergeStatus.py +++ b/github/PullRequestMergeStatus.py @@ -17,16 +17,29 @@ import github.GithubObject class PullRequestMergeStatus(github.GithubObject.BasicGithubObject): + """ + This class represents PullRequestMergeStatuss as returned for example by http://developer.github.com/v3/todo + """ + @property def merged(self): + """ + :type: bool + """ return self._NoneIfNotSet(self._merged) @property def message(self): + """ + :type: string + """ return self._NoneIfNotSet(self._message) @property def sha(self): + """ + :type: string + """ return self._NoneIfNotSet(self._sha) def _initAttributes(self): diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 10d1be55..ce9a851d 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -20,24 +20,43 @@ import github.NamedUser class PullRequestPart(github.GithubObject.BasicGithubObject): + """ + This class represents PullRequestParts as returned for example by http://developer.github.com/v3/todo + """ + @property def label(self): + """ + :type: string + """ return self._NoneIfNotSet(self._label) @property def ref(self): + """ + :type: string + """ return self._NoneIfNotSet(self._ref) @property def repo(self): + """ + :type: :class:`github.Repository.Repository` + """ return self._NoneIfNotSet(self._repo) @property def sha(self): + """ + :type: string + """ return self._NoneIfNotSet(self._sha) @property def user(self): + """ + :type: :class:`github.NamedUser.NamedUser` + """ return self._NoneIfNotSet(self._user) def _initAttributes(self): diff --git a/github/Repository.py b/github/Repository.py index 3f2add20..c5579bd2 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -48,157 +48,256 @@ import github.Legacy class Repository(github.GithubObject.GithubObject): + """ + This class represents Repositorys as returned for example by http://developer.github.com/v3/todo + """ + @property def clone_url(self): + """ + :type: string + """ self._completeIfNotSet(self._clone_url) return self._NoneIfNotSet(self._clone_url) @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 fork(self): + """ + :type: bool + """ self._completeIfNotSet(self._fork) return self._NoneIfNotSet(self._fork) @property def forks(self): + """ + :type: integer + """ self._completeIfNotSet(self._forks) return self._NoneIfNotSet(self._forks) @property def full_name(self): + """ + :type: string + """ self._completeIfNotSet(self._full_name) return self._NoneIfNotSet(self._full_name) @property def git_url(self): + """ + :type: string + """ self._completeIfNotSet(self._git_url) return self._NoneIfNotSet(self._git_url) @property def has_downloads(self): + """ + :type: bool + """ self._completeIfNotSet(self._has_downloads) return self._NoneIfNotSet(self._has_downloads) @property def has_issues(self): + """ + :type: bool + """ self._completeIfNotSet(self._has_issues) return self._NoneIfNotSet(self._has_issues) @property def has_wiki(self): + """ + :type: bool + """ self._completeIfNotSet(self._has_wiki) return self._NoneIfNotSet(self._has_wiki) @property def homepage(self): + """ + :type: string + """ self._completeIfNotSet(self._homepage) return self._NoneIfNotSet(self._homepage) @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 language(self): + """ + :type: string + """ self._completeIfNotSet(self._language) return self._NoneIfNotSet(self._language) @property def master_branch(self): + """ + :type: string + """ self._completeIfNotSet(self._master_branch) return self._NoneIfNotSet(self._master_branch) @property def name(self): + """ + :type: string + """ self._completeIfNotSet(self._name) return self._NoneIfNotSet(self._name) @property def open_issues(self): + """ + :type: integer + """ self._completeIfNotSet(self._open_issues) return self._NoneIfNotSet(self._open_issues) @property def organization(self): + """ + :type: :class:`github.Organization.Organization` + """ self._completeIfNotSet(self._organization) return self._NoneIfNotSet(self._organization) @property def owner(self): + """ + :type: :class:`github.NamedUser.NamedUser` + """ self._completeIfNotSet(self._owner) return self._NoneIfNotSet(self._owner) @property def parent(self): + """ + :type: :class:`github.Repository.Repository` + """ self._completeIfNotSet(self._parent) return self._NoneIfNotSet(self._parent) @property def permissions(self): + """ + :type: :class:`github.Permissions.Permissions` + """ self._completeIfNotSet(self._permissions) return self._NoneIfNotSet(self._permissions) @property def private(self): + """ + :type: bool + """ self._completeIfNotSet(self._private) return self._NoneIfNotSet(self._private) @property def pushed_at(self): + """ + :type: datetime.datetime + """ self._completeIfNotSet(self._pushed_at) return self._NoneIfNotSet(self._pushed_at) @property def size(self): + """ + :type: integer + """ self._completeIfNotSet(self._size) return self._NoneIfNotSet(self._size) @property def source(self): + """ + :type: :class:`github.Repository.Repository` + """ self._completeIfNotSet(self._source) return self._NoneIfNotSet(self._source) @property def ssh_url(self): + """ + :type: string + """ self._completeIfNotSet(self._ssh_url) return self._NoneIfNotSet(self._ssh_url) @property def svn_url(self): + """ + :type: string + """ self._completeIfNotSet(self._svn_url) return self._NoneIfNotSet(self._svn_url) @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 watchers(self): + """ + :type: integer + """ self._completeIfNotSet(self._watchers) return self._NoneIfNotSet(self._watchers) def add_to_collaborators(self, collaborator): + """ + :calls: `PUT /repos/:user/:repo/collaborators/:user `_ + :param collaborator: :class:`github.NamedUser.NamedUser` + :rtype: None + """ assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator headers, data = self._requester.requestAndCheck( "PUT", @@ -208,6 +307,12 @@ class Repository(github.GithubObject.GithubObject): ) def compare(self, base, head): + """ + :calls: `GET /repos/:user/:repo/compare/:base...:head `_ + :param base: string + :param head: string + :rtype: :class:`github.Comparison.Comparison` + """ assert isinstance(base, (str, unicode)), base assert isinstance(head, (str, unicode)), head headers, data = self._requester.requestAndCheck( @@ -219,6 +324,14 @@ class Repository(github.GithubObject.GithubObject): return github.Comparison.Comparison(self._requester, data, completed=True) def create_download(self, name, size, description=github.GithubObject.NotSet, content_type=github.GithubObject.NotSet): + """ + :calls: `POST /repos/:user/:repo/downloads `_ + :param name: string + :param size: integer + :param description: string + :param content_type: string + :rtype: :class:`github.Download.Download` + """ assert isinstance(name, (str, unicode)), name assert isinstance(size, (int, long)), size assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description @@ -240,6 +353,12 @@ class Repository(github.GithubObject.GithubObject): return github.Download.Download(self._requester, data, completed=True) def create_git_blob(self, content, encoding): + """ + :calls: `POST /repos/:user/:repo/git/blobs `_ + :param content: string + :param encoding: string + :rtype: :class:`github.GitBlob.GitBlob` + """ assert isinstance(content, (str, unicode)), content assert isinstance(encoding, (str, unicode)), encoding post_parameters = { @@ -255,6 +374,15 @@ class Repository(github.GithubObject.GithubObject): return github.GitBlob.GitBlob(self._requester, data, completed=True) def create_git_commit(self, message, tree, parents, author=github.GithubObject.NotSet, committer=github.GithubObject.NotSet): + """ + :calls: `POST /repos/:user/:repo/git/commits `_ + :param message: string + :param tree: :class:`github.GitTree.GitTree` + :param parents: list of :class:`github.GitCommit.GitCommit` + :param author: :class:`github.InputGitAuthor.InputGitAuthor` + :param committer: :class:`github.InputGitAuthor.InputGitAuthor` + :rtype: :class:`github.GitCommit.GitCommit` + """ assert isinstance(message, (str, unicode)), message assert isinstance(tree, github.GitTree.GitTree), tree assert all(isinstance(element, github.GitCommit.GitCommit) for element in parents), parents @@ -278,6 +406,12 @@ class Repository(github.GithubObject.GithubObject): return github.GitCommit.GitCommit(self._requester, data, completed=True) def create_git_ref(self, ref, sha): + """ + :calls: `POST /repos/:user/:repo/git/refs `_ + :param ref: string + :param sha: string + :rtype: :class:`github.GitRef.GitRef` + """ assert isinstance(ref, (str, unicode)), ref assert isinstance(sha, (str, unicode)), sha post_parameters = { @@ -293,6 +427,15 @@ class Repository(github.GithubObject.GithubObject): return github.GitRef.GitRef(self._requester, data, completed=True) def create_git_tag(self, tag, message, object, type, tagger=github.GithubObject.NotSet): + """ + :calls: `POST /repos/:user/:repo/git/tags `_ + :param tag: string + :param message: string + :param object: string + :param type: string + :param tagger: :class:`github.InputGitAuthor.InputGitAuthor` + :rtype: :class:`github.GitTag.GitTag` + """ assert isinstance(tag, (str, unicode)), tag assert isinstance(message, (str, unicode)), message assert isinstance(object, (str, unicode)), object @@ -315,6 +458,12 @@ class Repository(github.GithubObject.GithubObject): return github.GitTag.GitTag(self._requester, data, completed=True) def create_git_tree(self, tree, base_tree=github.GithubObject.NotSet): + """ + :calls: `POST /repos/:user/:repo/git/trees `_ + :param tree: list of :class:`github.InputGitTreeElement.InputGitTreeElement` + :param base_tree: :class:`github.GitTree.GitTree` + :rtype: :class:`github.GitTree.GitTree` + """ assert all(isinstance(element, github.InputGitTreeElement) for element in tree), tree assert base_tree is github.GithubObject.NotSet or isinstance(base_tree, github.GitTree.GitTree), base_tree post_parameters = { @@ -331,6 +480,14 @@ class Repository(github.GithubObject.GithubObject): return github.GitTree.GitTree(self._requester, data, completed=True) def create_hook(self, name, config, events=github.GithubObject.NotSet, active=github.GithubObject.NotSet): + """ + :calls: `POST /repos/:user/:repo/hooks `_ + :param name: string + :param config: dict + :param events: list of string + :param active: bool + :rtype: :class:`github.Hook.Hook` + """ 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 @@ -352,6 +509,15 @@ class Repository(github.GithubObject.GithubObject): return github.Hook.Hook(self._requester, data, completed=True) def create_issue(self, title, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet): + """ + :calls: `POST /repos/:user/:repo/issues `_ + :param title: string + :param body: string + :param assignee: :class:`github.NamedUser.NamedUser` + :param milestone: :class:`github.Milestone.Milestone` + :param labels: list of :class:`github.Label.Label` + :rtype: :class:`github.Issue.Issue` + """ assert isinstance(title, (str, unicode)), title assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body assert assignee is github.GithubObject.NotSet or isinstance(assignee, github.NamedUser.NamedUser), assignee @@ -377,6 +543,12 @@ class Repository(github.GithubObject.GithubObject): return github.Issue.Issue(self._requester, data, completed=True) def create_key(self, title, key): + """ + :calls: `POST /repos/:user/:repo/keys `_ + :param title: string + :param key: string + :rtype: :class:`github.RepositoryKey.RepositoryKey` + """ assert isinstance(title, (str, unicode)), title assert isinstance(key, (str, unicode)), key post_parameters = { @@ -392,6 +564,12 @@ class Repository(github.GithubObject.GithubObject): return github.RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) def create_label(self, name, color): + """ + :calls: `POST /repos/:user/:repo/labels `_ + :param name: string + :param color: string + :rtype: :class:`github.Label.Label` + """ assert isinstance(name, (str, unicode)), name assert isinstance(color, (str, unicode)), color post_parameters = { @@ -407,6 +585,14 @@ class Repository(github.GithubObject.GithubObject): return github.Label.Label(self._requester, data, completed=True) def create_milestone(self, title, state=github.GithubObject.NotSet, description=github.GithubObject.NotSet, due_on=github.GithubObject.NotSet): + """ + :calls: `POST /repos/:user/:repo/milestones `_ + :param title: string + :param state: string + :param description: string + :param due_on: date + :rtype: :class:`github.Milestone.Milestone` + """ 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 @@ -429,6 +615,15 @@ class Repository(github.GithubObject.GithubObject): return github.Milestone.Milestone(self._requester, data, completed=True) def create_pull(self, *args, **kwds): + """ + :calls: `POST /repos/:user/:repo/pulls `_ + :param title: string + :param body: string + :param issue: :class:`github.Issue.Issue` + :param base: string + :param head: string + :rtype: :class:`github.PullRequest.PullRequest` + """ if len(args) + len(kwds) == 4: return self.__create_pull_1(*args, **kwds) else: @@ -458,6 +653,10 @@ class Repository(github.GithubObject.GithubObject): return github.PullRequest.PullRequest(self._requester, data, completed=True) def delete(self): + """ + :calls: `DELETE /repos/:user/:repo `_ + :rtype: None + """ headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -466,6 +665,18 @@ class Repository(github.GithubObject.GithubObject): ) def edit(self, name, description=github.GithubObject.NotSet, homepage=github.GithubObject.NotSet, public=github.GithubObject.NotSet, has_issues=github.GithubObject.NotSet, has_wiki=github.GithubObject.NotSet, has_downloads=github.GithubObject.NotSet, default_branch=github.GithubObject.NotSet): + """ + :calls: `PATCH /repos/:user/:repo `_ + :param name: string + :param description: string + :param homepage: string + :param public: bool + :param has_issues: bool + :param has_wiki: bool + :param has_downloads: bool + :param default_branch: string + :rtype: None + """ 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 @@ -500,6 +711,12 @@ class Repository(github.GithubObject.GithubObject): self._useAttributes(data) def get_archive_link(self, archive_format, ref=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/:archive_format/:ref `_ + :param archive_format: string + :param ref: string + :rtype: string + """ assert isinstance(archive_format, (str, unicode)), archive_format assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref url = self.url + "/" + archive_format @@ -514,6 +731,10 @@ class Repository(github.GithubObject.GithubObject): return headers["location"] def get_assignees(self): + """ + :calls: `GET /repos/:user/:repo/assignees `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` + """ return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, @@ -522,6 +743,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_branch(self, branch): + """ + :calls: `GET /repos/:user/:repo/branches/:branch `_ + :param branch: string + :rtype: :class:`github.Branch.Branch` + """ assert isinstance(branch, (str, unicode)), branch headers, data = self._requester.requestAndCheck( "GET", @@ -532,6 +758,10 @@ class Repository(github.GithubObject.GithubObject): return github.Branch.Branch(self._requester, data, completed=True) def get_branches(self): + """ + :calls: `GET /repos/:user/:repo/branches `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Branch.Branch` + """ return github.PaginatedList.PaginatedList( github.Branch.Branch, self._requester, @@ -540,6 +770,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_collaborators(self): + """ + :calls: `GET /repos/:user/:repo/collaborators `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` + """ return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, @@ -548,6 +782,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_comment(self, id): + """ + :calls: `GET /repos/:user/:repo/comments/:id `_ + :param id: integer + :rtype: :class:`github.CommitComment.CommitComment` + """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", @@ -558,6 +797,10 @@ class Repository(github.GithubObject.GithubObject): return github.CommitComment.CommitComment(self._requester, data, completed=True) def get_comments(self): + """ + :calls: `GET /repos/:user/:repo/comments `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitComment.CommitComment` + """ return github.PaginatedList.PaginatedList( github.CommitComment.CommitComment, self._requester, @@ -566,6 +809,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_commit(self, sha): + """ + :calls: `GET /repos/:user/:repo/commits/:sha `_ + :param sha: string + :rtype: :class:`github.Commit.Commit` + """ assert isinstance(sha, (str, unicode)), sha headers, data = self._requester.requestAndCheck( "GET", @@ -576,6 +824,12 @@ class Repository(github.GithubObject.GithubObject): return github.Commit.Commit(self._requester, data, completed=True) def get_commits(self, sha=github.GithubObject.NotSet, path=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/commits `_ + :param sha: string + :param path: string + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Commit.Commit` + """ assert sha is github.GithubObject.NotSet or isinstance(sha, (str, unicode)), sha assert path is github.GithubObject.NotSet or isinstance(path, (str, unicode)), path url_parameters = dict() @@ -591,6 +845,12 @@ class Repository(github.GithubObject.GithubObject): ) def get_contents(self, path, ref=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/contents/:path `_ + :param path: string + :param ref: string + :rtype: :class:`github.ContentFile.ContentFile` + """ assert isinstance(path, (str, unicode)), path assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref url_parameters = dict() @@ -605,6 +865,10 @@ class Repository(github.GithubObject.GithubObject): return github.ContentFile.ContentFile(self._requester, data, completed=True) def get_contributors(self): + """ + :calls: `GET /repos/:user/:repo/contributors `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` + """ return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, @@ -613,6 +877,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_download(self, id): + """ + :calls: `GET /repos/:user/:repo/downloads/:id `_ + :param id: integer + :rtype: :class:`github.Download.Download` + """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", @@ -623,6 +892,10 @@ class Repository(github.GithubObject.GithubObject): return github.Download.Download(self._requester, data, completed=True) def get_downloads(self): + """ + :calls: `GET /repos/:user/:repo/downloads `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Download.Download` + """ return github.PaginatedList.PaginatedList( github.Download.Download, self._requester, @@ -631,6 +904,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_events(self): + """ + :calls: `GET /repos/:user/:repo/events `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event` + """ return github.PaginatedList.PaginatedList( github.Event.Event, self._requester, @@ -639,6 +916,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_forks(self): + """ + :calls: `GET /repos/:user/:repo/forks `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` + """ return github.PaginatedList.PaginatedList( Repository, self._requester, @@ -647,6 +928,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_git_blob(self, sha): + """ + :calls: `GET /repos/:user/:repo/git/blobs/:sha `_ + :param sha: string + :rtype: :class:`github.GitBlob.GitBlob` + """ assert isinstance(sha, (str, unicode)), sha headers, data = self._requester.requestAndCheck( "GET", @@ -657,6 +943,11 @@ class Repository(github.GithubObject.GithubObject): return github.GitBlob.GitBlob(self._requester, data, completed=True) def get_git_commit(self, sha): + """ + :calls: `GET /repos/:user/:repo/git/commits/:sha `_ + :param sha: string + :rtype: :class:`github.GitCommit.GitCommit` + """ assert isinstance(sha, (str, unicode)), sha headers, data = self._requester.requestAndCheck( "GET", @@ -667,6 +958,11 @@ class Repository(github.GithubObject.GithubObject): return github.GitCommit.GitCommit(self._requester, data, completed=True) def get_git_ref(self, ref): + """ + :calls: `GET /repos/:user/:repo/git/refs/:ref `_ + :param ref: string + :rtype: :class:`github.GitRef.GitRef` + """ prefix = "/git/refs/" if not self._requester.FIX_REPO_GET_GIT_REF: prefix = "/git/" @@ -680,6 +976,10 @@ class Repository(github.GithubObject.GithubObject): return github.GitRef.GitRef(self._requester, data, completed=True) def get_git_refs(self): + """ + :calls: `GET /repos/:user/:repo/git/refs `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.GitRef.GitRef` + """ return github.PaginatedList.PaginatedList( github.GitRef.GitRef, self._requester, @@ -688,6 +988,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_git_tag(self, sha): + """ + :calls: `GET /repos/:user/:repo/git/tags/:sha `_ + :param sha: string + :rtype: :class:`github.GitTag.GitTag` + """ assert isinstance(sha, (str, unicode)), sha headers, data = self._requester.requestAndCheck( "GET", @@ -698,6 +1003,12 @@ class Repository(github.GithubObject.GithubObject): return github.GitTag.GitTag(self._requester, data, completed=True) def get_git_tree(self, sha, recursive=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/git/trees/:sha `_ + :param sha: string + :param recursive: bool + :rtype: :class:`github.GitTree.GitTree` + """ assert isinstance(sha, (str, unicode)), sha assert recursive is github.GithubObject.NotSet or isinstance(recursive, bool), recursive url_parameters = dict() @@ -712,6 +1023,11 @@ class Repository(github.GithubObject.GithubObject): return github.GitTree.GitTree(self._requester, data, completed=True) def get_hook(self, id): + """ + :calls: `GET /repos/:user/:repo/hooks/:id `_ + :param id: integer + :rtype: :class:`github.Hook.Hook` + """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", @@ -722,6 +1038,10 @@ class Repository(github.GithubObject.GithubObject): return github.Hook.Hook(self._requester, data, completed=True) def get_hooks(self): + """ + :calls: `GET /repos/:user/:repo/hooks `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Hook.Hook` + """ return github.PaginatedList.PaginatedList( github.Hook.Hook, self._requester, @@ -730,6 +1050,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_issue(self, number): + """ + :calls: `GET /repos/:user/:repo/issues/:number `_ + :param number: integer + :rtype: :class:`github.Issue.Issue` + """ assert isinstance(number, (int, long)), number headers, data = self._requester.requestAndCheck( "GET", @@ -740,6 +1065,18 @@ class Repository(github.GithubObject.GithubObject): return github.Issue.Issue(self._requester, data, completed=True) def get_issues(self, milestone=github.GithubObject.NotSet, state=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, mentioned=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/issues `_ + :param milestone: :class:`github.Milestone.Milestone` or "none" or "*" + :param state: string + :param assignee: :class:`github.NamedUser.NamedUser` or "none" or "*" + :param mentioned: :class:`github.NamedUser.NamedUser` + :param labels: list of :class:`github.Label.Label` + :param sort: string + :param direction: string + :param since: datetime.datetime + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue` + """ assert milestone is github.GithubObject.NotSet or milestone == "*" or milestone == "none" or isinstance(milestone, github.Milestone.Milestone), milestone assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state assert assignee is github.GithubObject.NotSet or assignee == "*" or assignee == "none" or isinstance(assignee, github.NamedUser.NamedUser), assignee @@ -779,6 +1116,13 @@ class Repository(github.GithubObject.GithubObject): ) def get_issues_comments(self, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/issues/comments `_ + :param sort: string + :param direction: string + :param since: datetime.datetime + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.IssueComment.IssueComment` + """ assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction assert since is github.GithubObject.NotSet or isinstance(since, datetime.datetime), since @@ -797,6 +1141,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_issues_event(self, id): + """ + :calls: `GET /repos/:user/:repo/issues/events/:id `_ + :param id: integer + :rtype: :class:`github.IssueEvent.IssueEvent` + """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", @@ -807,6 +1156,10 @@ class Repository(github.GithubObject.GithubObject): return github.IssueEvent.IssueEvent(self._requester, data, completed=True) def get_issues_events(self): + """ + :calls: `GET /repos/:user/:repo/issues/events `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.IssueEvent.IssueEvent` + """ return github.PaginatedList.PaginatedList( github.IssueEvent.IssueEvent, self._requester, @@ -815,6 +1168,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_key(self, id): + """ + :calls: `GET /repos/:user/:repo/keys/:id `_ + :param id: integer + :rtype: :class:`github.RepositoryKey.RepositoryKey` + """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", @@ -825,6 +1183,10 @@ class Repository(github.GithubObject.GithubObject): return github.RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) def get_keys(self): + """ + :calls: `GET /repos/:user/:repo/keys `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.RepositoryKey.RepositoryKey` + """ return github.PaginatedList.PaginatedList( lambda requester, data, completed: github.RepositoryKey.RepositoryKey(requester, data, completed, repoUrl=self._url), self._requester, @@ -833,6 +1195,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_label(self, name): + """ + :calls: `GET /repos/:user/:repo/labels/:name `_ + :param name: string + :rtype: :class:`github.Label.Label` + """ assert isinstance(name, (str, unicode)), name headers, data = self._requester.requestAndCheck( "GET", @@ -843,6 +1210,10 @@ class Repository(github.GithubObject.GithubObject): return github.Label.Label(self._requester, data, completed=True) def get_labels(self): + """ + :calls: `GET /repos/:user/:repo/labels `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Label.Label` + """ return github.PaginatedList.PaginatedList( github.Label.Label, self._requester, @@ -851,6 +1222,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_languages(self): + """ + :calls: `GET /repos/:user/:repo/languages `_ + :rtype: dict of string to integer + """ headers, data = self._requester.requestAndCheck( "GET", self.url + "/languages", @@ -860,6 +1235,11 @@ class Repository(github.GithubObject.GithubObject): return data def get_milestone(self, number): + """ + :calls: `GET /repos/:user/:repo/milestones/:number `_ + :param number: integer + :rtype: :class:`github.Milestone.Milestone` + """ assert isinstance(number, (int, long)), number headers, data = self._requester.requestAndCheck( "GET", @@ -870,6 +1250,13 @@ class Repository(github.GithubObject.GithubObject): return github.Milestone.Milestone(self._requester, data, completed=True) def get_milestones(self, state=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/milestones `_ + :param state: string + :param sort: string + :param direction: string + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Milestone.Milestone` + """ assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction @@ -888,6 +1275,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_network_events(self): + """ + :calls: `GET /networks/:user/:repo/events `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event` + """ return github.PaginatedList.PaginatedList( github.Event.Event, self._requester, @@ -896,6 +1287,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_pull(self, number): + """ + :calls: `GET /repos/:user/:repo/pulls/:number `_ + :param number: integer + :rtype: :class:`github.PullRequest.PullRequest` + """ assert isinstance(number, (int, long)), number headers, data = self._requester.requestAndCheck( "GET", @@ -906,6 +1302,11 @@ class Repository(github.GithubObject.GithubObject): return github.PullRequest.PullRequest(self._requester, data, completed=True) def get_pulls(self, state=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/pulls `_ + :param state: string + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequest.PullRequest` + """ assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state url_parameters = dict() if state is not github.GithubObject.NotSet: @@ -918,9 +1319,23 @@ class Repository(github.GithubObject.GithubObject): ) def get_pulls_comments(self, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/pulls/comments `_ + :param sort: string + :param direction: string + :param since: datetime.datetime + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequestComment.PullRequestComment` + """ return self.get_pulls_review_comments(sort, direction, since) def get_pulls_review_comments(self, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/pulls/comments `_ + :param sort: string + :param direction: string + :param since: datetime.datetime + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequestComment.PullRequestComment` + """ assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction assert since is github.GithubObject.NotSet or isinstance(since, datetime.datetime), since @@ -939,6 +1354,11 @@ class Repository(github.GithubObject.GithubObject): ) def get_readme(self, ref=github.GithubObject.NotSet): + """ + :calls: `GET /repos/:user/:repo/readme `_ + :param ref: string + :rtype: :class:`github.ContentFile.ContentFile` + """ assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref url_parameters = dict() if ref is not github.GithubObject.NotSet: @@ -952,6 +1372,10 @@ class Repository(github.GithubObject.GithubObject): return github.ContentFile.ContentFile(self._requester, data, completed=True) def get_stargazers(self): + """ + :calls: `GET /repos/:user/:repo/stargazers `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` + """ return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, @@ -960,6 +1384,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_subscribers(self): + """ + :calls: `GET /repos/:user/:repo/subscribers `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` + """ return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, @@ -968,6 +1396,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_tags(self): + """ + :calls: `GET /repos/:user/:repo/tags `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Tag.Tag` + """ return github.PaginatedList.PaginatedList( github.Tag.Tag, self._requester, @@ -976,6 +1408,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_teams(self): + """ + :calls: `GET /repos/:user/:repo/teams `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team` + """ return github.PaginatedList.PaginatedList( github.Team.Team, self._requester, @@ -984,6 +1420,10 @@ class Repository(github.GithubObject.GithubObject): ) def get_watchers(self): + """ + :calls: `GET /repos/:user/:repo/watchers `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` + """ return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, @@ -992,6 +1432,11 @@ class Repository(github.GithubObject.GithubObject): ) def has_in_assignees(self, assignee): + """ + :calls: `GET /repos/:user/:repo/assignees/:assignee `_ + :param assignee: :class:`github.NamedUser.NamedUser` + :rtype: bool + """ assert isinstance(assignee, github.NamedUser.NamedUser), assignee status, headers, data = self._requester.requestRaw( "GET", @@ -1002,6 +1447,11 @@ class Repository(github.GithubObject.GithubObject): return status == 204 def has_in_collaborators(self, collaborator): + """ + :calls: `GET /repos/:user/:repo/collaborators/:user `_ + :param collaborator: :class:`github.NamedUser.NamedUser` + :rtype: bool + """ assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator status, headers, data = self._requester.requestRaw( "GET", @@ -1012,6 +1462,12 @@ class Repository(github.GithubObject.GithubObject): return status == 204 def legacy_search_issues(self, state, keyword): + """ + :calls: `GET /legacy/issues/search/:owner/:repository/:state/:keyword `_ + :param state: "open" or "closed" + :param keyword: string + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue` + """ assert state in ["open", "closed"], state assert isinstance(keyword, (str, unicode)), keyword headers, data = self._requester.requestAndCheck( @@ -1026,6 +1482,13 @@ class Repository(github.GithubObject.GithubObject): ] def merge(self, base, head, commit_message=github.GithubObject.NotSet): + """ + :calls: `POST /repos/:user/:repo/merges `_ + :param base: string + :param head: string + :param commit_message: string + :rtype: :class:`github.Commit.Commit` + """ assert isinstance(base, (str, unicode)), base assert isinstance(head, (str, unicode)), head assert commit_message is github.GithubObject.NotSet or isinstance(commit_message, (str, unicode)), commit_message @@ -1047,6 +1510,11 @@ class Repository(github.GithubObject.GithubObject): return github.Commit.Commit(self._requester, data, completed=True) def remove_from_collaborators(self, collaborator): + """ + :calls: `DELETE /repos/:user/:repo/collaborators/:user `_ + :param collaborator: :class:`github.NamedUser.NamedUser` + :rtype: None + """ assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator headers, data = self._requester.requestAndCheck( "DELETE", diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index 028dc3ce..ee435d7e 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -17,6 +17,10 @@ import github.GithubObject class RepositoryKey(github.GithubObject.GithubObject): + """ + This class represents RepositoryKeys as returned for example by http://developer.github.com/v3/todo + """ + def __init__(self, requester, attributes, completed, repoUrl): github.GithubObject.GithubObject.__init__(self, requester, attributes, completed) self.__repoUrl = repoUrl @@ -27,30 +31,49 @@ class RepositoryKey(github.GithubObject.GithubObject): @property def id(self): + """ + :type: integer + """ self._completeIfNotSet(self._id) return self._NoneIfNotSet(self._id) @property def key(self): + """ + :type: string + """ self._completeIfNotSet(self._key) return self._NoneIfNotSet(self._key) @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) @property def verified(self): + """ + :type: bool + """ self._completeIfNotSet(self._verified) return self._NoneIfNotSet(self._verified) def delete(self): + """ + :calls: `DELETE /repos/:user/:repo/keys/:id `_ + :rtype: None + """ headers, data = self._requester.requestAndCheck( "DELETE", self.__customUrl, @@ -59,6 +82,12 @@ class RepositoryKey(github.GithubObject.GithubObject): ) def edit(self, title=github.GithubObject.NotSet, key=github.GithubObject.NotSet): + """ + :calls: `PATCH /repos/:user/:repo/keys/:id `_ + :param title: string + :param key: string + :rtype: None + """ assert title is github.GithubObject.NotSet or isinstance(title, (str, unicode)), title assert key is github.GithubObject.NotSet or isinstance(key, (str, unicode)), key post_parameters = dict() diff --git a/github/Tag.py b/github/Tag.py index 96c87022..2ff04cb3 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -19,20 +19,36 @@ import github.Commit class Tag(github.GithubObject.BasicGithubObject): + """ + This class represents Tags 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) @property def tarball_url(self): + """ + :type: string + """ return self._NoneIfNotSet(self._tarball_url) @property def zipball_url(self): + """ + :type: string + """ return self._NoneIfNotSet(self._zipball_url) def _initAttributes(self): diff --git a/github/Team.py b/github/Team.py index 684e5df9..34db8146 100644 --- a/github/Team.py +++ b/github/Team.py @@ -21,37 +21,64 @@ import github.NamedUser class Team(github.GithubObject.GithubObject): + """ + This class represents Teams as returned for example by http://developer.github.com/v3/todo + """ + @property def id(self): + """ + :type: integer + """ self._completeIfNotSet(self._id) return self._NoneIfNotSet(self._id) @property def members_count(self): + """ + :type: integer + """ self._completeIfNotSet(self._members_count) return self._NoneIfNotSet(self._members_count) @property def name(self): + """ + :type: string + """ self._completeIfNotSet(self._name) return self._NoneIfNotSet(self._name) @property def permission(self): + """ + :type: string + """ self._completeIfNotSet(self._permission) return self._NoneIfNotSet(self._permission) @property def repos_count(self): + """ + :type: integer + """ self._completeIfNotSet(self._repos_count) return self._NoneIfNotSet(self._repos_count) @property def url(self): + """ + :type: string + """ self._completeIfNotSet(self._url) return self._NoneIfNotSet(self._url) def add_to_members(self, member): + """ + :calls: `PUT /teams/:id/members/:user `_ + :param member: :class:`github.NamedUser.NamedUser` + :rtype: None + """ assert isinstance(member, github.NamedUser.NamedUser), member headers, data = self._requester.requestAndCheck( "PUT", @@ -61,6 +88,11 @@ class Team(github.GithubObject.GithubObject): ) def add_to_repos(self, repo): + """ + :calls: `PUT /teams/:id/repos/:user/:repo `_ + :param repo: :class:`github.Repository.Repository` + :rtype: None + """ assert isinstance(repo, github.Repository.Repository), repo headers, data = self._requester.requestAndCheck( "PUT", @@ -70,6 +102,10 @@ class Team(github.GithubObject.GithubObject): ) def delete(self): + """ + :calls: `DELETE /teams/:id `_ + :rtype: None + """ headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -78,6 +114,12 @@ class Team(github.GithubObject.GithubObject): ) def edit(self, name, permission=github.GithubObject.NotSet): + """ + :calls: `PATCH /teams/:id `_ + :param name: string + :param permission: string + :rtype: None + """ assert isinstance(name, (str, unicode)), name assert permission is github.GithubObject.NotSet or isinstance(permission, (str, unicode)), permission post_parameters = { @@ -94,6 +136,10 @@ class Team(github.GithubObject.GithubObject): self._useAttributes(data) def get_members(self): + """ + :calls: `GET /teams/:id/members `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` + """ return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, @@ -102,6 +148,10 @@ class Team(github.GithubObject.GithubObject): ) def get_repos(self): + """ + :calls: `GET /teams/:id/repos `_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` + """ return github.PaginatedList.PaginatedList( github.Repository.Repository, self._requester, @@ -110,6 +160,11 @@ class Team(github.GithubObject.GithubObject): ) def has_in_members(self, member): + """ + :calls: `GET /teams/:id/members/:user `_ + :param member: :class:`github.NamedUser.NamedUser` + :rtype: bool + """ assert isinstance(member, github.NamedUser.NamedUser), member status, headers, data = self._requester.requestRaw( "GET", @@ -120,6 +175,11 @@ class Team(github.GithubObject.GithubObject): return status == 204 def has_in_repos(self, repo): + """ + :calls: `GET /teams/:id/repos/:user/:repo `_ + :param repo: :class:`github.Repository.Repository` + :rtype: bool + """ assert isinstance(repo, github.Repository.Repository), repo status, headers, data = self._requester.requestRaw( "GET", @@ -130,6 +190,11 @@ class Team(github.GithubObject.GithubObject): return status == 204 def remove_from_members(self, member): + """ + :calls: `DELETE /teams/:id/members/:user `_ + :param member: :class:`github.NamedUser.NamedUser` + :rtype: None + """ assert isinstance(member, github.NamedUser.NamedUser), member headers, data = self._requester.requestAndCheck( "DELETE", @@ -139,6 +204,11 @@ class Team(github.GithubObject.GithubObject): ) def remove_from_repos(self, repo): + """ + :calls: `DELETE /teams/:id/repos/:user/:repo `_ + :param repo: :class:`github.Repository.Repository` + :rtype: None + """ assert isinstance(repo, github.Repository.Repository), repo headers, data = self._requester.requestAndCheck( "DELETE", diff --git a/github/UserKey.py b/github/UserKey.py index 4fe342ce..b6478d2e 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -17,32 +17,55 @@ import github.GithubObject class UserKey(github.GithubObject.GithubObject): + """ + This class represents UserKeys as returned for example by http://developer.github.com/v3/todo + """ + @property def id(self): + """ + :type: integer + """ self._completeIfNotSet(self._id) return self._NoneIfNotSet(self._id) @property def key(self): + """ + :type: string + """ self._completeIfNotSet(self._key) return self._NoneIfNotSet(self._key) @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) @property def verified(self): + """ + :type: bool + """ self._completeIfNotSet(self._verified) return self._NoneIfNotSet(self._verified) def delete(self): + """ + :calls: `DELETE /user/keys/:id `_ + :rtype: None + """ headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -51,6 +74,12 @@ class UserKey(github.GithubObject.GithubObject): ) def edit(self, title=github.GithubObject.NotSet, key=github.GithubObject.NotSet): + """ + :calls: `PATCH /user/keys/:id `_ + :param title: string + :param key: string + :rtype: None + """ assert title is github.GithubObject.NotSet or isinstance(title, (str, unicode)), title assert key is github.GithubObject.NotSet or isinstance(key, (str, unicode)), key post_parameters = dict()