diff --git a/github/AuthenticatedUser.pyi b/github/AuthenticatedUser.pyi new file mode 100644 index 00000000..5dbf3ec0 --- /dev/null +++ b/github/AuthenticatedUser.pyi @@ -0,0 +1,217 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional, Union + +from github.Authorization import Authorization +from github.Gist import Gist +from github.GithubObject import _NotSetType +from github.InputFileContent import InputFileContent +from github.Invitation import Invitation +from github.Label import Label +from github.Membership import Membership +from github.Migration import Migration +from github.NamedUser import NamedUser +from github.Notification import Notification +from github.Organization import Organization +from github.PaginatedList import PaginatedList +from github.Plan import Plan +from github.Repository import Repository +from github.UserKey import UserKey + +class AuthenticatedUser: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + def accept_invitation(self, invitation: Union[int, Invitation]) -> None: ... + def add_to_emails(self, *emails) -> None: ... + def add_to_following(self, following: NamedUser) -> None: ... + def add_to_starred(self, starred: Repository) -> None: ... + def add_to_subscriptions(self, subscription: Repository) -> None: ... + def add_to_watched(self, watched: Repository) -> None: ... + @property + def avatar_url(self) -> str: ... + @property + def bio(self) -> str: ... + @property + def blog(self) -> str: ... + @property + def collaborators(self) -> int: ... + @property + def company(self) -> str: ... + def create_authorization( + self, + scopes: Union[List[str], _NotSetType] = ..., + note: Union[str, _NotSetType] = ..., + note_url: Union[str, _NotSetType] = ..., + client_id: Union[str, _NotSetType] = ..., + client_secret: Union[str, _NotSetType] = ..., + onetime_password: Union[str, None] = ..., + ) -> Authorization: ... + def create_fork(self, repo: Repository) -> Repository: ... + def create_gist( + self, + public: bool, + files: Dict[str, InputFileContent], + description: Union[str, _NotSetType] = ..., + ) -> Gist: ... + def create_key(self, title: str, key: str) -> UserKey: ... + def create_migration( + self, + repos: List[str], + lock_repositories: Union[bool, _NotSetType] = ..., + exclude_attachments: Union[bool, _NotSetType] = ..., + ) -> Migration: ... + def create_repo( + self, + name: str, + description: Union[str, _NotSetType] = ..., + homepage: Union[str, _NotSetType] = ..., + private: Union[bool, _NotSetType] = ..., + has_issues: Union[bool, _NotSetType] = ..., + has_wiki: Union[bool, _NotSetType] = ..., + has_downloads: Union[bool, _NotSetType] = ..., + has_projects: Union[bool, _NotSetType] = ..., + auto_init: Union[bool, _NotSetType] = ..., + license_template: _NotSetType = ..., + gitignore_template: Union[str, _NotSetType] = ..., + allow_squash_merge: Union[bool, _NotSetType] = ..., + allow_merge_commit: Union[bool, _NotSetType] = ..., + allow_rebase_merge: Union[bool, _NotSetType] = ..., + ) -> Repository: ... + @property + def created_at(self) -> datetime: ... + @property + def disk_usage(self) -> int: ... + def edit( + self, + name: Union[str, _NotSetType] = ..., + email: Union[str, _NotSetType] = ..., + blog: Union[str, _NotSetType] = ..., + company: Union[str, _NotSetType] = ..., + location: Union[str, _NotSetType] = ..., + hireable: Union[bool, _NotSetType] = ..., + bio: Union[str, _NotSetType] = ..., + ) -> None: ... + @property + def email(self) -> str: ... + @property + def events_url(self) -> str: ... + @property + def followers(self) -> int: ... + @property + def followers_url(self) -> str: ... + @property + def following(self) -> int: ... + @property + def following_url(self) -> str: ... + def get_authorization(self, id: int) -> Authorization: ... + def get_authorizations(self) -> PaginatedList: ... + def get_emails(self) -> List[str]: ... + def get_events(self) -> PaginatedList: ... + def get_followers(self) -> PaginatedList: ... + def get_following(self) -> PaginatedList: ... + def get_gists(self, since: Union[datetime, _NotSetType] = ...) -> PaginatedList: ... + def get_invitations(self) -> PaginatedList: ... + def get_issues( + self, + filter: Union[str, _NotSetType] = ..., + state: Union[str, _NotSetType] = ..., + labels: Union[List[Label], _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + since: Union[_NotSetType, datetime] = ..., + ) -> PaginatedList: ... + def get_key(self, id: int) -> UserKey: ... + def get_keys(self) -> PaginatedList: ... + def get_migrations(self) -> PaginatedList: ... + def get_notification(self, id: str) -> Notification: ... + def get_notifications( + self, + all: Union[bool, _NotSetType] = ..., + participating: Union[bool, _NotSetType] = ..., + since: Union[datetime, _NotSetType] = ..., + before: Union[datetime, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_organization_events(self, org: Organization) -> PaginatedList: ... + def get_organization_membership(self, org: int) -> Membership: ... + def get_orgs(self) -> PaginatedList: ... + def get_repo(self, name: str) -> Repository: ... + def get_repos( + self, + visibility: Union[str, _NotSetType] = ..., + affiliation: Union[str, _NotSetType] = ..., + type: Union[str, _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_starred(self) -> PaginatedList: ... + def get_starred_gists(self) -> PaginatedList: ... + def get_subscriptions(self) -> PaginatedList: ... + def get_teams(self) -> PaginatedList: ... + def get_user_issues( + self, + filter: Union[str, _NotSetType] = ..., + state: Union[str, _NotSetType] = ..., + labels: Union[List[Label], _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + since: Union[_NotSetType, datetime] = ..., + ) -> PaginatedList: ... + def get_watched(self) -> PaginatedList: ... + @property + def gists_url(self) -> str: ... + @property + def gravatar_id(self) -> str: ... + def has_in_following(self, following: NamedUser) -> bool: ... + def has_in_starred(self, starred: Repository) -> bool: ... + def has_in_subscriptions(self, subscription: Repository) -> bool: ... + def has_in_watched(self, watched: Repository) -> bool: ... + @property + def hireable(self) -> bool: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def location(self) -> str: ... + @property + def login(self) -> str: ... + def mark_notifications_as_read(self, last_read_at: datetime = ...) -> None: ... + @property + def name(self) -> str: ... + @property + def node_id(self) -> str: ... + @property + def organizations_url(self) -> str: ... + @property + def owned_private_repos(self) -> int: ... + @property + def plan(self) -> Plan: ... + @property + def private_gists(self) -> int: ... + @property + def public_gists(self) -> int: ... + @property + def public_repos(self) -> int: ... + @property + def received_events_url(self) -> str: ... + def remove_from_emails(self, *emails: str) -> None: ... + def remove_from_following(self, following: NamedUser) -> None: ... + def remove_from_starred(self, starred: Repository) -> None: ... + def remove_from_subscriptions(self, subscription: Repository) -> None: ... + def remove_from_watched(self, watched: Repository) -> None: ... + @property + def repos_url(self) -> str: ... + @property + def site_admin(self) -> bool: ... + @property + def starred_url(self) -> str: ... + @property + def subscriptions_url(self) -> str: ... + @property + def total_private_repos(self) -> int: ... + @property + def type(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/Authorization.pyi b/github/Authorization.pyi new file mode 100644 index 00000000..bfbdce16 --- /dev/null +++ b/github/Authorization.pyi @@ -0,0 +1,37 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional, Union + +from github.AuthorizationApplication import AuthorizationApplication +from github.GithubObject import _NotSetType + +class Authorization: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def app(self) -> AuthorizationApplication: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + def edit( + self, + scopes: Union[_NotSetType, List[str]] = ..., + add_scopes: Union[_NotSetType, List[str]] = ..., + remove_scopes: Union[_NotSetType, List[str]] = ..., + note: Union[_NotSetType, str] = ..., + note_url: Union[_NotSetType, str] = ..., + ) -> None: ... + @property + def id(self) -> int: ... + @property + def note(self) -> Optional[str]: ... + @property + def note_url(self) -> Optional[str]: ... + @property + def scopes(self) -> List[str]: ... + @property + def token(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/AuthorizationApplication.pyi b/github/AuthorizationApplication.pyi new file mode 100644 index 00000000..de96a899 --- /dev/null +++ b/github/AuthorizationApplication.pyi @@ -0,0 +1,9 @@ +from typing import Dict + +class AuthorizationApplication: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, str]) -> None: ... + @property + def name(self) -> str: ... + @property + def url(self) -> str: ... diff --git a/github/Branch.pyi b/github/Branch.pyi new file mode 100644 index 00000000..6ed014ae --- /dev/null +++ b/github/Branch.pyi @@ -0,0 +1,64 @@ +from typing import Any, Dict, List, Union + +from github.BranchProtection import BranchProtection +from github.Commit import Commit +from github.GithubObject import _NotSetType +from github.PaginatedList import PaginatedList +from github.RequiredPullRequestReviews import RequiredPullRequestReviews +from github.RequiredStatusChecks import RequiredStatusChecks + +class Branch: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + def add_required_signatures(self) -> None: ... + @property + def commit(self) -> Commit: ... + def edit_protection( + self, + strict: Union[bool, _NotSetType] = ..., + contexts: Union[List[str], _NotSetType] = ..., + enforce_admins: Union[bool, _NotSetType] = ..., + dismissal_users: Union[_NotSetType, List[str]] = ..., + dismissal_teams: Union[_NotSetType, List[str]] = ..., + dismiss_stale_reviews: Union[bool, _NotSetType] = ..., + require_code_owner_reviews: Union[bool, _NotSetType] = ..., + required_approving_review_count: Union[int, _NotSetType] = ..., + user_push_restrictions: Union[_NotSetType, List[str]] = ..., + team_push_restrictions: Union[_NotSetType, List[str]] = ..., + ) -> None: ... + def edit_required_pull_request_reviews( + self, + dismissal_users: Union[_NotSetType, List[str]] = ..., + dismissal_teams: Union[_NotSetType, List[str]] = ..., + dismiss_stale_reviews: Union[bool, _NotSetType] = ..., + require_code_owner_reviews: Union[_NotSetType, bool] = ..., + required_approving_review_count: Union[int, _NotSetType] = ..., + ) -> None: ... + def edit_required_status_checks( + self, + strict: Union[_NotSetType, bool] = ..., + contexts: Union[List[str], _NotSetType] = ..., + ) -> None: ... + def edit_team_push_restrictions(self, *teams: str) -> None: ... + def edit_user_push_restrictions(self, *users: str) -> None: ... + def get_admin_enforcement(self) -> bool: ... + def get_protection(self) -> BranchProtection: ... + def get_required_pull_request_reviews(self) -> RequiredPullRequestReviews: ... + def get_required_signatures(self) -> bool: ... + def get_required_status_checks(self) -> RequiredStatusChecks: ... + def get_team_push_restrictions(self) -> PaginatedList: ... + def get_user_push_restrictions(self) -> PaginatedList: ... + @property + def name(self) -> str: ... + @property + def protected(self) -> bool: ... + @property + def protection_url(self) -> str: ... + def remove_admin_enforcement(self) -> None: ... + def remove_protection(self) -> None: ... + def remove_push_restrictions(self) -> None: ... + def remove_required_pull_request_reviews(self) -> None: ... + def remove_required_signatures(self) -> None: ... + def remove_required_status_checks(self) -> None: ... + def set_admin_enforcement(self) -> None: ... diff --git a/github/BranchProtection.pyi b/github/BranchProtection.pyi new file mode 100644 index 00000000..d1cf250c --- /dev/null +++ b/github/BranchProtection.pyi @@ -0,0 +1,20 @@ +from typing import Any, Dict + +from github.PaginatedList import PaginatedList +from github.RequiredPullRequestReviews import RequiredPullRequestReviews +from github.RequiredStatusChecks import RequiredStatusChecks + +class BranchProtection: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def enforce_admins(self) -> bool: ... + def get_team_push_restrictions(self) -> PaginatedList: ... + def get_user_push_restrictions(self) -> PaginatedList: ... + @property + def required_pull_request_reviews(self) -> RequiredPullRequestReviews: ... + @property + def required_status_checks(self) -> RequiredStatusChecks: ... + @property + def url(self) -> str: ... diff --git a/github/Clones.pyi b/github/Clones.pyi new file mode 100644 index 00000000..d990facb --- /dev/null +++ b/github/Clones.pyi @@ -0,0 +1,13 @@ +from datetime import datetime +from typing import Any, Dict + +class Clones: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def count(self) -> int: ... + @property + def timestamp(self) -> datetime: ... + @property + def uniques(self) -> int: ... diff --git a/github/Commit.pyi b/github/Commit.pyi new file mode 100644 index 00000000..3d9cefb6 --- /dev/null +++ b/github/Commit.pyi @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Union + +from github.CommitCombinedStatus import CommitCombinedStatus +from github.CommitComment import CommitComment +from github.CommitStats import CommitStats +from github.CommitStatus import CommitStatus +from github.File import File +from github.GitCommit import GitCommit +from github.GithubObject import _NotSetType +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList + +class Commit: + def __repr__(self) -> str: ... + @property + def _identity(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def author(self) -> NamedUser: ... + @property + def comments_url(self) -> str: ... + @property + def commit(self) -> GitCommit: ... + @property + def committer(self) -> NamedUser: ... + def create_comment( + self, + body: str, + line: Union[int, _NotSetType] = ..., + path: Union[_NotSetType, str] = ..., + position: Union[int, _NotSetType] = ..., + ) -> CommitComment: ... + def create_status( + self, + state: str, + target_url: Union[_NotSetType, str] = ..., + description: Union[_NotSetType, str] = ..., + context: Union[_NotSetType, str] = ..., + ) -> CommitStatus: ... + @property + def files(self) -> List[File]: ... + def get_combined_status(self) -> CommitCombinedStatus: ... + def get_comments(self) -> PaginatedList: ... + def get_statuses(self) -> PaginatedList: ... + @property + def html_url(self) -> str: ... + @property + def parents(self) -> List[Commit]: ... + @property + def sha(self) -> str: ... + @property + def stats(self) -> CommitStats: ... + @property + def url(self) -> str: ... diff --git a/github/CommitCombinedStatus.pyi b/github/CommitCombinedStatus.pyi new file mode 100644 index 00000000..5239c093 --- /dev/null +++ b/github/CommitCombinedStatus.pyi @@ -0,0 +1,23 @@ +from typing import Any, Dict, List + +from github.CommitStatus import CommitStatus +from github.Repository import Repository + +class CommitCombinedStatus: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def commit_url(self) -> str: ... + @property + def repository(self) -> Repository: ... + @property + def sha(self) -> str: ... + @property + def state(self) -> str: ... + @property + def statuses(self) -> List[CommitStatus]: ... + @property + def total_count(self) -> int: ... + @property + def url(self) -> str: ... diff --git a/github/CommitComment.pyi b/github/CommitComment.pyi new file mode 100644 index 00000000..8677bb6f --- /dev/null +++ b/github/CommitComment.pyi @@ -0,0 +1,37 @@ +from datetime import datetime +from typing import Any, Dict, Optional + +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList +from github.Reaction import Reaction + +class CommitComment: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def body(self) -> str: ... + @property + def commit_id(self) -> str: ... + def create_reaction(self, reaction_type: str) -> Reaction: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + def edit(self, body: str) -> None: ... + def get_reactions(self) -> PaginatedList: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def line(self) -> Optional[int]: ... + @property + def path(self) -> Optional[str]: ... + @property + def position(self) -> Optional[int]: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/CommitStats.pyi b/github/CommitStats.pyi new file mode 100644 index 00000000..80f86d53 --- /dev/null +++ b/github/CommitStats.pyi @@ -0,0 +1,11 @@ +from typing import Dict + +class CommitStats: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, int]) -> None: ... + @property + def additions(self) -> int: ... + @property + def deletions(self) -> int: ... + @property + def total(self) -> int: ... diff --git a/github/CommitStatus.pyi b/github/CommitStatus.pyi new file mode 100644 index 00000000..f9847ac6 --- /dev/null +++ b/github/CommitStatus.pyi @@ -0,0 +1,27 @@ +from datetime import datetime +from typing import Any, Dict, Optional + +from github.NamedUser import NamedUser + +class CommitStatus: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def context(self) -> str: ... + @property + def created_at(self) -> datetime: ... + @property + def creator(self) -> NamedUser: ... + @property + def description(self) -> Optional[str]: ... + @property + def id(self) -> int: ... + @property + def state(self) -> str: ... + @property + def target_url(self) -> Optional[str]: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/Comparison.pyi b/github/Comparison.pyi new file mode 100644 index 00000000..3d90e2e0 --- /dev/null +++ b/github/Comparison.pyi @@ -0,0 +1,34 @@ +from typing import Any, Dict, List + +from github.Commit import Commit +from github.File import File + +class Comparison: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def ahead_by(self) -> int: ... + @property + def base_commit(self) -> Commit: ... + @property + def behind_by(self) -> int: ... + @property + def commits(self) -> List[Commit]: ... + @property + def diff_url(self) -> str: ... + @property + def files(self) -> List[File]: ... + @property + def html_url(self) -> str: ... + @property + def merge_base_commit(self) -> Commit: ... + @property + def patch_url(self) -> str: ... + @property + def permalink_url(self) -> str: ... + @property + def status(self) -> str: ... + @property + def total_commits(self) -> int: ... + @property + def url(self) -> str: ... diff --git a/github/ContentFile.py b/github/ContentFile.py index 9b7d09dd..68faab8b 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -55,6 +55,9 @@ class ContentFile(github.GithubObject.CompletableGithubObject): @property def decoded_content(self): + """ + :type: bytes + """ assert self.encoding == "base64", "unsupported encoding: %s" % self.encoding return base64.b64decode(bytearray(self.content, "utf-8")) diff --git a/github/ContentFile.pyi b/github/ContentFile.pyi new file mode 100644 index 00000000..4e455607 --- /dev/null +++ b/github/ContentFile.pyi @@ -0,0 +1,39 @@ +from typing import Any, Dict, List, Optional + +from github.License import License +from github.Repository import Repository + +class ContentFile: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def content(self) -> Optional[str]: ... + @property + def decoded_content(self) -> bytes: ... + @property + def download_url(self) -> str: ... + @property + def encoding(self) -> str: ... + @property + def git_url(self) -> str: ... + @property + def html_url(self) -> str: ... + @property + def name(self) -> str: ... + @property + def path(self) -> str: ... + @property + def repository(self) -> Repository: ... + @property + def sha(self) -> str: ... + @property + def size(self) -> int: ... + @property + def text_matches(self) -> List[Dict[str, Any]]: ... + @property + def type(self) -> str: ... + @property + def url(self) -> str: ... + @property + def license(self) -> License: ... diff --git a/github/Download.pyi b/github/Download.pyi new file mode 100644 index 00000000..85c345b8 --- /dev/null +++ b/github/Download.pyi @@ -0,0 +1,48 @@ +from datetime import datetime +from typing import Any, Dict, Optional + +class Download: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def accesskeyid(self) -> Optional[str]: ... + @property + def acl(self) -> Optional[str]: ... + @property + def bucket(self) -> Optional[str]: ... + @property + def content_type(self) -> Optional[str]: ... + @property + def created_at(self) -> Optional[datetime]: ... + def delete(self) -> None: ... + @property + def description(self) -> Optional[str]: ... + @property + def download_count(self) -> Optional[int]: ... + @property + def expirationdate(self) -> Optional[datetime]: ... + @property + def html_url(self) -> Optional[str]: ... + @property + def id(self) -> int: ... + @property + def mime_type(self) -> Optional[str]: ... + @property + def name(self) -> Optional[str]: ... + @property + def path(self) -> Optional[str]: ... + @property + def policy(self) -> Optional[str]: ... + @property + def prefix(self) -> Optional[str]: ... + @property + def redirect(self) -> Optional[bool]: ... + @property + def s3_url(self) -> Optional[str]: ... + @property + def signature(self) -> Optional[str]: ... + @property + def size(self) -> Optional[int]: ... + @property + def url(self) -> Optional[str]: ... diff --git a/github/Event.pyi b/github/Event.pyi new file mode 100644 index 00000000..68ef9246 --- /dev/null +++ b/github/Event.pyi @@ -0,0 +1,27 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser +from github.Organization import Organization +from github.Repository import Repository + +class Event: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def actor(self) -> NamedUser: ... + @property + def created_at(self) -> datetime: ... + @property + def id(self) -> str: ... + @property + def org(self) -> Organization: ... + @property + def payload(self) -> Dict[str, Any]: ... + @property + def public(self) -> bool: ... + @property + def repo(self) -> Repository: ... + @property + def type(self) -> str: ... diff --git a/github/File.pyi b/github/File.pyi new file mode 100644 index 00000000..a17cb0fa --- /dev/null +++ b/github/File.pyi @@ -0,0 +1,28 @@ +from typing import Any, Dict + +class File: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def additions(self) -> int: ... + @property + def blob_url(self) -> str: ... + @property + def changes(self) -> int: ... + @property + def contents_url(self) -> str: ... + @property + def deletions(self) -> int: ... + @property + def filename(self) -> str: ... + @property + def patch(self) -> str: ... + @property + def raw_url(self) -> str: ... + @property + def sha(self) -> str: ... + @property + def status(self) -> str: ... + @property + def previous_filename(self) -> str: ... diff --git a/github/Gist.pyi b/github/Gist.pyi new file mode 100644 index 00000000..60217887 --- /dev/null +++ b/github/Gist.pyi @@ -0,0 +1,66 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional, Union + +from github.GistComment import GistComment +from github.GistFile import GistFile +from github.GistHistoryState import GistHistoryState +from github.GithubObject import _NotSetType +from github.InputFileContent import InputFileContent +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList + +class Gist: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def comments(self) -> int: ... + @property + def comments_url(self) -> str: ... + @property + def commits_url(self) -> str: ... + def create_comment(self, body: str) -> GistComment: ... + def create_fork(self) -> Gist: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + @property + def description(self) -> Optional[str]: ... + def edit( + self, + description: Union[_NotSetType, str] = ..., + files: Union[_NotSetType, Dict[str, Optional[InputFileContent]]] = ..., + ) -> None: ... + @property + def files(self) -> Dict[str, GistFile]: ... + @property + def fork_of(self) -> Optional[Gist]: ... + @property + def forks(self) -> List[Gist]: ... + @property + def forks_url(self) -> str: ... + def get_comment(self, id: int) -> GistComment: ... + def get_comments(self) -> PaginatedList: ... + @property + def git_pull_url(self) -> str: ... + @property + def git_push_url(self) -> str: ... + @property + def history(self) -> List[GistHistoryState]: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> str: ... + def is_starred(self) -> bool: ... + @property + def owner(self) -> NamedUser: ... + @property + def public(self) -> bool: ... + def reset_starred(self) -> None: ... + def set_starred(self) -> None: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> Optional[NamedUser]: ... diff --git a/github/GistComment.pyi b/github/GistComment.pyi new file mode 100644 index 00000000..c418007f --- /dev/null +++ b/github/GistComment.pyi @@ -0,0 +1,23 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser + +class GistComment: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def body(self) -> str: ... + @property + def created_at(self) -> datetime: ... + @property + def id(self) -> int: ... + def delete(self) -> None: ... + def edit(self, body: str) -> None: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/GistFile.pyi b/github/GistFile.pyi new file mode 100644 index 00000000..53d0c41b --- /dev/null +++ b/github/GistFile.pyi @@ -0,0 +1,18 @@ +from typing import Any, Dict, Optional + +class GistFile: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def content(self) -> str: ... + @property + def filename(self) -> str: ... + @property + def language(self) -> Optional[str]: ... + @property + def raw_url(self) -> str: ... + @property + def size(self) -> int: ... + @property + def type(self) -> str: ... diff --git a/github/GistHistoryState.pyi b/github/GistHistoryState.pyi new file mode 100644 index 00000000..7aa24d19 --- /dev/null +++ b/github/GistHistoryState.pyi @@ -0,0 +1,53 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional + +from github.CommitStats import CommitStats +from github.Gist import Gist +from github.GistFile import GistFile +from github.NamedUser import NamedUser + +class GistHistoryState: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def change_status(self) -> CommitStats: ... + @property + def comments(self) -> int: ... + @property + def comments_url(self) -> str: ... + @property + def commits_url(self) -> str: ... + @property + def committed_at(self) -> datetime: ... + @property + def created_at(self) -> datetime: ... + @property + def description(self) -> str: ... + @property + def files(self) -> Dict[str, GistFile]: ... + @property + def forks(self) -> List[Gist]: ... + @property + def forks_url(self) -> str: ... + @property + def git_pull_url(self) -> str: ... + @property + def git_push_url(self) -> str: ... + @property + def history(self) -> List[GistHistoryState]: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> str: ... + @property + def owner(self) -> NamedUser: ... + @property + def public(self) -> bool: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> Optional[NamedUser]: ... + @property + def version(self) -> str: ... diff --git a/github/GitAuthor.pyi b/github/GitAuthor.pyi new file mode 100644 index 00000000..761c7f39 --- /dev/null +++ b/github/GitAuthor.pyi @@ -0,0 +1,13 @@ +from datetime import datetime +from typing import Dict + +class GitAuthor: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, str]) -> None: ... + @property + def date(self) -> datetime: ... + @property + def email(self) -> str: ... + @property + def name(self) -> str: ... diff --git a/github/GitBlob.pyi b/github/GitBlob.pyi new file mode 100644 index 00000000..18c4106d --- /dev/null +++ b/github/GitBlob.pyi @@ -0,0 +1,16 @@ +from typing import Any, Dict + +class GitBlob: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def content(self) -> str: ... + @property + def encoding(self) -> str: ... + @property + def sha(self) -> str: ... + @property + def size(self) -> int: ... + @property + def url(self) -> str: ... diff --git a/github/GitCommit.pyi b/github/GitCommit.pyi new file mode 100644 index 00000000..fdcab79d --- /dev/null +++ b/github/GitCommit.pyi @@ -0,0 +1,27 @@ +from typing import Any, Dict, List + +from github.GitAuthor import GitAuthor +from github.GitTree import GitTree + +class GitCommit: + def __repr__(self) -> str: ... + @property + def _identity(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def author(self) -> GitAuthor: ... + @property + def committer(self) -> GitAuthor: ... + @property + def html_url(self) -> str: ... + @property + def message(self) -> str: ... + @property + def parents(self) -> List[GitCommit]: ... + @property + def sha(self) -> str: ... + @property + def tree(self) -> GitTree: ... + @property + def url(self) -> str: ... diff --git a/github/GitObject.pyi b/github/GitObject.pyi new file mode 100644 index 00000000..8638dae6 --- /dev/null +++ b/github/GitObject.pyi @@ -0,0 +1,11 @@ +from typing import Dict + +class GitObject: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, str]) -> None: ... + @property + def sha(self) -> str: ... + @property + def type(self) -> str: ... + @property + def url(self) -> str: ... diff --git a/github/GitRef.pyi b/github/GitRef.pyi new file mode 100644 index 00000000..05cda2dc --- /dev/null +++ b/github/GitRef.pyi @@ -0,0 +1,19 @@ +from typing import Any, Dict, Union + +from github.GithubObject import _NotSetType +from github.GitObject import GitObject + +class GitRef: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + def delete(self) -> None: ... + def edit(self, sha: str, force: Union[bool, _NotSetType] = ...) -> None: ... + def get_statuses(self) -> None: ... + def get_status(self) -> None: ... + @property + def object(self) -> GitObject: ... + @property + def ref(self) -> str: ... + @property + def url(self) -> str: ... diff --git a/github/GitRelease.py b/github/GitRelease.py index 712f7243..7c3a738b 100644 --- a/github/GitRelease.py +++ b/github/GitRelease.py @@ -188,6 +188,12 @@ class GitRelease(github.GithubObject.CompletableGithubObject): ): """ :calls: `PATCH /repos/:owner/:repo/releases/:release_id `_ + :param name: string + :param message: string + :param draft: bool + :param prerelease: bool + :param tag_name: string + :param target_commitish: string :rtype: :class:`github.GitRelease.GitRelease` """ assert tag_name is github.GithubObject.NotSet or isinstance( @@ -229,6 +235,10 @@ class GitRelease(github.GithubObject.CompletableGithubObject): ): """ :calls: `POST https:///repos/:owner/:repo/releases/:release_id/assets `_ + :param path: string + :param label: string + :param content_type: string + :param name: string :rtype: :class:`github.GitReleaseAsset.GitReleaseAsset` """ assert isinstance(path, str), path diff --git a/github/GitRelease.pyi b/github/GitRelease.pyi new file mode 100644 index 00000000..6976cd06 --- /dev/null +++ b/github/GitRelease.pyi @@ -0,0 +1,60 @@ +from datetime import datetime +from typing import Any, Dict, Union + +from github.GithubObject import _NotSetType +from github.GitReleaseAsset import GitReleaseAsset +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList + +class GitRelease: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def author(self) -> NamedUser: ... + @property + def body(self) -> str: ... + @property + def created_at(self) -> datetime: ... + def delete_release(self) -> None: ... + @property + def draft(self) -> bool: ... + def get_assets(self) -> PaginatedList: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def prerelease(self) -> bool: ... + @property + def published_at(self) -> datetime: ... + @property + def tag_name(self) -> str: ... + @property + def tarball_url(self) -> str: ... + @property + def target_commitish(self) -> str: ... + @property + def title(self) -> str: ... + def update_release( + self, + name: str, + message: str, + draft: bool = ..., + prerelease: bool = ..., + tag_name: Union[str, _NotSetType] = ..., + target_commitish: Union[str, _NotSetType] = ..., + ) -> GitRelease: ... + def upload_asset( + self, + path: str, + label: str = ..., + content_type: Union[_NotSetType, str] = ..., + name: Union[_NotSetType, str] = ..., + ) -> GitReleaseAsset: ... + @property + def upload_url(self) -> str: ... + @property + def url(self) -> str: ... + @property + def zipball_url(self) -> str: ... diff --git a/github/GitReleaseAsset.pyi b/github/GitReleaseAsset.pyi new file mode 100644 index 00000000..5df10de8 --- /dev/null +++ b/github/GitReleaseAsset.pyi @@ -0,0 +1,39 @@ +from datetime import datetime +from typing import Any, Dict, Union + +from github.NamedUser import NamedUser + +class GitReleaseAsset: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def browser_download_url(self) -> str: ... + @property + def content_type(self) -> str: ... + @property + def created_at(self) -> datetime: ... + def delete_asset(self) -> bool: ... + @property + def download_count(self) -> int: ... + @property + def id(self) -> int: ... + @property + def label(self) -> str: ... + @label.setter + def label(self, value: str) -> None: ... + @property + def name(self) -> str: ... + @name.setter + def name(self, value: str) -> None: ... + @property + def size(self) -> int: ... + @property + def state(self) -> str: ... + def update_asset(self, name: str, label: str = ...) -> GitReleaseAsset: ... + @property + def updated_at(self) -> datetime: ... + @property + def uploader(self) -> NamedUser: ... + @property + def url(self) -> str: ... diff --git a/github/GitTag.pyi b/github/GitTag.pyi new file mode 100644 index 00000000..770cdaf7 --- /dev/null +++ b/github/GitTag.pyi @@ -0,0 +1,21 @@ +from typing import Any, Dict, Union + +from github.GitAuthor import GitAuthor +from github.GitObject import GitObject + +class GitTag: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def message(self) -> str: ... + @property + def object(self) -> GitObject: ... + @property + def sha(self) -> str: ... + @property + def tag(self) -> str: ... + @property + def tagger(self) -> GitAuthor: ... + @property + def url(self) -> str: ... diff --git a/github/GitTree.pyi b/github/GitTree.pyi new file mode 100644 index 00000000..e5f2fdef --- /dev/null +++ b/github/GitTree.pyi @@ -0,0 +1,16 @@ +from typing import Any, Dict, List + +from github.GitTreeElement import GitTreeElement + +class GitTree: + def __repr__(self) -> str: ... + @property + def _identity(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def sha(self) -> str: ... + @property + def tree(self) -> List[GitTreeElement]: ... + @property + def url(self) -> str: ... diff --git a/github/GitTreeElement.pyi b/github/GitTreeElement.pyi new file mode 100644 index 00000000..92cd6732 --- /dev/null +++ b/github/GitTreeElement.pyi @@ -0,0 +1,18 @@ +from typing import Any, Dict, Optional + +class GitTreeElement: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def mode(self) -> str: ... + @property + def path(self) -> str: ... + @property + def sha(self) -> str: ... + @property + def size(self) -> Optional[int]: ... + @property + def type(self) -> str: ... + @property + def url(self) -> str: ... diff --git a/github/GithubException.pyi b/github/GithubException.pyi new file mode 100644 index 00000000..ff70e5b0 --- /dev/null +++ b/github/GithubException.pyi @@ -0,0 +1,35 @@ +from typing import Any, Dict, List, Optional, Tuple, Type, Union + +class BadAttributeException: + def __init__( + self, + actualValue: Any, + expectedType: Union[ + Dict[Tuple[Type[str], Type[str]], Type[dict]], + Tuple[Type[str], Type[str]], + List[Type[dict]], + List[Tuple[Type[str], Type[str]]], + ], + transformationException: Optional[ValueError], + ) -> None: ... + @property + def actual_value(self) -> Any: ... + @property + def expected_type( + self, + ) -> Union[ + List[Type[dict]], + Tuple[Type[str], Type[str]], + Dict[Tuple[Type[str], Type[str]], Type[dict]], + List[Tuple[Type[str], Type[str]]], + ]: ... + @property + def transformation_exception(self) -> Optional[ValueError]: ... + +class GithubException: + def __init__(self, status: Union[int, str], data: Any,) -> None: ... + def __str__(self) -> str: ... + @property + def data(self) -> Dict[str, Union[str, List[str], List[Dict[str, str]]]]: ... + @property + def status(self) -> int: ... diff --git a/github/GithubObject.pyi b/github/GithubObject.pyi new file mode 100644 index 00000000..df0b5a3c --- /dev/null +++ b/github/GithubObject.pyi @@ -0,0 +1,124 @@ +from typing import Any, Callable, Dict, List, Optional, Type, Union + +from github.Commit import Commit +from github.GistFile import GistFile +from github.GitRelease import GitRelease +from github.NamedUser import NamedUser +from github.Organization import Organization +from github.PullRequestReview import PullRequestReview +from github.Requester import Requester + +class CompletableGithubObject: + def __eq__(self, other: Any) -> bool: ... + def __init__( + self, + requester: Requester, + headers: Dict[str, Union[str, int]], + attributes: Dict[str, Any], + completed: bool, + ) -> None: ... + def __ne__(self, other: Any) -> bool: ... + def _completeIfNeeded(self) -> None: ... + def _completeIfNotSet( + self, value: Union[_ValuedAttribute, _BadAttribute, _NotSetType] + ) -> None: ... + def update(self) -> bool: ... + +class GithubObject: + def __init__( + self, + requester: Optional[Requester], + headers: Dict[str, Union[str, int]], + attributes: Any, + completed: bool, + ) -> None: ... + @staticmethod + def _makeBoolAttribute(value: Optional[bool]) -> _ValuedAttribute: ... + def _makeClassAttribute( + self, klass: Any, value: Any + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def _makeDatetimeAttribute( + value: Optional[Union[int, str]] + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def _makeDictAttribute(value: Dict[str, Any]) -> _ValuedAttribute: ... + def _makeDictOfStringsToClassesAttribute( + self, + klass: Type[GistFile], + value: Dict[ + str, + Union[int, Dict[str, Union[str, int, None]], Dict[str, Union[str, int]]], + ], + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def _makeIntAttribute( + value: Optional[Union[int, str]] + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + def _makeListOfClassesAttribute( + self, klass: Any, value: Any + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def _makeListOfDictsAttribute( + value: List[Dict[str, Union[str, List[Dict[str, Union[str, List[int]]]]]]] + ) -> _ValuedAttribute: ... + @staticmethod + def _makeListOfIntsAttribute(value: List[int]) -> _ValuedAttribute: ... + @staticmethod + def _makeListOfListOfStringsAttribute( + value: List[List[str]], + ) -> _ValuedAttribute: ... + @staticmethod + def _makeListOfStringsAttribute( + value: Union[List[List[str]], List[str], List[Union[str, int]]] + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def __makeSimpleAttribute( + value: Any, type: type + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def __makeSimpleListAttribute( + value: list, type: type + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def __makeTransformedAttribute( + value: Any, type: type, transform: Callable[..., Any] + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def _makeStringAttribute( + value: Optional[Union[int, str]] + ) -> Union[_ValuedAttribute, _BadAttribute]: ... + @staticmethod + def _makeTimestampAttribute(value: int) -> _ValuedAttribute: ... + @staticmethod + def _parentUrl(url: str) -> str: ... + def _storeAndUseAttributes( + self, headers: Dict[str, Union[str, int]], attributes: Any + ) -> None: ... + @property + def etag(self) -> Optional[str]: ... + def get__repr__(self, params: Dict[str, Any]) -> str: ... + @property + def last_modified(self) -> Optional[str]: ... + @property + def raw_data(self) -> Dict[str, Any]: ... + @property + def raw_headers(self) -> Dict[str, Union[str, int]]: ... + @classmethod + def setCheckAfterInitFlag(cls, flag: bool) -> None: ... + +class NonCompletableGithubObject: + def _completeIfNeeded(self) -> None: ... + +class _BadAttribute: + def __init__( + self, value: Any, expectedType: Any, exception: Optional[ValueError] = ... + ) -> None: ... + @property + def value(self): ... + +class _NotSetType: + def __repr__(self) -> str: ... + +class _ValuedAttribute: + def __init__(self, value: Any) -> None: ... diff --git a/github/GitignoreTemplate.pyi b/github/GitignoreTemplate.pyi new file mode 100644 index 00000000..0fb9960b --- /dev/null +++ b/github/GitignoreTemplate.pyi @@ -0,0 +1,10 @@ +from typing import Any, Dict + +class GitignoreTemplate: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def name(self) -> str: ... + @property + def source(self) -> str: ... diff --git a/github/Hook.pyi b/github/Hook.pyi new file mode 100644 index 00000000..865b5b7f --- /dev/null +++ b/github/Hook.pyi @@ -0,0 +1,44 @@ +from datetime import datetime +from typing import Any, Dict, List, Union + +from github.GithubObject import _NotSetType +from github.HookResponse import HookResponse + +class Hook: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def active(self) -> bool: ... + @property + def config(self) -> Dict[str, str]: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + def edit( + self, + name: str, + config: Dict[str, str], + events: Union[_NotSetType, List[str]] = ..., + add_events: Union[_NotSetType, List[str]] = ..., + remove_events: Union[_NotSetType, List[str]] = ..., + active: Union[bool, _NotSetType] = ..., + ) -> None: ... + @property + def events(self) -> List[str]: ... + @property + def id(self) -> int: ... + @property + def last_response(self) -> HookResponse: ... + @property + def name(self) -> str: ... + def ping(self) -> None: ... + @property + def ping_url(self) -> str: ... + def test(self) -> None: ... + @property + def test_url(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/HookDescription.pyi b/github/HookDescription.pyi new file mode 100644 index 00000000..92b66ce0 --- /dev/null +++ b/github/HookDescription.pyi @@ -0,0 +1,14 @@ +from typing import Any, Dict, List + +class HookDescription: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def events(self) -> List[str]: ... + @property + def name(self) -> str: ... + @property + def schema(self) -> List[List[str]]: ... + @property + def supported_events(self) -> List[str]: ... diff --git a/github/HookResponse.pyi b/github/HookResponse.pyi new file mode 100644 index 00000000..346c014b --- /dev/null +++ b/github/HookResponse.pyi @@ -0,0 +1,12 @@ +from typing import Any, Dict + +class HookResponse: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def code(self) -> int: ... + @property + def message(self) -> str: ... + @property + def status(self) -> str: ... diff --git a/github/InputFileContent.pyi b/github/InputFileContent.pyi new file mode 100644 index 00000000..8a71faff --- /dev/null +++ b/github/InputFileContent.pyi @@ -0,0 +1,10 @@ +from typing import Dict, Union + +from github.GithubObject import _NotSetType + +class InputFileContent: + def __init__( + self, content: str, new_name: Union[str, _NotSetType] = ... + ) -> None: ... + @property + def _identity(self) -> Dict[str, str]: ... diff --git a/github/InputGitAuthor.pyi b/github/InputGitAuthor.pyi new file mode 100644 index 00000000..ab812fa0 --- /dev/null +++ b/github/InputGitAuthor.pyi @@ -0,0 +1,10 @@ +from typing import Dict, Union + +from github.GithubObject import _NotSetType + +class InputGitAuthor: + def __init__( + self, name: str, email: str, date: Union[str, _NotSetType] = ... + ) -> None: ... + @property + def _identity(self) -> Dict[str, str]: ... diff --git a/github/InputGitTreeElement.pyi b/github/InputGitTreeElement.pyi new file mode 100644 index 00000000..2315a2c3 --- /dev/null +++ b/github/InputGitTreeElement.pyi @@ -0,0 +1,15 @@ +from typing import Dict, Union + +from github.GithubObject import _NotSetType + +class InputGitTreeElement: + def __init__( + self, + path: str, + mode: str, + type: str, + content: Union[str, _NotSetType] = ..., + sha: Union[str, _NotSetType] = ..., + ) -> None: ... + @property + def _identity(self) -> Dict[str, str]: ... diff --git a/github/Installation.pyi b/github/Installation.pyi new file mode 100644 index 00000000..3eb8bdaf --- /dev/null +++ b/github/Installation.pyi @@ -0,0 +1,11 @@ +from typing import Any, Dict + +from github.GithubObject import _ValuedAttribute +from github.PaginatedList import PaginatedList + +class Installation: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def id(self) -> _ValuedAttribute: ... + def get_repos(self) -> PaginatedList: ... diff --git a/github/InstallationAuthorization.pyi b/github/InstallationAuthorization.pyi new file mode 100644 index 00000000..bb4b3aa2 --- /dev/null +++ b/github/InstallationAuthorization.pyi @@ -0,0 +1,15 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser + +class InstallationAuthorization: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def expires_at(self) -> datetime: ... + @property + def on_behalf_of(self) -> NamedUser: ... + @property + def token(self) -> str: ... diff --git a/github/Invitation.pyi b/github/Invitation.pyi new file mode 100644 index 00000000..5314e662 --- /dev/null +++ b/github/Invitation.pyi @@ -0,0 +1,25 @@ +from typing import Any, Dict + +from github.NamedUser import NamedUser +from github.Repository import Repository + +class Invitation: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def created_at(self) -> str: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def invitee(self) -> NamedUser: ... + @property + def inviter(self) -> NamedUser: ... + @property + def permissions(self) -> str: ... + @property + def repository(self) -> Repository: ... + @property + def url(self) -> str: ... diff --git a/github/Issue.pyi b/github/Issue.pyi new file mode 100644 index 00000000..b38449bc --- /dev/null +++ b/github/Issue.pyi @@ -0,0 +1,96 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional, Union + +from github.GithubObject import _NotSetType +from github.IssueComment import IssueComment +from github.IssuePullRequest import IssuePullRequest +from github.Label import Label +from github.Milestone import Milestone +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList +from github.PullRequest import PullRequest +from github.Reaction import Reaction +from github.Repository import Repository + +class Issue: + def __repr__(self) -> str: ... + @property + def _identity(self) -> int: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + def add_to_assignees(self, *assignees: Union[NamedUser, str]) -> None: ... + def add_to_labels(self, *labels: Union[Label, str]) -> None: ... + def as_pull_request(self) -> PullRequest: ... + @property + def active_lock_reason(self) -> str: ... + @property + def assignee(self) -> Optional[NamedUser]: ... + @property + def assignees(self) -> List[NamedUser]: ... + @property + def body(self) -> str: ... + @property + def closed_at(self) -> datetime: ... + @property + def closed_by(self) -> NamedUser: ... + @property + def comments(self) -> int: ... + @property + def comments_url(self) -> str: ... + def create_comment(self, body: str) -> IssueComment: ... + def create_reaction(self, reaction_type: str) -> Reaction: ... + @property + def created_at(self) -> datetime: ... + def delete_labels(self) -> None: ... + def edit( + self, + title: Union[str, _NotSetType] = ..., + body: Union[str, _NotSetType] = ..., + assignee: Optional[Union[str, _NotSetType, NamedUser]] = ..., + state: Union[str, _NotSetType] = ..., + milestone: Optional[Union[Milestone, _NotSetType]] = ..., + labels: Union[_NotSetType, List[str]] = ..., + assignees: Union[_NotSetType, List[str]] = ..., + ) -> None: ... + @property + def events_url(self) -> str: ... + def get_comment(self, id: int) -> IssueComment: ... + def get_comments( + self, since: Union[_NotSetType, datetime] = ... + ) -> PaginatedList: ... + def get_events(self) -> PaginatedList: ... + def get_labels(self) -> PaginatedList: ... + def get_reactions(self) -> PaginatedList: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def labels(self) -> List[Label]: ... + @property + def labels_url(self) -> str: ... + def lock(self, lock_reason: str) -> None: ... + @property + def locked(self) -> bool: ... + @property + def milestone(self) -> Optional[Milestone]: ... + @property + def number(self) -> int: ... + @property + def pull_request(self) -> IssuePullRequest: ... + def remove_from_assignees(self, *assignees: Union[NamedUser, str]) -> None: ... + def remove_from_labels(self, label: Union[str, Label]) -> None: ... + @property + def repository(self) -> Repository: ... + def set_labels(self, *labels: Union[str, Label]) -> None: ... + @property + def state(self) -> str: ... + @property + def title(self) -> str: ... + def unlock(self) -> None: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/IssueComment.pyi b/github/IssueComment.pyi new file mode 100644 index 00000000..42d2736f --- /dev/null +++ b/github/IssueComment.pyi @@ -0,0 +1,31 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList +from github.Reaction import Reaction + +class IssueComment: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def body(self) -> str: ... + def create_reaction(self, reaction_type: str) -> Reaction: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + def edit(self, body: str) -> None: ... + def get_reactions(self) -> PaginatedList: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def issue_url(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/IssueEvent.pyi b/github/IssueEvent.pyi new file mode 100644 index 00000000..3b0ce3d8 --- /dev/null +++ b/github/IssueEvent.pyi @@ -0,0 +1,43 @@ +from typing import Any, Dict, Optional, Union + +from github.Issue import Issue +from github.Label import Label +from github.Milestone import Milestone +from github.NamedUser import NamedUser + +class IssueEvent: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def actor(self) -> NamedUser: ... + @property + def assignee(self) -> Optional[NamedUser]: ... + @property + def assigner(self) -> Optional[NamedUser]: ... + @property + def commit_id(self) -> Optional[str]: ... + @property + def commit_url(self) -> Optional[str]: ... + @property + def dismissed_review(self) -> Optional[Dict[str, Union[str, int]]]: ... + @property + def event(self) -> str: ... + @property + def issue(self) -> Issue: ... + @property + def label(self) -> Optional[Label]: ... + @property + def lock_reason(self) -> Optional[str]: ... + @property + def milestone(self) -> Optional[Milestone]: ... + @property + def node_id(self) -> str: ... + @property + def rename(self) -> Optional[Dict[str, str]]: ... + @property + def requested_reviewer(self) -> Optional[NamedUser]: ... + @property + def review_requester(self) -> Optional[NamedUser]: ... + @property + def url(self) -> str: ... diff --git a/github/IssuePullRequest.pyi b/github/IssuePullRequest.pyi new file mode 100644 index 00000000..9575f3d5 --- /dev/null +++ b/github/IssuePullRequest.pyi @@ -0,0 +1,11 @@ +from typing import Any, Dict + +class IssuePullRequest: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def diff_url(self) -> str: ... + @property + def html_url(self) -> str: ... + @property + def patch_url(self) -> str: ... diff --git a/github/Label.pyi b/github/Label.pyi new file mode 100644 index 00000000..c47e5549 --- /dev/null +++ b/github/Label.pyi @@ -0,0 +1,22 @@ +from typing import Any, Dict, Optional, Union + +from github.GithubObject import _NotSetType + +class Label: + def __repr__(self) -> str: ... + @property + def _identity(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def color(self) -> str: ... + def delete(self) -> None: ... + @property + def description(self) -> Optional[str]: ... + def edit( + self, name: str, color: str, description: Union[str, _NotSetType] = ... + ) -> None: ... + @property + def name(self) -> str: ... + @property + def url(self) -> str: ... diff --git a/github/License.pyi b/github/License.pyi new file mode 100644 index 00000000..f3070be1 --- /dev/null +++ b/github/License.pyi @@ -0,0 +1,28 @@ +from typing import Any, Dict, List + +class License: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def body(self) -> str: ... + @property + def conditions(self) -> List[str]: ... + @property + def description(self) -> str: ... + @property + def html_url(self) -> str: ... + @property + def implementation(self) -> str: ... + @property + def key(self) -> str: ... + @property + def limitations(self) -> List[str]: ... + @property + def name(self) -> str: ... + @property + def permissions(self) -> List[str]: ... + @property + def url(self) -> str: ... + @property + def spdx_id(self) -> str: ... diff --git a/github/MainClass.py b/github/MainClass.py index 829a7e44..7aabba3f 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -113,6 +113,7 @@ class Github(object): :param client_secret: string :param user_agent: string :param per_page: int + :param api_preview: bool :param verify: boolean or string :param retry: int or urllib3.util.retry.Retry object """ @@ -768,7 +769,7 @@ class GithubIntegration(object): The expiration can be extended beyond this, to a maximum of 600 seconds. :param expiration: int - :return: + :return string: """ now = int(time.time()) payload = {"iat": now, "exp": now + expiration, "iss": self.integration_id} diff --git a/github/MainClass.pyi b/github/MainClass.pyi new file mode 100644 index 00000000..8c03073b --- /dev/null +++ b/github/MainClass.pyi @@ -0,0 +1,133 @@ +from datetime import datetime +from io import BytesIO +from typing import Any, Dict, List, Optional, Tuple, Type, Union + +from github.AuthenticatedUser import AuthenticatedUser +from github.Gist import Gist +from github.GithubObject import _NotSetType +from github.GitignoreTemplate import GitignoreTemplate +from github.HookDescription import HookDescription +from github.Installation import Installation +from github.InstallationAuthorization import InstallationAuthorization +from github.License import License +from github.NamedUser import NamedUser +from github.Organization import Organization +from github.PaginatedList import PaginatedList +from github.Project import Project +from github.RateLimit import RateLimit +from github.Repository import Repository + +# from urllib3.util.retry import Retry + +class Github: + def __init__( + self, + login_or_token: Optional[str] = ..., + password: Optional[str] = ..., + jwt: Optional[str] = ..., + base_url: str = ..., + timeout: int = ..., + client_id: Optional[str] = ..., + client_secret: Optional[str] = ..., + user_agent: str = ..., + per_page: int = ..., + api_preview: bool = ..., + verify: bool = ..., + retry: Any = ..., + ) -> None: ... + def __get_FIX_REPO_GET_GIT_REF(self) -> bool: ... + def __set_FIX_REPO_GET_GIT_REF(self, value: bool) -> None: ... + def __get_per_page(self) -> int: ... + def __set_per_page(self, value: int) -> None: ... + def create_from_raw_data( + self, + klass: Union[Type[Repository], Type[NamedUser]], + raw_data: Dict[str, Any], + headers: Dict[str, Union[str, int]] = ..., + ) -> Union[Repository, NamedUser]: ... + def dump(self, obj: Repository, file: BytesIO, protocol: int = ...) -> None: ... + def get_emojis(self) -> Dict[str, str]: ... + def get_gist(self, id: str) -> Gist: ... + def get_gists(self, since: Union[datetime, _NotSetType] = ...) -> PaginatedList: ... + def get_gitignore_template(self, name: str) -> GitignoreTemplate: ... + def get_gitignore_templates(self) -> List[str]: ... + def get_hook(self, name: str) -> HookDescription: ... + def get_hooks(self) -> List[HookDescription]: ... + def get_installation(self, id: int) -> Installation: ... + def get_license(self, key: Union[str, _NotSetType] = ...) -> License: ... + def get_licenses(self) -> PaginatedList: ... + def get_organization(self, login: str) -> Organization: ... + def get_organizations( + self, since: Union[int, _NotSetType] = ... + ) -> PaginatedList: ... + def get_project(self, id: int) -> Project: ... + def get_rate_limit(self) -> RateLimit: ... + def get_repo( + self, full_name_or_id: Union[int, str], lazy: bool = ... + ) -> Repository: ... + def get_repos( + self, + since: Union[int, _NotSetType] = ..., + visibility: Union[str, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_user( + self, login: Union[str, _NotSetType] = ... + ) -> Union[AuthenticatedUser, NamedUser]: ... + def get_users(self, since: Union[int, _NotSetType] = ...) -> PaginatedList: ... + def load(self, f: BytesIO) -> Repository: ... + @property + def oauth_scopes(self) -> Optional[List[str]]: ... + @property + def rate_limiting(self) -> Tuple[int, int]: ... + @property + def rate_limiting_resettime(self) -> int: ... + def render_markdown( + self, text: str, context: Union[Repository, _NotSetType] = ... + ) -> str: ... + def search_code( + self, + query: str, + sort: Union[str, _NotSetType] = ..., + order: Union[str, _NotSetType] = ..., + highlight: bool = ..., + **qualifiers + ) -> PaginatedList: ... + def search_commits( + self, + query: str, + sort: Union[str, _NotSetType] = ..., + order: Union[str, _NotSetType] = ..., + **qualifiers + ) -> PaginatedList: ... + def search_issues( + self, + query: str, + sort: Union[str, _NotSetType] = ..., + order: Union[str, _NotSetType] = ..., + **qualifiers + ) -> PaginatedList: ... + def search_repositories( + self, + query: str, + sort: Union[str, _NotSetType] = ..., + order: Union[str, _NotSetType] = ..., + **qualifiers + ) -> PaginatedList: ... + def search_topics(self, query: str, **qualifiers) -> PaginatedList: ... + def search_users( + self, + query: str, + sort: Union[str, _NotSetType] = ..., + order: Union[str, _NotSetType] = ..., + **qualifiers + ) -> PaginatedList: ... + +class GithubIntegration: + def __init__( + self, integration_id: Union[int, str], private_key: str, base_url: str = ... + ) -> None: ... + def create_jwt(self, expiration: int = ...) -> str: ... + def get_access_token( + self, installation_id: int, user_id: Optional[int] = ... + ) -> InstallationAuthorization: ... + def get_installation(self, owner: str, repo: str) -> Installation: ... diff --git a/github/Membership.pyi b/github/Membership.pyi new file mode 100644 index 00000000..d910ec71 --- /dev/null +++ b/github/Membership.pyi @@ -0,0 +1,19 @@ +from typing import Any, Dict + +from github.NamedUser import NamedUser +from github.Organization import Organization + +class Membership: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def url(self) -> str: ... + @property + def role(self) -> str: ... + @property + def organization_url(self) -> str: ... + @property + def organization(self) -> Organization: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/Migration.pyi b/github/Migration.pyi new file mode 100644 index 00000000..fa371f45 --- /dev/null +++ b/github/Migration.pyi @@ -0,0 +1,35 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional, Union + +from github.NamedUser import NamedUser +from github.Repository import Repository + +class Migration: + def __repr__(self): + str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + @property + def exclude_attachments(self) -> bool: ... + def get_archive_url(self) -> str: ... + def get_status(self) -> str: ... + @property + def guid(self) -> str: ... + @property + def id(self) -> int: ... + @property + def lock_repositories(self) -> bool: ... + @property + def owner(self) -> NamedUser: ... + @property + def repositories(self) -> List[Repository]: ... + @property + def state(self) -> str: ... + def unlock_repo(self, repo_name: str) -> None: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/Milestone.pyi b/github/Milestone.pyi new file mode 100644 index 00000000..4bf8d155 --- /dev/null +++ b/github/Milestone.pyi @@ -0,0 +1,49 @@ +from datetime import date, datetime +from typing import Any, Dict, Optional, Union + +from github.GithubObject import _NotSetType +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList + +class Milestone: + def __repr__(self) -> str: ... + @property + def _identity(self) -> int: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def closed_issues(self) -> int: ... + @property + def created_at(self): + datetime: ... + @property + def creator(self) -> NamedUser: ... + def delete(self) -> None: ... + @property + def description(self) -> str: ... + @property + def due_on(self) -> Optional[datetime]: ... + def edit( + self, + title: str, + state: Union[_NotSetType, str] = ..., + description: Union[_NotSetType, str] = ..., + due_on: Union[date, _NotSetType] = ..., + ) -> None: ... + def get_labels(self) -> PaginatedList: ... + @property + def id(self) -> int: ... + @property + def labels_url(self) -> str: ... + @property + def number(self) -> int: ... + @property + def open_issues(self) -> int: ... + @property + def state(self) -> str: ... + @property + def title(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/NamedUser.pyi b/github/NamedUser.pyi new file mode 100644 index 00000000..9d0f6d56 --- /dev/null +++ b/github/NamedUser.pyi @@ -0,0 +1,127 @@ +from datetime import datetime +from typing import Any, Dict, Optional, Union + +from github.GithubObject import _NotSetType +from github.Membership import Membership +from github.PaginatedList import PaginatedList +from github.Permissions import Permissions +from github.Plan import Plan +from github.Repository import Repository + +class NamedUser: + def __eq__(self, other: Any) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... + @property + def _identity(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def avatar_url(self) -> str: ... + @property + def bio(self) -> Optional[str]: ... + @property + def blog(self) -> str: ... + @property + def collaborators(self) -> Optional[int]: ... + @property + def company(self) -> str: ... + @property + def contributions(self) -> int: ... + @property + def created_at(self) -> datetime: ... + @property + def disk_usage(self) -> Optional[int]: ... + @property + def email(self) -> str: ... + @property + def events_url(self) -> str: ... + @property + def followers(self) -> int: ... + @property + def followers_url(self) -> str: ... + @property + def following(self) -> int: ... + @property + def following_url(self) -> str: ... + def get_events(self) -> PaginatedList: ... + def get_followers(self) -> PaginatedList: ... + def get_following(self) -> PaginatedList: ... + def get_gists(self, since: Union[_NotSetType, datetime] = ...) -> PaginatedList: ... + def get_keys(self) -> PaginatedList: ... + def get_organization_membership(self, org: int) -> Membership: ... + def get_orgs(self) -> PaginatedList: ... + def get_public_events(self) -> PaginatedList: ... + def get_public_received_events(self) -> PaginatedList: ... + def get_received_events(self) -> PaginatedList: ... + def get_repo(self, name: str) -> Repository: ... + def get_repos( + self, + type: Union[str, _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_starred(self) -> PaginatedList: ... + def get_subscriptions(self) -> PaginatedList: ... + def get_watched(self) -> PaginatedList: ... + @property + def gists_url(self) -> str: ... + @property + def gravatar_id(self) -> str: ... + def has_in_following(self, following: NamedUser) -> bool: ... + @property + def hireable(self) -> bool: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def invitation_teams_url(self) -> str: ... + @property + def inviter(self) -> NamedUser: ... + @property + def location(self) -> str: ... + @property + def login(self) -> str: ... + @property + def name(self) -> str: ... + @property + def node_id(self) -> str: ... + @property + def organizations_url(self) -> str: ... + @property + def owned_private_repos(self) -> Optional[int]: ... + @property + def permissions(self) -> Permissions: ... + @property + def plan(self) -> Optional[Plan]: ... + @property + def private_gists(self) -> Optional[int]: ... + @property + def public_gists(self) -> int: ... + @property + def public_repos(self) -> int: ... + @property + def received_events_url(self) -> str: ... + @property + def repos_url(self) -> str: ... + @property + def role(self) -> str: ... + @property + def site_admin(self) -> bool: ... + @property + def starred_url(self) -> str: ... + @property + def subscriptions_url(self) -> str: ... + @property + def suspended_at(self) -> Optional[datetime]: ... + @property + def team_count(self) -> int: ... + @property + def total_private_repos(self) -> Optional[int]: ... + @property + def type(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/Notification.py b/github/Notification.py index 174d59c2..8c4cb9b4 100644 --- a/github/Notification.py +++ b/github/Notification.py @@ -121,12 +121,18 @@ class Notification(github.GithubObject.CompletableGithubObject): headers, data = self._requester.requestJsonAndCheck("PATCH", self.url,) def get_pull_request(self): + """ + :type: :class:github.PullRequest.PullRequest + """ headers, data = self._requester.requestJsonAndCheck("GET", self.subject.url) return github.PullRequest.PullRequest( self._requester, headers, data, completed=True ) def get_issue(self): + """ + :type: :class:github.Issue.Issue + """ headers, data = self._requester.requestJsonAndCheck("GET", self.subject.url) return github.Issue.Issue(self._requester, headers, data, completed=True) diff --git a/github/Notification.pyi b/github/Notification.pyi new file mode 100644 index 00000000..3cf21c9a --- /dev/null +++ b/github/Notification.pyi @@ -0,0 +1,32 @@ +from datetime import datetime +from typing import Any, Dict, Optional + +from github.Issue import Issue +from github.NotificationSubject import NotificationSubject +from github.PullRequest import PullRequest +from github.Repository import Repository + +class Notification: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def id(self) -> str: ... + @property + def last_read_at(self) -> datetime: ... + def mark_as_read(self) -> None: ... + @property + def reason(self) -> str: ... + @property + def repository(self) -> Repository: ... + @property + def subject(self) -> NotificationSubject: ... + @property + def subscription_url(self) -> str: ... + @property + def unread(self) -> Optional[bool]: ... + @property + def updated_at(self) -> Optional[datetime]: ... + @property + def url(self) -> Optional[str]: ... + def get_pull_request(self) -> PullRequest: ... + def get_issue(self) -> Issue: ... diff --git a/github/NotificationSubject.pyi b/github/NotificationSubject.pyi new file mode 100644 index 00000000..8030c5b3 --- /dev/null +++ b/github/NotificationSubject.pyi @@ -0,0 +1,14 @@ +from typing import Any, Dict, Optional + +class NotificationSubject: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def latest_comment_url(self) -> Optional[str]: ... + @property + def title(self) -> str: ... + @property + def type(self) -> str: ... + @property + def url(self) -> Optional[str]: ... diff --git a/github/Organization.pyi b/github/Organization.pyi new file mode 100644 index 00000000..a923ef11 --- /dev/null +++ b/github/Organization.pyi @@ -0,0 +1,189 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional, Union + +from github.GithubObject import _NotSetType +from github.Hook import Hook +from github.Label import Label +from github.Migration import Migration +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList +from github.Plan import Plan +from github.Repository import Repository +from github.Team import Team + +class Organization: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + def add_to_members( + self, member: NamedUser, role: Union[_NotSetType, str] = ... + ) -> None: ... + def add_to_public_members(self, public_member: NamedUser) -> None: ... + @property + def avatar_url(self) -> str: ... + @property + def billing_email(self) -> str: ... + @property + def blog(self) -> Optional[str]: ... + @property + def collaborators(self) -> int: ... + @property + def company(self) -> Optional[str]: ... + def convert_to_outside_collaborator(self, member: NamedUser) -> None: ... + def create_fork(self, repo: Repository) -> Repository: ... + def create_hook( + self, + name: str, + config: Dict[str, str], + events: Union[_NotSetType, List[str]] = ..., + active: Union[bool, _NotSetType] = ..., + ) -> Hook: ... + def create_migration( + self, + repos: List[str], + lock_repositories: Union[bool, _NotSetType] = ..., + exclude_attachments: Union[bool, _NotSetType] = ..., + ) -> Migration: ... + def create_repo( + self, + name: str, + description: Union[str, _NotSetType] = ..., + homepage: Union[str, _NotSetType] = ..., + private: Union[bool, _NotSetType] = ..., + has_issues: Union[bool, _NotSetType] = ..., + has_wiki: Union[bool, _NotSetType] = ..., + has_downloads: Union[bool, _NotSetType] = ..., + has_projects: Union[bool, _NotSetType] = ..., + team_id: Union[int, _NotSetType] = ..., + auto_init: Union[bool, _NotSetType] = ..., + license_template: Union[str, _NotSetType] = ..., + gitignore_template: Union[str, _NotSetType] = ..., + allow_squash_merge: Union[bool, _NotSetType] = ..., + allow_merge_commit: Union[bool, _NotSetType] = ..., + allow_rebase_merge: Union[bool, _NotSetType] = ..., + ) -> Repository: ... + def create_team( + self, + name: str, + repo_names: Union[List[Repository], _NotSetType] = ..., + permission: Union[str, _NotSetType] = ..., + privacy: Union[str, _NotSetType] = ..., + description: Union[str, _NotSetType] = ..., + ) -> Team: ... + @property + def created_at(self) -> datetime: ... + def delete_hook(self, id: int) -> None: ... + @property + def description(self) -> str: ... + @property + def disk_usage(self) -> int: ... + def edit( + self, + billing_email: Union[str, _NotSetType] = ..., + blog: Union[str, _NotSetType] = ..., + company: Union[str, _NotSetType] = ..., + description: Union[str, _NotSetType] = ..., + email: Union[str, _NotSetType] = ..., + location: Union[str, _NotSetType] = ..., + name: Union[str, _NotSetType] = ..., + ) -> None: ... + def edit_hook( + self, + id: int, + name: str, + config: Dict[str, str], + events: Union[_NotSetType, List[str]] = ..., + active: Union[bool, _NotSetType] = ..., + ) -> Hook: ... + @property + def email(self) -> Optional[str]: ... + @property + def events_url(self) -> str: ... + @property + def followers(self) -> int: ... + @property + def following(self) -> int: ... + def get_events(self) -> PaginatedList: ... + def get_hooks(self) -> PaginatedList: ... + def get_issues( + self, + filter: Union[str, _NotSetType] = ..., + state: Union[str, _NotSetType] = ..., + labels: Union[List[Label], _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + since: Union[_NotSetType, datetime] = ..., + ) -> PaginatedList: ... + def get_members( + self, + filter_: Union[str, _NotSetType] = ..., + role: Union[str, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_migrations(self) -> PaginatedList: ... + def get_outside_collaborators( + self, filter_: Union[str, _NotSetType] = ... + ) -> PaginatedList: ... + def get_projects(self, state: Union[_NotSetType, str] = ...) -> PaginatedList: ... + def get_public_members(self) -> PaginatedList: ... + def get_repo(self, name: str) -> Repository: ... + def get_repos( + self, + type: Union[str, _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_team(self, id: int) -> Team: ... + def get_team_by_slug(self, slug: str) -> Team: ... + def get_teams(self) -> PaginatedList: ... + @property + def gravatar_id(self) -> str: ... + def has_in_members(self, member: NamedUser) -> bool: ... + def has_in_public_members(self, public_member: NamedUser) -> bool: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + def invitations(self) -> PaginatedList: ... + def invite_user( + self, + user: Union[_NotSetType, NamedUser] = ..., + email: Union[str, _NotSetType] = ..., + role: Union[str, _NotSetType] = ..., + teams: Union[List[Team], _NotSetType] = ..., + ) -> None: ... + @property + def location(self) -> str: ... + @property + def login(self) -> str: ... + @property + def members_url(self) -> str: ... + @property + def name(self) -> Optional[str]: ... + @property + def owned_private_repos(self) -> int: ... + @property + def plan(self) -> Plan: ... + @property + def private_gists(self) -> int: ... + @property + def public_gists(self) -> int: ... + @property + def public_members_url(self) -> str: ... + @property + def public_repos(self) -> int: ... + def remove_from_members(self, member: NamedUser) -> None: ... + def remove_from_membership(self, member: NamedUser) -> None: ... + def remove_from_public_members(self, public_member: NamedUser) -> None: ... + def remove_outside_collaborator(self, collaborator: NamedUser) -> None: ... + @property + def repos_url(self) -> str: ... + @property + def total_private_repos(self) -> int: ... + @property + def two_factor_requirement_enabled(self) -> bool: ... + @property + def type(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/PaginatedList.pyi b/github/PaginatedList.pyi new file mode 100644 index 00000000..dba31151 --- /dev/null +++ b/github/PaginatedList.pyi @@ -0,0 +1,39 @@ +from typing import Any, Dict, Iterator, List, Optional, Union + +from github.ContentFile import ContentFile +from github.GithubObject import GithubObject +from github.Issue import Issue +from github.NamedUser import NamedUser +from github.Requester import Requester + +class PaginatedList: + def __init__( + self, + contentClass: Any, + requester: Requester, + firstUrl: str, + firstParams: Any, + headers: Optional[Dict[str, str]] = ..., + list_item: str = ..., + ) -> None: ... + def __reverse(self) -> None: ... + def __parseLinkHeader(self, headers: Dict[str, str]) -> None: ... + def _couldGrow(self) -> bool: ... + def _fetchNextPage(self) -> Any: ... + def _getLastPageUrl(self) -> Optional[str]: ... + def get_page(self, page: int) -> List[Any]: ... + @property + def reversed(self) -> PaginatedList: ... + @property + def totalCount(self) -> int: ... + +class PaginatedListBase: + def __getitem__(self, index: Union[int, slice]) -> Any: ... + def __init__(self) -> None: ... + def __iter__(self) -> Iterator[GithubObject]: ... + def _grow(self) -> Any: ... + def _isBiggerThan(self, index: int) -> bool: ... + class _Slice: + def __init__(self, theList: PaginatedList, theSlice: slice) -> None: ... + def __iter__(self) -> Iterator[GithubObject]: ... + def __finished(self, index: int) -> bool: ... diff --git a/github/Path.pyi b/github/Path.pyi new file mode 100644 index 00000000..48e98db2 --- /dev/null +++ b/github/Path.pyi @@ -0,0 +1,14 @@ +from typing import Any, Dict + +class Path: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def count(self) -> int: ... + @property + def path(self) -> str: ... + @property + def title(self) -> str: ... + @property + def uniques(self) -> int: ... diff --git a/github/Permissions.pyi b/github/Permissions.pyi new file mode 100644 index 00000000..e3349703 --- /dev/null +++ b/github/Permissions.pyi @@ -0,0 +1,12 @@ +from typing import Any, Dict + +class Permissions: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def admin(self) -> bool: ... + @property + def pull(self) -> bool: ... + @property + def push(self) -> bool: ... diff --git a/github/Plan.pyi b/github/Plan.pyi new file mode 100644 index 00000000..11d204f8 --- /dev/null +++ b/github/Plan.pyi @@ -0,0 +1,14 @@ +from typing import Any, Dict, Union + +class Plan: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def collaborators(self) -> int: ... + @property + def name(self) -> str: ... + @property + def private_repos(self) -> int: ... + @property + def space(self) -> int: ... diff --git a/github/Project.pyi b/github/Project.pyi new file mode 100644 index 00000000..360e734f --- /dev/null +++ b/github/Project.pyi @@ -0,0 +1,39 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList +from github.ProjectColumn import ProjectColumn + +class Project: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def body(self) -> str: ... + @property + def columns_url(self) -> str: ... + def create_column(self, name: str) -> ProjectColumn: ... + @property + def created_at(self) -> datetime: ... + @property + def creator(self) -> NamedUser: ... + def get_columns(self) -> PaginatedList: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def name(self) -> str: ... + @property + def node_id(self) -> str: ... + @property + def number(self) -> int: ... + @property + def owner_url(self) -> str: ... + @property + def state(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/ProjectCard.pyi b/github/ProjectCard.pyi new file mode 100644 index 00000000..e19838ec --- /dev/null +++ b/github/ProjectCard.pyi @@ -0,0 +1,35 @@ +from datetime import datetime +from typing import Any, Dict, Optional, Union + +from github.GithubObject import _NotSetType +from github.Issue import Issue +from github.NamedUser import NamedUser +from github.PullRequest import PullRequest + +class ProjectCard: + def _repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def archived(self) -> bool: ... + @property + def column_url(self) -> str: ... + @property + def content_url(self) -> Optional[str]: ... + @property + def created_at(self) -> datetime: ... + @property + def creator(self) -> NamedUser: ... + def get_content( + self, content_type: Union[_NotSetType, str] = ... + ) -> Optional[Union[PullRequest, Issue]]: ... + @property + def id(self) -> int: ... + @property + def node_id(self) -> str: ... + @property + def note(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/ProjectColumn.py b/github/ProjectColumn.py index 244a3184..604d7e6f 100644 --- a/github/ProjectColumn.py +++ b/github/ProjectColumn.py @@ -126,6 +126,7 @@ class ProjectColumn(github.GithubObject.CompletableGithubObject): :param note: string :param content_id: integer :param content_type: string + :rtype :class:`github.ProjectCard.ProjectCard`: """ post_parameters = {} if isinstance(note, str): diff --git a/github/ProjectColumn.pyi b/github/ProjectColumn.pyi new file mode 100644 index 00000000..ceec2a81 --- /dev/null +++ b/github/ProjectColumn.pyi @@ -0,0 +1,36 @@ +from datetime import datetime +from typing import Any, Dict, Union + +from github.GithubObject import _NotSetType +from github.PaginatedList import PaginatedList +from github.ProjectCard import ProjectCard + +class ProjectColumn: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def cards_url(self) -> str: ... + def create_card( + self, + note: Union[_NotSetType, str] = ..., + content_id: Union[int, _NotSetType] = ..., + content_type: Union[_NotSetType, str] = ..., + ) -> ProjectCard: ... + @property + def created_at(self) -> datetime: ... + def get_cards( + self, archived_state: Union[_NotSetType, str] = ... + ) -> PaginatedList: ... + @property + def id(self) -> int: ... + @property + def name(self) -> str: ... + @property + def node_id(self) -> str: ... + @property + def project_url(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/PullRequest.py b/github/PullRequest.py index e1e7168e..31c667b8 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -823,6 +823,9 @@ class PullRequest(github.GithubObject.CompletableGithubObject): """ :calls: `PUT /repos/:owner/:repo/pulls/:number/merge `_ :param commit_message: string + :param commit_title: string + :param merge_method: string + :param sha: string :rtype: :class:`github.PullRequestMergeStatus.PullRequestMergeStatus` """ assert commit_message is github.GithubObject.NotSet or isinstance( diff --git a/github/PullRequest.pyi b/github/PullRequest.pyi new file mode 100644 index 00000000..bce55b4b --- /dev/null +++ b/github/PullRequest.pyi @@ -0,0 +1,152 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional, Tuple, Union + +from github.Commit import Commit +from github.GithubObject import _NotSetType +from github.Issue import Issue +from github.IssueComment import IssueComment +from github.Label import Label +from github.Milestone import Milestone +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList +from github.PullRequestComment import PullRequestComment +from github.PullRequestMergeStatus import PullRequestMergeStatus +from github.PullRequestPart import PullRequestPart +from github.PullRequestReview import PullRequestReview + +class PullRequest: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + def add_to_labels(self, *labels: Union[Label, str]) -> None: ... + def add_to_assignees(self, *assignees: Union[NamedUser, str]) -> None: ... + @property + def additions(self) -> int: ... + def as_issue(self) -> Issue: ... + @property + def assignee(self) -> NamedUser: ... + @property + def assignees(self) -> List[NamedUser]: ... + @property + def base(self) -> PullRequestPart: ... + @property + def body(self) -> str: ... + @property + def changed_files(self) -> int: ... + @property + def closed_at(self) -> Optional[datetime]: ... + @property + def comments(self) -> int: ... + @property + def comments_url(self) -> str: ... + @property + def commits(self) -> int: ... + @property + def commits_url(self) -> str: ... + def create_comment( + self, body: str, commit_id: Commit, path: str, position: int + ) -> PullRequestComment: ... + def create_issue_comment(self, body: str) -> IssueComment: ... + def create_review( + self, + commit: Commit = ..., + body: Union[_NotSetType, str] = ..., + event: Union[_NotSetType, str] = ..., + comments: Union[_NotSetType, str] = ..., + ) -> PullRequestReview: ... + def create_review_comment( + self, body: str, commit_id: Commit, path: str, position: int + ) -> PullRequestComment: ... + def create_review_request( + self, + reviewers: Union[_NotSetType, str] = ..., + team_reviewers: Union[_NotSetType, str] = ..., + ) -> None: ... + @property + def created_at(self) -> datetime: ... + def delete_labels(self) -> None: ... + def delete_review_request( + self, + reviewers: Union[_NotSetType, str] = ..., + team_reviewers: Union[_NotSetType, str] = ..., + ) -> None: ... + @property + def deletions(self) -> int: ... + @property + def diff_url(self) -> str: ... + def edit( + self, + title: Union[str, _NotSetType] = ..., + body: Union[str, _NotSetType] = ..., + state: Union[str, _NotSetType] = ..., + base: Union[_NotSetType, str] = ..., + ) -> None: ... + def get_comment(self, id: int) -> PullRequestComment: ... + def get_comments(self) -> PaginatedList: ... + def get_commits(self) -> PaginatedList: ... + def get_files(self) -> PaginatedList: ... + def get_issue_comment(self, id: int) -> IssueComment: ... + def get_issue_comments(self) -> PaginatedList: ... + def get_issue_events(self) -> PaginatedList: ... + def get_labels(self) -> PaginatedList: ... + def get_review(self, id: int) -> PullRequestReview: ... + def get_review_comment(self, id: int) -> PullRequestComment: ... + def get_review_comments( + self, since: Union[_NotSetType, datetime] = ... + ) -> PaginatedList: ... + def get_single_review_comments(self, id: int) -> PaginatedList: ... + def get_review_requests(self) -> Tuple[PaginatedList, PaginatedList]: ... + def get_reviews(self) -> PaginatedList: ... + @property + def head(self) -> PullRequestPart: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + def is_merged(self) -> bool: ... + @property + def issue_url(self) -> str: ... + @property + def labels(self) -> List[Label]: ... + def merge( + self, + commit_message: Union[str, _NotSetType] = ..., + commit_title: Union[str, _NotSetType] = ..., + merge_method: Union[str, _NotSetType] = ..., + sha: Union[str, _NotSetType] = ..., + ) -> PullRequestMergeStatus: ... + @property + def merge_commit_sha(self) -> str: ... + @property + def mergeable(self) -> Optional[bool]: ... + @property + def mergeable_state(self) -> str: ... + @property + def merged(self) -> bool: ... + @property + def merged_at(self) -> datetime: ... + @property + def merged_by(self) -> NamedUser: ... + @property + def milestone(self) -> Milestone: ... + @property + def number(self) -> int: ... + @property + def patch_url(self) -> str: ... + def remove_from_labels(self, label: Union[Label, str]) -> None: ... + @property + def review_comment_url(self) -> str: ... + @property + def review_comments(self) -> int: ... + @property + def review_comments_url(self) -> str: ... + def set_labels(self, *labels: Union[Label, str]) -> None: ... + @property + def state(self) -> str: ... + @property + def title(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/PullRequestComment.pyi b/github/PullRequestComment.pyi new file mode 100644 index 00000000..ed1d3292 --- /dev/null +++ b/github/PullRequestComment.pyi @@ -0,0 +1,45 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser +from github.PaginatedList import PaginatedList +from github.Reaction import Reaction + +class PullRequestComment: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def body(self) -> str: ... + @property + def commit_id(self) -> str: ... + def create_reaction(self, reaction_type: str) -> Reaction: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + @property + def diff_hunk(self) -> str: ... + def edit(self, body: str) -> None: ... + def get_reactions(self) -> PaginatedList: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def in_reply_to_id(self) -> int: ... + @property + def original_commit_id(self) -> str: ... + @property + def original_position(self) -> int: ... + @property + def path(self) -> str: ... + @property + def position(self) -> int: ... + @property + def pull_request_url(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/PullRequestMergeStatus.pyi b/github/PullRequestMergeStatus.pyi new file mode 100644 index 00000000..2af07bc2 --- /dev/null +++ b/github/PullRequestMergeStatus.pyi @@ -0,0 +1,12 @@ +from typing import Any, Dict + +class PullRequestMergeStatus: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def merged(self) -> bool: ... + @property + def message(self) -> str: ... + @property + def sha(self) -> str: ... diff --git a/github/PullRequestPart.pyi b/github/PullRequestPart.pyi new file mode 100644 index 00000000..32a949a9 --- /dev/null +++ b/github/PullRequestPart.pyi @@ -0,0 +1,19 @@ +from typing import Any, Dict, Optional + +from github.NamedUser import NamedUser +from github.Repository import Repository + +class PullRequestPart: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def label(self) -> str: ... + @property + def ref(self) -> str: ... + @property + def repo(self) -> Repository: ... + @property + def sha(self) -> str: ... + @property + def user(self) -> Optional[NamedUser]: ... diff --git a/github/PullRequestReview.pyi b/github/PullRequestReview.pyi new file mode 100644 index 00000000..665b0ac1 --- /dev/null +++ b/github/PullRequestReview.pyi @@ -0,0 +1,28 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser + +class PullRequestReview: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def body(self) -> str: ... + @property + def commit_id(self) -> str: ... + def dismiss(self, message: str) -> None: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def pull_request_url(self) -> str: ... + @property + def state(self) -> str: ... + @property + def submitted_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/Rate.pyi b/github/Rate.pyi new file mode 100644 index 00000000..bfa447ac --- /dev/null +++ b/github/Rate.pyi @@ -0,0 +1,13 @@ +from datetime import datetime +from typing import Any, Dict + +class Rate: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def limit(self) -> int: ... + @property + def remaining(self) -> int: ... + @property + def reset(self) -> datetime: ... diff --git a/github/RateLimit.pyi b/github/RateLimit.pyi new file mode 100644 index 00000000..8727f015 --- /dev/null +++ b/github/RateLimit.pyi @@ -0,0 +1,16 @@ +from typing import Any, Dict + +from github.Rate import Rate + +class RateLimit: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def core(self) -> Rate: ... + @property + def graphql(self) -> Rate: ... + @property + def rate(self) -> Rate: ... + @property + def search(self) -> Rate: ... diff --git a/github/Reaction.pyi b/github/Reaction.pyi new file mode 100644 index 00000000..786657b7 --- /dev/null +++ b/github/Reaction.pyi @@ -0,0 +1,18 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser + +class Reaction: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def content(self) -> str: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + @property + def id(self) -> int: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/Referrer.pyi b/github/Referrer.pyi new file mode 100644 index 00000000..30eb2819 --- /dev/null +++ b/github/Referrer.pyi @@ -0,0 +1,12 @@ +from typing import Any, Dict + +class Referrer: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def count(self) -> str: ... + @property + def referrer(self) -> str: ... + @property + def uniques(self) -> int: ... diff --git a/github/Repository.py b/github/Repository.py index fb31df90..681d8324 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -964,6 +964,16 @@ class Repository(github.GithubObject.CompletableGithubObject): """ Convenience function that calls :meth:`Repository.create_git_tag` and :meth:`Repository.create_git_release`. + :param tag: string + :param tag_message: string + :param release_name: string + :param release_message: string + :param object: string + :param type: string + :param tagger: :class:github.InputGitAuthor.InputGitAuthor + :param draft: bool + :param prerelease: bool + :rtype: :class:`github.GitRelease.GitRelease` """ self.create_git_tag(tag, tag_message, object, type, tagger) return self.create_git_release( @@ -2992,7 +3002,7 @@ class Repository(github.GithubObject.CompletableGithubObject): :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` + :rtype: List of :class:`github.Issue.Issue` """ assert state in ["open", "closed"], state assert isinstance(keyword, str), keyword diff --git a/github/Repository.pyi b/github/Repository.pyi new file mode 100644 index 00000000..829f84a3 --- /dev/null +++ b/github/Repository.pyi @@ -0,0 +1,500 @@ +from datetime import date, datetime +from typing import Any, Dict, List, Optional, Union + +from github.AuthenticatedUser import AuthenticatedUser +from github.Branch import Branch +from github.Clones import Clones +from github.Commit import Commit +from github.CommitComment import CommitComment +from github.Comparison import Comparison +from github.ContentFile import ContentFile +from github.Download import Download +from github.GitBlob import GitBlob +from github.GitCommit import GitCommit +from github.GithubObject import _NotSetType +from github.GitRef import GitRef +from github.GitRelease import GitRelease +from github.GitReleaseAsset import GitReleaseAsset +from github.GitTag import GitTag +from github.GitTree import GitTree +from github.Hook import Hook +from github.InputGitAuthor import InputGitAuthor +from github.InputGitTreeElement import InputGitTreeElement +from github.Issue import Issue +from github.IssueEvent import IssueEvent +from github.Label import Label +from github.Milestone import Milestone +from github.NamedUser import NamedUser +from github.Organization import Organization +from github.PaginatedList import PaginatedList +from github.Path import Path +from github.Permissions import Permissions +from github.Project import Project +from github.PullRequest import PullRequest +from github.Referrer import Referrer +from github.RepositoryKey import RepositoryKey +from github.SourceImport import SourceImport +from github.StatsCodeFrequency import StatsCodeFrequency +from github.StatsCommitActivity import StatsCommitActivity +from github.StatsContributor import StatsContributor +from github.StatsParticipation import StatsParticipation +from github.StatsPunchCard import StatsPunchCard +from github.View import View + +class Repository: + def __repr__(self) -> str: ... + def _hub( + self, mode: str, event: str, callback: str, secret: Union[str, _NotSetType] + ) -> None: ... + @property + def _identity(self) -> str: ... + def _initAttributes(self) -> None: ... + def _legacy_convert_issue(self, attributes: Dict[str, Any]) -> Dict[str, Any]: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def allow_merge_commit(self) -> bool: ... + @property + def allow_rebase_merge(self) -> bool: ... + @property + def allow_squash_merge(self) -> bool: ... + @property + def archived(self) -> bool: ... + def add_to_collaborators( + self, + collaborator: Union[str, NamedUser], + permission: Union[str, _NotSetType] = ..., + ) -> None: ... + @property + def archive_url(self) -> str: ... + @property + def assignees_url(self) -> str: ... + @property + def blobs_url(self) -> str: ... + @property + def branches_url(self) -> str: ... + @property + def clone_url(self) -> str: ... + @property + def collaborators_url(self) -> str: ... + @property + def comments_url(self) -> str: ... + @property + def commits_url(self) -> str: ... + def compare(self, base: str, head: str) -> Comparison: ... + @property + def compare_url(self) -> str: ... + @property + def contents_url(self) -> str: ... + @property + def contributors_url(self) -> str: ... + def create_file( + self, + path: str, + message: str, + content: str, + branch: Union[str, _NotSetType] = ..., + committer: Union[InputGitAuthor, _NotSetType] = ..., + author: Union[InputGitAuthor, _NotSetType] = ..., + ) -> Dict[str, Union[ContentFile, Commit]]: ... + def create_git_blob(self, content: str, encoding: str) -> GitBlob: ... + def create_git_commit( + self, + message: str, + tree: GitTree, + parents: List[GitCommit], + author: Union[InputGitAuthor, _NotSetType] = ..., + committer: Union[InputGitAuthor, _NotSetType] = ..., + ) -> GitCommit: ... + def create_git_ref(self, ref: str, sha: str) -> GitRef: ... + def create_git_release( + self, + tag: str, + name: str, + message: str, + draft: bool = ..., + prerelease: bool = ..., + target_commitish: Union[str, _NotSetType] = ..., + ) -> GitRelease: ... + def create_git_tag( + self, + tag: str, + message: str, + object: str, + type: str, + tagger: Union[InputGitAuthor, _NotSetType] = ..., + ) -> GitTag: ... + def create_git_tag_and_release( + self, + tag: str, + tag_message: str, + release_name: str, + release_message: str, + object: str, + type: str, + tagger: Union[InputGitAuthor, _NotSetType] = ..., + draft: bool = ..., + prerelease: bool = ..., + ) -> GitRelease: ... + def create_git_tree( + self, + tree: List[InputGitTreeElement], + base_tree: Union[GitTree, _NotSetType] = ..., + ) -> GitTree: ... + def create_hook( + self, + name: str, + config: Dict[str, str], + events: Union[_NotSetType, List[str]] = ..., + active: Union[bool, _NotSetType] = ..., + ) -> Hook: ... + def create_issue( + self, + title: str, + body: Union[str, _NotSetType] = ..., + assignee: Union[NamedUser, str, _NotSetType] = ..., + milestone: Union[Milestone, _NotSetType] = ..., + labels: Union[List[Label], _NotSetType, List[str]] = ..., + assignees: Union[_NotSetType, List[str], List[NamedUser]] = ..., + ) -> Issue: ... + def create_key( + self, title: str, key: str, read_only: bool = ... + ) -> RepositoryKey: ... + def create_label( + self, name: str, color: str, description: Union[str, _NotSetType] = ... + ) -> Label: ... + def create_milestone( + self, + title: str, + state: Union[str, _NotSetType] = ..., + description: Union[str, _NotSetType] = ..., + due_on: Union[date, _NotSetType] = ..., + ) -> Milestone: ... + def create_project(self, name: str, body: str = ...) -> Project: ... + def create_pull(self, *args, **kwds) -> PullRequest: ... + def create_source_import( + self, + vcs: str, + vcs_url: str, + vcs_username: Union[str, _NotSetType] = ..., + vcs_password: Union[str, _NotSetType] = ..., + ) -> SourceImport: ... + @property + def created_at(self) -> datetime: ... + @property + def default_branch(self) -> str: ... + def delete(self) -> None: ... + def delete_file( + self, + path: str, + message: str, + sha: str, + branch: Union[str, _NotSetType] = ..., + committer: Union[InputGitAuthor, _NotSetType] = ..., + author: Union[InputGitAuthor, _NotSetType] = ..., + ) -> Dict[str, Union[Commit, _NotSetType]]: ... + @property + def description(self) -> str: ... + def disable_automated_security_fixes(self) -> bool: ... + def disable_vulnerability_alert(self) -> bool: ... + @property + def downloads_url(self) -> str: ... + def edit( + self, + name: Optional[str] = ..., + description: Union[str, _NotSetType] = ..., + homepage: Union[str, _NotSetType] = ..., + private: Union[bool, _NotSetType] = ..., + has_issues: Union[bool, _NotSetType] = ..., + has_projects: Union[bool, _NotSetType] = ..., + has_wiki: Union[bool, _NotSetType] = ..., + has_downloads: Union[bool, _NotSetType] = ..., + default_branch: Union[str, _NotSetType] = ..., + allow_squash_merge: Union[bool, _NotSetType] = ..., + allow_merge_commit: Union[bool, _NotSetType] = ..., + allow_rebase_merge: Union[bool, _NotSetType] = ..., + archived: Union[bool, _NotSetType] = ..., + ) -> None: ... + def enable_automated_security_fixes(self) -> bool: ... + def enable_vulnerability_alert(self) -> bool: ... + @property + def events_url(self) -> str: ... + @property + def fork(self) -> bool: ... + @property + def forks(self) -> int: ... + @property + def forks_count(self) -> int: ... + @property + def forks_url(self) -> str: ... + @property + def full_name(self) -> str: ... + def get_archive_link( + self, archive_format: str, ref: Union[str, _NotSetType] = ... + ) -> str: ... + def get_assignees(self) -> PaginatedList: ... + def get_branch(self, branch: str) -> Branch: ... + def get_branches(self) -> PaginatedList: ... + def get_clones_traffic( + self, per: Union[str, _NotSetType] = ... + ) -> Dict[str, Union[int, List[Clones]]]: ... + def get_collaborator_permission( + self, collaborator: Union[str, NamedUser] + ) -> str: ... + def get_collaborators( + self, affiliation: Union[str, _NotSetType] = ... + ) -> PaginatedList: ... + def get_comment(self, id: int) -> CommitComment: ... + def get_comments(self) -> PaginatedList: ... + def get_commit(self, sha: str) -> Commit: ... + def get_commits( + self, + sha: Union[str, _NotSetType] = ..., + path: Union[str, _NotSetType] = ..., + since: Union[_NotSetType, datetime] = ..., + until: Union[_NotSetType, datetime] = ..., + author: Union[AuthenticatedUser, NamedUser, str, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_contents( + self, path: str, ref: Union[str, _NotSetType] = ... + ) -> Union[List[ContentFile], ContentFile]: ... + def get_contributors( + self, anon: Union[str, _NotSetType] = ... + ) -> PaginatedList: ... + def get_dir_contents( + self, path: str, ref: Union[str, _NotSetType] = ... + ) -> List[ContentFile]: ... + def get_download(self, id: int) -> Download: ... + def get_downloads(self) -> PaginatedList: ... + def get_events(self) -> PaginatedList: ... + def get_forks(self) -> PaginatedList: ... + def get_git_blob(self, sha: str) -> GitBlob: ... + def get_git_commit(self, sha: str) -> GitCommit: ... + def get_git_ref(self, ref: str) -> GitRef: ... + def get_git_refs(self) -> PaginatedList: ... + def get_git_tag(self, sha: str) -> GitTag: ... + def get_git_tree( + self, sha: str, recursive: Union[bool, _NotSetType] = ... + ) -> GitTree: ... + def get_hook(self, id: int) -> Hook: ... + def get_hooks(self) -> PaginatedList: ... + def get_issue(self, number: int) -> Issue: ... + def get_issues( + self, + milestone: Union[Milestone, str, _NotSetType] = ..., + state: Union[str, _NotSetType] = ..., + assignee: Union[NamedUser, str, _NotSetType] = ..., + mentioned: Union[_NotSetType, NamedUser] = ..., + labels: Union[List[Label], _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + since: Union[_NotSetType, datetime] = ..., + creator: Union[NamedUser, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_issues_comments( + self, + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + since: Union[_NotSetType, datetime] = ..., + ) -> PaginatedList: ... + def get_issues_event(self, id: int) -> IssueEvent: ... + def get_issues_events(self) -> PaginatedList: ... + def get_key(self, id: int) -> RepositoryKey: ... + def get_keys(self) -> PaginatedList: ... + def get_label(self, name: str) -> Label: ... + def get_labels(self) -> PaginatedList: ... + def get_languages(self) -> Dict[str, int]: ... + def get_latest_release(self) -> GitRelease: ... + def get_license(self) -> ContentFile: ... + def get_milestone(self, number: int) -> Milestone: ... + def get_milestones( + self, + state: Union[str, _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_network_events(self) -> PaginatedList: ... + def get_notifications( + self, + all: Union[bool, _NotSetType] = ..., + participating: Union[bool, _NotSetType] = ..., + since: Union[datetime, _NotSetType] = ..., + before: Union[datetime, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_pending_invitations(self) -> PaginatedList: ... + def get_projects(self, state: Union[str, _NotSetType] = ...) -> PaginatedList: ... + def get_pull(self, number: int) -> PullRequest: ... + def get_pulls( + self, + state: Union[str, _NotSetType] = ..., + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + base: Union[str, _NotSetType] = ..., + head: Union[str, _NotSetType] = ..., + ) -> PaginatedList: ... + def get_pulls_comments( + self, + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + since: Union[_NotSetType, datetime] = ..., + ) -> PaginatedList: ... + def get_pulls_review_comments( + self, + sort: Union[str, _NotSetType] = ..., + direction: Union[str, _NotSetType] = ..., + since: Union[_NotSetType, datetime] = ..., + ) -> PaginatedList: ... + def get_readme(self, ref: Union[str, _NotSetType] = ...) -> ContentFile: ... + def get_release(self, id: Union[int, str]) -> GitRelease: ... + def get_release_asset(self, id: int) -> GitReleaseAsset: ... + def get_releases(self) -> PaginatedList: ... + def get_source_import(self) -> SourceImport: ... + def get_stargazers(self) -> PaginatedList: ... + def get_stargazers_with_dates(self) -> PaginatedList: ... + def get_stats_code_frequency(self) -> Optional[List[StatsCodeFrequency]]: ... + def get_stats_commit_activity(self) -> Optional[List[StatsCommitActivity]]: ... + def get_stats_contributors(self) -> Optional[List[StatsContributor]]: ... + def get_stats_participation(self) -> Optional[StatsParticipation]: ... + def get_stats_punch_card(self) -> Optional[StatsPunchCard]: ... + def get_subscribers(self) -> PaginatedList: ... + def get_tags(self) -> PaginatedList: ... + def get_teams(self) -> PaginatedList: ... + def get_top_paths(self) -> List[Path]: ... + def get_top_referrers(self) -> List[Referrer]: ... + def get_topics(self) -> List[str]: ... + def get_views_traffic( + self, per: Union[str, _NotSetType] = ... + ) -> Dict[str, Union[int, List[View]]]: ... + def get_vulnerability_alert(self) -> bool: ... + def get_watchers(self) -> PaginatedList: ... + @property + def git_commits_url(self) -> str: ... + @property + def git_refs_url(self) -> str: ... + @property + def git_tags_url(self) -> str: ... + @property + def git_url(self) -> str: ... + @property + def has_downloads(self) -> bool: ... + def has_in_assignees(self, assignee: Union[str, NamedUser]) -> bool: ... + def has_in_collaborators(self, collaborator: Union[str, NamedUser]) -> bool: ... + @property + def has_issues(self) -> bool: ... + @property + def has_projects(self) -> bool: ... + @property + def has_wiki(self) -> bool: ... + @property + def homepage(self) -> str: ... + @property + def hooks_url(self) -> str: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def issue_comment_url(self) -> str: ... + @property + def issue_events_url(self) -> str: ... + @property + def issues_url(self) -> str: ... + @property + def keys_url(self) -> str: ... + @property + def labels_url(self) -> str: ... + @property + def language(self) -> str: ... + @property + def languages_url(self) -> str: ... + def legacy_search_issues(self, state: str, keyword: str) -> List[Issue]: ... + def mark_notifications_as_read(self, last_read_at: datetime = ...) -> None: ... + @property + def master_branch(self) -> Optional[str]: ... + def merge( + self, base: str, head: str, commit_message: Union[str, _NotSetType] = ... + ) -> Optional[Commit]: ... + @property + def merges_url(self) -> str: ... + @property + def milestones_url(self) -> str: ... + @property + def mirror_url(self) -> str: ... + @property + def name(self) -> str: ... + @property + def network_count(self) -> int: ... + @property + def notifications_url(self) -> str: ... + @property + def open_issues(self) -> int: ... + @property + def open_issues_count(self) -> int: ... + @property + def organization(self) -> Organization: ... + @property + def owner(self) -> NamedUser: ... + @property + def parent(self) -> Repository: ... + @property + def permissions(self) -> Permissions: ... + @property + def private(self) -> bool: ... + @property + def pulls_url(self) -> str: ... + @property + def pushed_at(self) -> datetime: ... + def remove_from_collaborators( + self, collaborator: Union[str, NamedUser] + ) -> None: ... + def remove_invitation(self, invite_id: int) -> None: ... + def replace_topics(self, topics: List[str]) -> None: ... + @property + def size(self) -> int: ... + @property + def source(self) -> Optional[Repository]: ... + @property + def ssh_url(self) -> str: ... + @property + def stargazers_count(self) -> str: ... + @property + def stargazers_url(self) -> str: ... + @property + def statuses_url(self) -> str: ... + def subscribe_to_hub( + self, event: str, callback: str, secret: Union[str, _NotSetType] = ... + ) -> None: ... + @property + def subscribers_count(self) -> int: ... + @property + def subscribers_url(self) -> str: ... + @property + def subscription_url(self) -> str: ... + @property + def svn_url(self) -> str: ... + @property + def tags_url(self) -> str: ... + @property + def teams_url(self) -> str: ... + @property + def topics(self) -> List[str]: ... + @property + def trees_url(self) -> str: ... + def unsubscribe_from_hub(self, event: str, callback: str) -> None: ... + def update_file( + self, + path: str, + message: str, + content: str, + sha: str, + branch: Union[_NotSetType, str] = ..., + committer: Union[_NotSetType, InputGitAuthor] = ..., + author: Union[_NotSetType, InputGitAuthor] = ..., + ) -> Dict[str, Union[ContentFile, Commit]]: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... + @property + def watchers(self) -> int: ... + @property + def watchers_count(self) -> int: ... diff --git a/github/RepositoryKey.pyi b/github/RepositoryKey.pyi new file mode 100644 index 00000000..6ad15b24 --- /dev/null +++ b/github/RepositoryKey.pyi @@ -0,0 +1,22 @@ +from datetime import datetime +from typing import Any, Dict + +class RepositoryKey: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def created_at(self) -> datetime: ... + def delete(self) -> None: ... + @property + def id(self) -> int: ... + @property + def key(self) -> str: ... + @property + def read_only(self) -> bool: ... + @property + def title(self) -> str: ... + @property + def url(self) -> str: ... + @property + def verified(self) -> bool: ... diff --git a/github/Requester.pyi b/github/Requester.pyi new file mode 100644 index 00000000..065be274 --- /dev/null +++ b/github/Requester.pyi @@ -0,0 +1,178 @@ +from collections import OrderedDict +from io import BufferedReader +from typing import Any, Callable, Dict, Iterator, Optional, Tuple, Union + +from requests.models import Response + +from github.GithubObject import GithubObject +from tests.Framework import ReplayingHttpsConnection + +# from urllib3.util.retry import Retry + +class HTTPRequestsConnectionClass: + def __init__( + self, + host: str, + port: Optional[int] = ..., + strict: bool = ..., + timeout: Optional[int] = ..., + retry: Any = ..., + **kwargs + ) -> None: ... + def close(self) -> None: ... + def getresponse(self) -> RequestsResponse: ... + def request( + self, verb: str, url: str, input: None, headers: Dict[str, str] + ) -> None: ... + +class HTTPSRequestsConnectionClass: + def __init__( + self, + host: str, + port: Optional[int] = ..., + strict: bool = ..., + timeout: Optional[int] = ..., + retry: Any = ..., + **kwargs + ) -> None: ... + def close(self) -> None: ... + def getresponse(self) -> RequestsResponse: ... + def request( + self, + verb: str, + url: str, + input: Optional[Union[str, BufferedReader]], + headers: Dict[str, str], + ) -> None: ... + +class Requester: + def DEBUG_ON_RESPONSE( + self, statusCode: int, responseHeader: Dict[str, str], data: str + ) -> None: ... + def NEW_DEBUG_FRAME(self, requestHeader: Dict[str, str]) -> None: ... + def __check( + self, status: int, responseHeader: Dict[str, Any], output: str, + ) -> Tuple[Dict[str, Any], Dict[str, Any]]: ... + def __addParametersToUrl(self, url: str, parameters: Dict[str, Any],) -> str: ... + def __authenticate( + self, url: str, responseHeader: Dict[str, Any], parameters: Dict[str, Any], + ) -> None: ... + def __customConnection(self, url: str,) -> Optional[ReplayingHttpsConnection]: ... + def __createConnection( + self, + ) -> Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]: ... + def __createException( + self, status: int, headers: Dict[str, Any], output: str, + ) -> Any: ... + def __log( + self, + verb: str, + url: str, + requestHeaders: Dict[str, str], + input: Optional[str], + status: Optional[int], + responseHeader: Dict[str, Any], + output: Optional[str], + ) -> None: ... + def __makeAbsoluteUrl(self, url: str) -> str: ... + def __structuredFromJson(self, data: str) -> Optional[Dict[str, Any]]: ... + def __requestEncode( + self, + verb: str, + url: str, + parameters: Dict[str, str] = ..., + headers: Dict[str, str] = ..., + input: Optional[str] = ..., + encode: Callable = ..., + ) -> Tuple[int, Dict[str, Any], str]: ... + def __requestRaw( + self, + verb: str, + url: str, + parameters: Dict[str, str] = ..., + headers: Dict[str, str] = ..., + input: Optional[str] = ..., + ) -> Tuple[int, Dict[str, Any], str]: ... + def __init__( + self, + login_or_token: Optional[str], + password: Optional[str], + jwt: Optional[str], + base_url: str, + timeout: int, + client_id: Optional[str], + client_secret: Optional[str], + user_agent: str, + per_page: int, + api_preview: bool, + verify: bool, + retry: Any, + ) -> None: ... + def _initializeDebugFeature(self) -> None: ... + def check_me(self, obj: GithubObject) -> None: ... + @classmethod + def injectConnectionClasses( + cls, httpConnectionClass: Callable, httpsConnectionClass: Callable + ) -> None: ... + def requestBlob( + self, + verb: str, + url: str, + parameters: Dict[str, str] = ..., + headers: Dict[str, str] = ..., + input: Optional[str] = ..., + cnx: Optional[ReplayingHttpsConnection] = ..., + ) -> Tuple[int, Dict[str, Any], str]: ... + def requestBlobAndCheck( + self, + verb: str, + url: str, + parameters: Optional[Dict[str, Any]] = ..., + headers: Optional[Dict[str, Any]] = ..., + input: Optional[str] = ..., + ) -> Tuple[Dict[str, Any], Optional[Dict[str, Any]]]: ... + def requestJson( + self, + verb: str, + url: str, + parameters: Optional[Dict[str, Any]] = ..., + headers: Optional[Dict[str, Any]] = ..., + input: Optional[Any] = ..., + cnx: Optional[ReplayingHttpsConnection] = ..., + ) -> Tuple[int, Dict[str, Any], str]: ... + def requestJsonAndCheck( + self, + verb: str, + url: str, + parameters: Optional[Dict[str, Any]] = ..., + headers: Optional[Dict[str, str]] = ..., + input: Optional[Any] = ..., + ) -> Tuple[Dict[str, Any], Optional[Dict[str, Any]]]: ... + def requestMultipart( + self, + verb: str, + url: str, + parameters: Optional[Dict[str, Any]] = ..., + headers: Optional[Dict[str, Any]] = ..., + input: Optional[OrderedDict] = ..., + cnx: Optional[ReplayingHttpsConnection] = ..., + ) -> Tuple[int, Dict[str, Any], str]: ... + def requestMultipartAndCheck( + self, + verb: str, + url: str, + parameters: Optional[Dict[str, Any]] = ..., + headers: Optional[Dict[str, Any]] = ..., + input: Optional[OrderedDict] = ..., + ) -> Tuple[Dict[str, Any], Optional[Dict[str, Any]]]: ... + @classmethod + def resetConnectionClasses(cls) -> None: ... + @classmethod + def setDebugFlag(cls, flag: bool) -> None: ... + @classmethod + def setOnCheckMe(cls, onCheckMe: Callable) -> None: ... + +class RequestsResponse: + def __init__(self, r: Response) -> None: ... + def getheaders(self) -> Iterator[Any]: ... + def read(self) -> str: ... diff --git a/github/RequiredPullRequestReviews.pyi b/github/RequiredPullRequestReviews.pyi new file mode 100644 index 00000000..16d14a24 --- /dev/null +++ b/github/RequiredPullRequestReviews.pyi @@ -0,0 +1,21 @@ +from typing import Any, Dict, List, Optional + +from github.NamedUser import NamedUser +from github.Team import Team + +class RequiredPullRequestReviews: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def dismiss_stale_reviews(self) -> bool: ... + @property + def dismissal_teams(self) -> Optional[List[Team]]: ... + @property + def dismissal_users(self) -> Optional[List[NamedUser]]: ... + @property + def require_code_owner_reviews(self) -> bool: ... + @property + def required_approving_review_count(self) -> int: ... + @property + def url(self) -> int: ... diff --git a/github/RequiredStatusChecks.pyi b/github/RequiredStatusChecks.pyi new file mode 100644 index 00000000..7dcfe11d --- /dev/null +++ b/github/RequiredStatusChecks.pyi @@ -0,0 +1,12 @@ +from typing import Any, Dict, List + +class RequiredStatusChecks: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def contexts(self) -> List[str]: ... + @property + def strict(self) -> bool: ... + @property + def url(self) -> str: ... diff --git a/github/SourceImport.pyi b/github/SourceImport.pyi new file mode 100644 index 00000000..5fb1673e --- /dev/null +++ b/github/SourceImport.pyi @@ -0,0 +1,32 @@ +from typing import Any, Dict, Optional + +class SourceImport: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def authors_count(self) -> int: ... + @property + def authors_url(self) -> str: ... + @property + def has_large_files(self) -> bool: ... + @property + def html_url(self) -> str: ... + @property + def large_files_count(self) -> int: ... + @property + def large_files_size(self) -> int: ... + @property + def repository_url(self) -> str: ... + @property + def status(self) -> str: ... + @property + def status_text(self) -> str: ... + @property + def url(self) -> str: ... + @property + def use_lfs(self) -> str: ... + @property + def vcs(self) -> str: ... + @property + def vcs_url(self) -> str: ... diff --git a/github/Stargazer.pyi b/github/Stargazer.pyi new file mode 100644 index 00000000..8b4d2028 --- /dev/null +++ b/github/Stargazer.pyi @@ -0,0 +1,13 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser + +class Stargazer: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def starred_at(self) -> datetime: ... + @property + def user(self) -> NamedUser: ... diff --git a/github/StatsCodeFrequency.pyi b/github/StatsCodeFrequency.pyi new file mode 100644 index 00000000..325db717 --- /dev/null +++ b/github/StatsCodeFrequency.pyi @@ -0,0 +1,12 @@ +from datetime import datetime +from typing import List + +class StatsCodeFrequency: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: List[int]) -> None: ... + @property + def additions(self) -> int: ... + @property + def deletions(self) -> int: ... + @property + def week(self) -> datetime: ... diff --git a/github/StatsCommitActivity.pyi b/github/StatsCommitActivity.pyi new file mode 100644 index 00000000..8bc3b216 --- /dev/null +++ b/github/StatsCommitActivity.pyi @@ -0,0 +1,12 @@ +from datetime import datetime +from typing import Any, Dict, List + +class StatsCommitActivity: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def days(self) -> List[int]: ... + @property + def total(self) -> int: ... + @property + def week(self) -> datetime: ... diff --git a/github/StatsContributor.pyi b/github/StatsContributor.pyi new file mode 100644 index 00000000..46a85fe9 --- /dev/null +++ b/github/StatsContributor.pyi @@ -0,0 +1,25 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional + +from github.NamedUser import NamedUser + +class StatsContributor: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def author(self) -> NamedUser: ... + @property + def total(self) -> int: ... + @property + def weeks(self) -> List[Week]: ... + class Week: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, int]) -> None: ... + @property + def a(self) -> int: ... + @property + def c(self) -> int: ... + @property + def d(self) -> int: ... + @property + def w(self) -> datetime: ... diff --git a/github/StatsParticipation.pyi b/github/StatsParticipation.pyi new file mode 100644 index 00000000..3883fec3 --- /dev/null +++ b/github/StatsParticipation.pyi @@ -0,0 +1,9 @@ +from typing import Dict, List + +class StatsParticipation: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, List[int]]) -> None: ... + @property + def all(self) -> List[int]: ... + @property + def owner(self) -> List[int]: ... diff --git a/github/StatsPunchCard.pyi b/github/StatsPunchCard.pyi new file mode 100644 index 00000000..1525ecf0 --- /dev/null +++ b/github/StatsPunchCard.pyi @@ -0,0 +1,6 @@ +from typing import List + +class StatsPunchCard: + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: List[List[int]]) -> None: ... + def get(self, day: int, hour: int) -> int: ... diff --git a/github/Tag.pyi b/github/Tag.pyi new file mode 100644 index 00000000..9d0112cc --- /dev/null +++ b/github/Tag.pyi @@ -0,0 +1,16 @@ +from typing import Any, Dict + +from github.Commit import Commit + +class Tag: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def commit(self) -> Commit: ... + @property + def name(self) -> str: ... + @property + def tarball_url(self) -> str: ... + @property + def zipball_url(self) -> str: ... diff --git a/github/Team.pyi b/github/Team.pyi new file mode 100644 index 00000000..6bcc0d9b --- /dev/null +++ b/github/Team.pyi @@ -0,0 +1,61 @@ +from typing import Any, Dict, Union + +from github.GithubObject import _NotSetType +from github.NamedUser import NamedUser +from github.Organization import Organization +from github.PaginatedList import PaginatedList +from github.Repository import Repository + +class Team: + def __repr__(self) -> str: ... + @property + def _identity(self) -> int: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + def add_membership( + self, member: NamedUser, role: Union[str, _NotSetType] = ... + ) -> None: ... + def add_to_members(self, member: NamedUser) -> None: ... + def add_to_repos(self, repo: Repository) -> None: ... + def delete(self) -> None: ... + @property + def description(self) -> str: ... + def edit( + self, + name: str, + description: Union[str, _NotSetType] = ..., + permission: Union[str, _NotSetType] = ..., + privacy: Union[str, _NotSetType] = ..., + ) -> None: ... + def get_discussions(self) -> PaginatedList: ... + def get_members(self, role: Union[str, _NotSetType] = ...) -> PaginatedList: ... + def get_repos(self) -> PaginatedList: ... + def has_in_members(self, member: NamedUser) -> bool: ... + def has_in_repos(self, repo: Repository) -> bool: ... + @property + def id(self) -> int: ... + def invitations(self) -> PaginatedList: ... + @property + def members_count(self) -> int: ... + @property + def members_url(self) -> str: ... + @property + def name(self) -> str: ... + @property + def organization(self) -> Organization: ... + @property + def permission(self) -> str: ... + @property + def privacy(self) -> str: ... + def remove_from_members(self, member: NamedUser) -> None: ... + def remove_from_repos(self, repo: Repository) -> None: ... + def remove_membership(self, member: NamedUser) -> None: ... + @property + def repos_count(self) -> int: ... + @property + def repositories_url(self) -> str: ... + def set_repo_permission(self, repo: Repository, permission: str) -> None: ... + @property + def slug(self) -> str: ... + @property + def url(self) -> str: ... diff --git a/github/TeamDiscussion.pyi b/github/TeamDiscussion.pyi new file mode 100644 index 00000000..440f51f5 --- /dev/null +++ b/github/TeamDiscussion.pyi @@ -0,0 +1,43 @@ +from datetime import datetime +from typing import Any, Dict + +from github.NamedUser import NamedUser + +class TeamDiscussion: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def author(self) -> NamedUser: ... + @property + def body(self) -> str: ... + @property + def body_html(self) -> str: ... + @property + def body_version(self) -> str: ... + @property + def comments_count(self) -> int: ... + @property + def comments_url(self) -> str: ... + @property + def created_at(self) -> datetime: ... + @property + def html_url(self) -> str: ... + @property + def last_edited_at(self) -> datetime: ... + @property + def node_id(self) -> str: ... + @property + def number(self) -> int: ... + @property + def pinned(self) -> bool: ... + @property + def private(self) -> bool: ... + @property + def team_url(self) -> str: ... + @property + def title(self) -> str: ... + @property + def updated_at(self) -> datetime: ... + @property + def url(self) -> str: ... diff --git a/github/Topic.pyi b/github/Topic.pyi new file mode 100644 index 00000000..14f5541c --- /dev/null +++ b/github/Topic.pyi @@ -0,0 +1,14 @@ +from typing import Any, Dict + +class Topic: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def description(self) -> str: ... + @property + def display_name(self) -> str: ... + @property + def name(self) -> str: ... + @property + def short_description(self) -> str: ... diff --git a/github/UserKey.pyi b/github/UserKey.pyi new file mode 100644 index 00000000..31ca4b5c --- /dev/null +++ b/github/UserKey.pyi @@ -0,0 +1,17 @@ +from typing import Any, Dict + +class UserKey: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + def delete(self) -> None: ... + @property + def id(self) -> int: ... + @property + def key(self) -> str: ... + @property + def title(self) -> str: ... + @property + def url(self) -> str: ... + @property + def verified(self) -> bool: ... diff --git a/github/View.pyi b/github/View.pyi new file mode 100644 index 00000000..0df8625e --- /dev/null +++ b/github/View.pyi @@ -0,0 +1,13 @@ +from datetime import datetime +from typing import Any, Dict + +class View: + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def timestamp(self) -> datetime: ... + @property + def count(self) -> int: ... + @property + def uniques(self) -> int: ... diff --git a/github/__init__.py b/github/__init__.py index 3bf517b1..56c870f6 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -41,7 +41,7 @@ import logging from github.MainClass import Github, GithubIntegration -from .GithubException import ( +from .GithubException import ( # type: ignore BadAttributeException, BadCredentialsException, BadUserAgentException, diff --git a/tests/Framework.py b/tests/Framework.py index 9c1afb01..d0420c72 100644 --- a/tests/Framework.py +++ b/tests/Framework.py @@ -42,9 +42,9 @@ import os import traceback import unittest -import httpretty +import httpretty # type: ignore from requests.structures import CaseInsensitiveDict -from urllib3.util import Url +from urllib3.util import Url # type: ignore import github @@ -263,7 +263,7 @@ class BasicTestCase(unittest.TestCase): self.__openFile("w"), *args, **kwds ), ) - import GithubCredentials + import GithubCredentials # type: ignore self.login = GithubCredentials.login self.password = GithubCredentials.password